You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The current change detection feature using the --changed-flag seems to only work once a change has been committed.
But there are use-cases, where I would like to execute Terramate scripts on changed stacks only, even before I have committed any files:
Local build scripts: To run terraform init, terraform validate, terraform-docs, ... via a VS Code build task on demand
Pre-commit hooks: To validate any changed stacks before the commit is accepted
It takes too long to run these scripts against all stacks within the entire repository every time, so having this additional change detection would be a massive time-saver.
E.g., if I change a file within my reusable module modules/my-module, I would also like to run my build script & pre-commit hook against any stacks that use that module.
Describe the solution you'd like
An option within the CLI that uses the locally changed files (unstaged & staged) as the input for the change detection logic - either integrated into the existing --changed flag, or via a new flag.
Describe alternatives you've considered
Using pre-commit with custom scripts, or manually parsing git diff --name-only to find changed stacks. But as described, both options will not detect dependant stacks.
@cwe1ss this is a great idea and we have now decided to put it on the next priorities. We do not have an ETA yet, but the desired change request has been accepted and the team will plan the changes now. cc @i4ki
Is your feature request related to a problem? Please describe.
The current change detection feature using the
--changed
-flag seems to only work once a change has been committed.But there are use-cases, where I would like to execute Terramate scripts on changed stacks only, even before I have committed any files:
terraform init
,terraform validate
,terraform-docs
, ... via a VS Code build task on demandIt takes too long to run these scripts against all stacks within the entire repository every time, so having this additional change detection would be a massive time-saver.
Pre-commit (and pre-commit-terraform) have some support for this by sending the changed files to the hook, but this does not work with Terramate's advanced features like Terraform module change detection to detect dependant stacks or File Watchers.
E.g., if I change a file within my reusable module
modules/my-module
, I would also like to run my build script & pre-commit hook against any stacks that use that module.Describe the solution you'd like
An option within the CLI that uses the locally changed files (unstaged & staged) as the input for the change detection logic - either integrated into the existing
--changed
flag, or via a new flag.Describe alternatives you've considered
Using pre-commit with custom scripts, or manually parsing
git diff --name-only
to find changed stacks. But as described, both options will not detect dependant stacks.Additional context
See discussion on discord: https://discord.com/channels/1088753599951151154/1088769572305383484/threads/1200441992233099384
The text was updated successfully, but these errors were encountered: