feat: add deployment-id input for per-attempt ArgoCD notification dedupe - #92
Merged
John C. Bland II (johncblandii) merged 1 commit intoAug 28, 2026
Conversation
…dupe ArgoCD's notification `oncePer` trigger dedupes on whichever field it is pointed at. Keying it on the application commit means a rollback -- replaying a commit ArgoCD has already notified for -- is silently suppressed, so the rollback reports no status at all. Add an optional `deployment-id` input whose value is written to the generated `config.yaml` as `deployment_id`, giving `oncePer` a field that is unique per deploy attempt rather than per code state. The value is stamped with `yq` and `strenv` rather than interpolated into the YAML literal, so IDs that would otherwise be type-coerced or break the document (`01234`, `true`, values containing `:`) round-trip correctly, and the input never reaches the shell command string. Left at its empty default the step is skipped entirely and the key is omitted, keeping `config.yaml` byte-identical for existing callers. This matters because the action only commits to the GitOps repo when the rendered output actually changes -- always emitting the key would push a config-only commit, and an ArgoCD sync, for every app on upgrade. Covered by the helm raw tests in both directions: the value round-trips through the committed `config.yaml` when passed, and the key is absent when it is not.
Erik Osterman (Cloud Posse) (osterman)
approved these changes
Aug 28, 2026
John C. Bland II (johncblandii)
deleted the
feat/replicate-argocd-deploy-action
branch
August 28, 2026 20:39
|
These changes were released in v1.11.0. |
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
deployment-idinput, stamped into the generatedconfig.yamlasdeployment_idalongsideapp_commit.README.yaml/README.md.why
oncePertrigger dedupes on whichever field it is pointed at. Keying it on the application commit has a gap: rollback. Replaying a previously-deployed commit reuses anapp_commitvalue 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.${{ github.run_id }}-${{ github.run_attempt }}, which is unique across both re-runs and retries.implementation notes
yq+strenvrather than interpolated into the YAML literal. IDs that would otherwise be type-coerced or break the document round-trip correctly (01234stays a string,truestays a string, values containing:or#are quoted), and the input never reaches the shell command string.yqis already installed by the action's first step, so this adds no dependency.deployment-idis optional with an empty default. Left unset, the step is skipped entirely and thedeployment_idkey is omitted, soconfig.yamloutput is byte-identical for existing callers.git diff-indexsees 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— passesdeployment-idand asserts the value round-trips through the committedconfig.yaml.test-helm-raw-default-kube-version.yml— assertshas("deployment_id")isfalsewhen the input is omitted, locking in the backward-compat guarantee above.config.yamlmatching whatcreate-a-file-actionproduces, and that numeric-, boolean-, and colon-containing IDs read back correctly.workflow_dispatch-only againstcloudposse-tests/argocd-deploy-non-prod-test, so they need a manual dispatch to exercise.references
README.mdgains a "Deduping ArgoCD notifications per deploy attempt" section covering the rollback gap, the recommended value, and the resultingconfig.yaml. Regenerated fromREADME.yamlwithatmos readme.