-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: consider untracked/uncommitted in the change detector. #1904
Conversation
|
Preview of ubuntu-focal/go1.21 tests in dce1450🔍 View Details on Terramate Cloud .
benchmarks/changed
cmd/terramate/cli
config
git
hcl
stack
e2etests/core |
Preview of macos-ventura/go1.21 tests in dce1450🔍 View Details on Terramate Cloud .
benchmarks/changed
cmd/terramate/cli
config
git
hcl
stack
e2etests/core |
|
e89fabb
to
6f553c3
Compare
fb211bf
to
cabc712
Compare
stack/manager.go
Outdated
@@ -130,11 +136,40 @@ func (m *Manager) ListChanged(gitBaseRef string) (*Report, error) { | |||
return nil, errors.E(errListChanged, err) | |||
} | |||
|
|||
changedFiles, err := m.changedFiles(gitBaseRef) | |||
_, err = m.changedFiles(cfg.BaseRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is hard to reason about, the memoization is just an internal thing, but here the caller relies on that behaviour.
Would it be possible to add checks.UncommittedFiles
and checks.UntrackedFiles
as params to m.changedFiles
(with the option of them being empty), then do the appending in there?
Signed-off-by: i4k <[email protected]>
Signed-off-by: i4k <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
## What this PR does / why we need it: This flag was planned to be added to `experimental trigger` but later realized as not needed but I forgot to rollback. This is not released, just introduced in #1904 and does not need a changelog update. ## Which issue(s) this PR fixes: none ## Special notes for your reviewer: ## Does this PR introduce a user-facing change? ``` no ```
What this PR does / why we need it:
This is a breaking change
This change considers untracked and uncommitted files in the change detection.
It means
terramate list --changed
will show stacks changed by uncommitted or untracked files in the index. Theterramate run
safeguards will continue to kick in but the user can disable thegit
safeguards and in this case commands can run in dirty stacks.Which issue(s) this PR fixes:
Closes #1398
Special notes for your reviewer:
Does this PR introduce a user-facing change?