Skip to content

v1.11.0

Latest

Choose a tag to compare

@cloudposse-releaser cloudposse-releaser released this 28 Aug 20:42
feat: add deployment-id input for per-attempt ArgoCD notification dedupe John C. Bland II (@johncblandii) (#92) ## what
  • Adds an optional deployment-id input, stamped into the generated config.yaml as deployment_id alongside app_commit.
  • No changes to outputs, the destination-path logic, or any other step.
  • Adds test coverage in both directions, and documents the input in README.yaml / README.md.

why

  • ArgoCD's notification oncePer trigger dedupes on whichever field it is pointed at. Keying it on the application commit has a gap: rollback. Replaying a previously-deployed commit reuses an app_commit value ArgoCD already marked as 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 rather than per code state closes that gap. This PR adds the field needed to produce that value; it does not change dedupe behavior on its own.
  • The recommended value is ${{ github.run_id }}-${{ github.run_attempt }}, which is unique across both re-runs and retries.

implementation notes

  • The value is stamped with yq + strenv rather than interpolated into the YAML literal. IDs that would otherwise be type-coerced or break the document round-trip correctly (01234 stays a string, true stays a string, values containing : or # are quoted), and the input never reaches the shell command string. yq is already installed by the action's first step, so this adds no dependency.
  • Backward compatible. deployment-id is optional with an empty default. Left unset, the step is skipped entirely and the deployment_id key is omitted, so config.yaml output is byte-identical for existing callers.
  • That last point is deliberate rather than cosmetic: the action only commits to the GitOps repo when git diff-index sees a change. Unconditionally emitting the key — even empty — would push a config-only commit, and an ArgoCD sync, for every application on the first deploy after upgrading.

testing

  • test-helm-raw.yml — passes deployment-id and asserts the value round-trips through the committed config.yaml.
  • test-helm-raw-default-kube-version.yml — asserts has("deployment_id") is false when the input is omitted, locking in the backward-compat guarantee above.
  • Verified locally that the render + stamp sequence is additive-only against a config.yaml matching what create-a-file-action produces, and that numeric-, boolean-, and colon-containing IDs read back correctly.
  • The integration workflows are workflow_dispatch-only against cloudposse-tests/argocd-deploy-non-prod-test, so they need a manual dispatch to exercise.

references

  • README.md gains a "Deduping ArgoCD notifications per deploy attempt" section covering the rollback gap, the recommended value, and the resulting config.yaml. Regenerated from README.yaml with atmos readme.