Post

Tune workflow concurrency for cancellable PR checks while preserving Terragrunt and Release queues

Tune workflow concurrency for cancellable PR checks while preserving Terragrunt and Release queues

The latest main push adds or normalizes concurrency groups across PR-triggered GitHub Actions workflows so that superseded pull request runs cancel in progress, while push, scheduled, and manually dispatched runs retain separate groups. It also adjusts the Terragrunt and Release jobs to use queue: max instead of broad workflow-level cancellation, updates the actionlint expectations, and extends the CI test suite to validate these boundaries.

Concurrency grouping with narrow cancellation scope

Workflows such as validate.yml, codeql.yml, cordium-runner-images.yml, argocd-image-updater.yml, and pr-delivery.yml now group runs by event type and PR number or run ID, with cancel-in-progress enabled only for pull request events. This lets GitHub supersede stale checks when a PR is updated, while preserving queued or running jobs for pushes, schedules, and manual dispatches. The actionlint configuration was extended to recognize the queue: max key on release.yml, terragrunt-apply.yml, and terragrunt-plan.yml, aligning lint expectations with the chosen concurrency model.

Terragrunt and Release queue semantics

Terragrunt Plan now uses cancel-in-progress: false plus queue: max to avoid interrupting OpenTofu while it holds an S3 backend lock, reducing the risk of stale locks. Terragrunt Apply and the Release publisher jobs similarly adopt queue: max instead of a single shared concurrency group with cancellation. The documentation clarifies that Terragrunt and Release are exempt from PR supersession, that apply and release previews remain independent, and that GitHub’s pending queue limit applies.

Automated tests reflect the new concurrency rules

The offline-static-checks.sh script was updated so that the Terragrunt Apply Request workflow no longer declares a top-level concurrency block, matching the decision to keep that path independent. The release-test.py suite now asserts that preview and main release workflows either omit concurrency or use non-cancelling queues, and that preview cancellation is not the same as the publisher’s group. This gives future contributors a clear regression gate when adjusting workflow concurrency.

This post is licensed under CC BY 4.0 by the author.