fix(argo): clear stale child overrides + flip --commit to opt-in#243
Merged
Conversation
push_value only unset the exact key it just wrote, so a parameter override on a child key survived. Concrete failure: Monitor (or `ec stop --no-commit`) sets `services.X.enabled=false`, then `ec deploy X v2` writes `services.X` to values.yaml but the `services.X.enabled=false` override remains and the redeployed service stays stopped. Lift the child-walk pattern from push_remove_key into a shared helper and call it from both functions.
Flip --commit from on-by-default to opt-in. The default behaviour now matches `ec stop --no-commit` (transient `argocd app set` on the parent app's helm.parameters), which is the same mechanism argocd-monitor's Stop/Start button will use. Pass --commit when you want the change written to the deployment repo for an audit trail. Also aligns ArgoCommands.start/stop kwarg defaults with the abstract base, k8s, and demo backends, which were already commit=False.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #242. Pairs with epics-containers/argocd-monitor#43 (Monitor's Stop/Start UI).
Summary
push_valuenow also unsets parameter overrides on child keys (e.g.services.X.enabled) — previously, an override set byec stop --no-commit(or by Monitor) would survive a subsequentec deploy X v2and the redeployed service would stay stopped. Lifts the existing child-walk loop frompush_remove_keyinto a shared helper.ec start/ec stopnow default to the transient parameter-override path (same as--no-commitdid before). Pass--committo also write to the deployment repo for an audit trail. This mirrors what Monitor will do, so all Stop/Start traffic — CLI and UI — converges on one mechanism.services.X.enabled→global.enabled→replicaschain inargocd-appsandioc-instancealready does the right thing.Test plan
uv run pytest— 35/35 passtest_deploy_clears_enabled_overridereproduces the bug case (lingeringservices.X.enabled=falseparameter override → deploy unsets it before refresh)ec stop <svc> --no-commit, thenec deploy <svc> <ver>, confirm the service starts (was previously stuck stopped)ec start <svc>(no flag) issuesargocd app setonly (no git push);ec start <svc> --commitwrites to git