Skip to content
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

fix(smart-mode): Correct detection of changes in "_env/argocd" #111

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/myks/smart_mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (g *Globe) runSmartMode(changedFiles ChangedFiles) EnvAppMap {
// Env search path is the only submatch
"env": {
e("(" + g.EnvironmentBaseDir + ".*)/_env/" + g.YttStepDirName + "/.*"),
e("(" + g.EnvironmentBaseDir + ".*)/_env/" + g.ArgoCDDataDirName + "/.*"),
e("(" + g.EnvironmentBaseDir + ".*)/" + g.EnvironmentDataFileName),
},
// Prototype name is the only submatch
Expand Down
30 changes: 30 additions & 0 deletions internal/myks/smart_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,36 @@ func TestGlobe_runSmartMode(t *testing.T) {
"envs/env2": {"app3"},
},
},
{
"changes in _env",
ChangedFiles{
"envs/env1/_env/argocd/some-file.yaml": "M",
"envs/env2/_env/ytt/some-file.yaml": "M",
"envs/deletion/env1/_env/argocd/some-file.yaml": "D",
"envs/deletion/env2/_env/ytt/some-file.yaml": "D",
"envs/addition/env1/_env/argocd/some-file.yaml": "?",
"envs/addition/env2/_env/ytt/some-file.yaml": "?",
},
renderedEnvApps,
EnvAppMap{
"envs/env1": nil,
"envs/env2": nil,
"envs/deletion/env1": nil,
"envs/deletion/env2": nil,
"envs/addition/env1": nil,
"envs/addition/env2": nil,
},
},
{
"changes in root _env",
ChangedFiles{
"envs/_env/argocd/some-file.yaml": "?",
},
renderedEnvApps,
EnvAppMap{
"envs": nil,
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down