feat(argocd-wait-sync-multi): emit previousRevision per app - #333
Closed
JesperTerkelsen wants to merge 1 commit into
Closed
feat(argocd-wait-sync-multi): emit previousRevision per app#333JesperTerkelsen wants to merge 1 commit into
JesperTerkelsen wants to merge 1 commit into
Conversation
Adds a previousRevision field to each entry of the deployments output, sourced from the app's .status.history — the most recent history revision that differs from the one just verified (honoring source-repo indexing for multi-source apps). This gives downstream changelogs the revert target for each deployed system. Empty on a first-ever deploy.
Member
Author
|
Closing: superseded by a different source for the previous version. We're reading the previous image tag straight from monorepo-typescript-manifests at bump time (consistent with how the single-service deploy already does it via component-deploy.yml), rather than from ArgoCD sync history. The manifests read yields the app image tag (the version humans read + a real code compare link), whereas .status.history gives the manifests commit SHA. Keeping argocd-wait-sync-multi a pure rollout-verifier (timing/status/url); the version identity is joined in downstream. |
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.
What
Adds a
previousRevisionfield to each entry of thedeploymentsoutput, so downstream changelogs can show a per-system revert target ("what was live before this deploy") — the thing you reach for during an incident.Output schema is now:
[{ "name", "app", "revision", "previousRevision", "start", "end", "status", "url" }]How
previousRevisionis extracted from the app's own.status.history— the most recent history revision that differs from the revision we just verified (a "last distinct" filter, so a same-SHA re-sync doesn't report itself as its own previous). It honours the samesource-reposource-index selection asrevision, since multi-source history entries mirror.status.sync.revisions[]ordering.Why this shape
Sourced from ArgoCD sync history rather than a git diff so it reflects what ArgoCD actually had synced before, not what a manifests PR intended — that's the accurate revert target.
Verified
bash test/run-tests.sh— green (5/5). Test A now asserts the multi-source app with history reportspreviousRevision= the priorrevisions[0], and the app with no history reportspreviousRevision: "".Follow-up
Consumed by changelog-cli (
DeployedSystem.previousRevision→ a grey "Containers (N)" card renderingprevious → newwith a compare link per system).