Skip to content

feat(DO-7930): stamp deployment_id into config.yaml for per-attempt notification dedupe - #2

Closed
gokul-das-ext wants to merge 1 commit into
mainfrom
do-7930-deployment-id
Closed

feat(DO-7930): stamp deployment_id into config.yaml for per-attempt notification dedupe#2
gokul-das-ext wants to merge 1 commit into
mainfrom
do-7930-deployment-id

Conversation

@gokul-das-ext

Copy link
Copy Markdown

Summary

  • Adds a deployment-id input, defaulted to empty, stamped into config.yaml alongside app_commit
  • No changes to outputs, other steps, or the destination-path logic

Why

ArgoCD's notification oncePer dedupe key is moving from app.status.sync.revision to app.metadata.annotations.app_commit in a related change, to stop unrelated GitOps-repo commits from re-arming notifications for idle apps.

That fix has one gap: rollback. Replaying a previously-deployed commit reuses an app_commit value ArgoCD already marked notified, so the rollback's own success/failure is silently suppressed — no GitHub status at all, not even a wrong one.

Keying the dedupe on something unique per deploy attempt instead of per code state closes that gap. This PR adds the field this action needs to produce that value; it doesn't change dedupe behavior on its own.

Backward compatibility

deployment-id is optional with an empty default — existing callers are unaffected until they pass it explicitly.

Part of a 3-repo change

  1. This PR — adds the deployment-id input/field
  2. DriveWealth/dw-github-workflows — passes deployment-id: ${{ github.run_id }}-${{ github.run_attempt }} through, pinned to this PR's merge SHA
  3. DriveWealth/dwt-infra — flips ArgoCD's oncePer to read deployment_id (held in draft until 1 and 2 are merged and verified live — see that PR for why)

…otification dedupe

ArgoCD's notification oncePer key is moving from app.status.sync.revision
to app.metadata.annotations.app_commit to stop unrelated GitOps-repo
commits from re-arming notifications for idle apps. That fix breaks
rollback: replaying a previously-deployed commit reuses an app_commit
value that was already notified, silently suppressing the rollback's
own status.

Adding a deployment-id input, stamped into config.yaml alongside
app_commit, gives the dedupe key a value that's unique per deploy
attempt instead of per code state - covering rollback and same-SHA
CI re-runs without reintroducing the original over-posting bug.

Backward compatible: new input is optional with an empty default,
existing callers are unaffected until they pass it explicitly.
@gokul-das-ext

Copy link
Copy Markdown
Author

Third PR now open: DriveWealth/dwt-infra#2702 (draft, blocked on this and dw-github-workflows#308).

@gokul-das-ext

Copy link
Copy Markdown
Author

Superseded by #3 — syncing with cloudposse's upstream deployment-id implementation (cloudposse/github-action-deploy-argocd#92, released v1.11.0) instead of carrying our own hand-rolled patch. Their version is better engineered: yq+strenv stamping (avoids YAML type-coercion issues), and conditional on non-empty input (avoids a spurious config-only commit + ArgoCD sync for every app on first deploy after upgrading, which our version would have caused).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant