Skip to content

Add concurrency groups to repo-based deploy/delete workflows - #12850

Open
pujitha24 wants to merge 5 commits into
radius-project:mainfrom
pujitha24:auto/issue-12848
Open

Add concurrency groups to repo-based deploy/delete workflows#12850
pujitha24 wants to merge 5 commits into
radius-project:mainfrom
pujitha24:auto/issue-12848

Conversation

@pujitha24

Copy link
Copy Markdown
Contributor

Summary

Add a concurrency: group to the four repo-based deploy/delete reusable
workflow templates (run-rad-commands-aws.yml, run-rad-commands-azure.yml,
delete-aws.yml, delete-azure.yml) so runs against the same GitHub
Environment are serialized instead of racing on the shared state archive.

Reason for change

These four workflows each restore Radius control-plane state with
rad startup and persist it again with rad shutdown, against a single
durable state archive per environment (an OCI package or the radius-state
git orphan branch). None of them declared a concurrency: group, so two
overlapping runs targeting the same environment — e.g. two deploys, or a
deploy and a delete — could race on that archive: one run's rad shutdown
overwriting state another run just restored, or two runs pushing conflicting
snapshots and corrupting it.

The added group key intentionally omits github.workflow so that a deploy
and a delete against the same environment also serialize against each other,
since both touch the same archive; keying only by the workflow name would
still leave that pair racing. cancel-in-progress is left false so a
queued run waits its turn instead of a newer run cancelling one that is
already mid-flight, which would abandon it before rad shutdown can persist
its state.

Fixes #

How to test

These are reusable-workflow (workflow_call) YAML templates that Radius
copies into a user's repository; they have no Go unit-test target. Validated
statically:

  • actionlint .github/extension/{run-rad-commands-aws,run-rad-commands-azure,delete-aws,delete-azure}.yml
    — no new findings. The one pre-existing shellcheck SC1090 warning in the
    two run-rad-commands-* files is unrelated to this change and reproduces
    identically on main (confirmed via git stash).
  • python3 -c "import yaml; yaml.safe_load(open(f).read())" for all four
    files — parses cleanly, including the new concurrency block.
  • Confirmed placement matches this repo's own convention for reusable and
    top-level workflows (concurrency: immediately after permissions: and
    before env:/jobs:, as in build.yaml / unit-tests.yaml /
    functional-test-cloud.yaml).

Not run: an actual overlapping-run reproduction against a live GitHub
Actions runner and real state archive, which isn't reproducible locally.
GitHub Actions' documented behavior is that a concurrency: group declared
inside a reusable workflow_call workflow is honored for that workflow's
own job(s), and in this repo's case these four files are copied verbatim
into the user's .github/workflows/ and invoked via a local uses: ./...
path (per .github/extension/README.md), which is the simplest, well
supported form of this feature.

File change summary

File Summary of change
.github/extension/run-rad-commands-aws.yml Added concurrency: group keyed by environment, cancel-in-progress: false.
.github/extension/run-rad-commands-azure.yml Added concurrency: group keyed by environment, cancel-in-progress: false.
.github/extension/delete-aws.yml Added concurrency: group keyed by environment, cancel-in-progress: false.
.github/extension/delete-azure.yml Added concurrency: group keyed by environment, cancel-in-progress: false.

Fixes #12848

Motivation: The four repo-based deploy/delete reusable workflow templates
(run-rad-commands-aws.yml, run-rad-commands-azure.yml, delete-aws.yml,
delete-azure.yml) each restore Radius control-plane state with
`rad startup` and persist it again with `rad shutdown`, against a single
durable state archive per environment (an OCI package, or the
radius-state git orphan branch). None of them declared a `concurrency:`
group, so two overlapping runs targeting the same environment could race
on that shared archive: one run's `rad shutdown` could overwrite state
another run just restored, or two runs could push conflicting snapshots
and corrupt it.

Approach: Add a `concurrency:` block to each of the four workflow files,
keyed by `radius-state-archive-${{ inputs.environment }}`. The key
deliberately omits `github.workflow` so a deploy and a delete against the
same environment also serialize against each other, since both share the
same archive; keying only by workflow name would still leave that pair
racing. `cancel-in-progress` is left false so a queued run waits its turn
instead of a newer run cancelling one that is already mid-flight, which
would abandon it before `rad shutdown` can persist its state.

Report: radius-project#12848
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Assisted-by: claude-sonnet-5 (via Claude Code)
@pujitha24
pujitha24 requested a review from a team as a code owner August 27, 2026 14:51
Copilot AI lite review requested due to automatic review settings August 27, 2026 14:51
@pujitha24
pujitha24 requested a review from a team as a code owner August 27, 2026 14:51
@pujitha24
pujitha24 had a problem deploying to external-contributor-approval August 27, 2026 14:51 — with GitHub Actions Error

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a workflow-level concurrency group to the four repo-based reusable deploy/delete workflow templates so runs targeting the same GitHub Environment are serialized, preventing races while restoring/persisting the shared Radius state archive (rad startup / rad shutdown).

Changes:

  • Add concurrency.group: radius-state-archive-${{ inputs.environment }} to serialize deploy/delete runs per Environment.
  • Set cancel-in-progress: false so queued runs wait rather than canceling an in-flight run (avoids skipping rad shutdown persistence).
  • Apply the same concurrency policy consistently across AWS/Azure deploy and delete templates.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/extension/run-rad-commands-aws.yml Adds environment-keyed concurrency to serialize state-archive access for AWS deploy runs.
.github/extension/run-rad-commands-azure.yml Adds environment-keyed concurrency to serialize state-archive access for Azure deploy runs.
.github/extension/delete-aws.yml Adds environment-keyed concurrency to serialize state-archive access for AWS delete runs.
.github/extension/delete-azure.yml Adds environment-keyed concurrency to serialize state-archive access for Azure delete runs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pujitha24
pujitha24 had a problem deploying to external-contributor-approval August 27, 2026 19:32 — with GitHub Actions Error
@pujitha24
pujitha24 had a problem deploying to external-contributor-approval August 28, 2026 10:15 — with GitHub Actions Error
@pujitha24
pujitha24 had a problem deploying to external-contributor-approval August 29, 2026 09:08 — with GitHub Actions Error
@willdavsmith
willdavsmith requested a review from sk593 August 31, 2026 18:21
@pujitha24
pujitha24 requested a deployment to external-contributor-approval August 31, 2026 20:28 — with GitHub Actions Waiting
@pujitha24

Copy link
Copy Markdown
Contributor Author

While checking on this I noticed #12719 merged into main and removed .github/extension/ from this repo entirely — those four workflow templates now live solely in radius-project/ai-extensions (radius-project/ai-extensions#424). That's why this is showing as conflicting: the files this PR modifies don't exist on main anymore. The concurrency gap from #12848 is still real over there (I checked ai-extensions' copy of run-rad-commands-aws.yml and it has no concurrency: block either), but porting this fix belongs in that repo, not here. I haven't touched anything in this PR — didn't want to guess at closing it without checking with you first. Want me to close this in favor of opening the equivalent fix in ai-extensions, or is there a reason to keep it open here?

@sk593

sk593 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Hi @pujitha24, thanks for the contribution. We have changed our workflow setup so this PR will require some updates. I will respond here again once we have more info on how to update the PR. Thank you for your patience!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add concurrency: group to repo-based deploy/delete workflows to serialize shared state-archive access

3 participants