You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nothing enforces the shared azure-tfstate-* concurrency group across the three state writers #195
LeanerCloud/cloud-commitments-cli#1803 serializes every writer of the Azure Terraform state blob on a shared concurrency group, azure-tfstate-<environment>. The group is a hand-written literal in three places:
Nothing enforces that they stay in sync. A new workflow that writes github-*.terraform.tfstate without the group, or a typo in the prefix in any one of the three, silently does not serialize. That is the same class of silent failure as the original bug in LeanerCloud/cloud-commitments-cli#1801: nothing is red, nothing is logged, and the damage is only visible later as missing state entries.
A CI check asserting that every job which writes a Terraform state key also carries a concurrency group derived from that key. Roughly:
Parse .github/workflows/*.yml.
For each job, find any key = "..." / backend-config construction or terraform apply|destroy against a known state.
Assert the job has a concurrency.group, and that the group's environment suffix is derived from the same expression as the state key.
Fail with the offending file:job when they disagree.
Even a narrow version limited to the Azure blob would catch the realistic regression, which is someone adding a fourth writer. Worth extending to AWS and GCP once LeanerCloud/cloud-commitments-cli#1806 lands, since the same shared-group convention will apply there.
Alternative worth weighing first: if the group could be derived rather than repeated, the drift becomes unrepresentable and no guard is needed. GitHub expressions cannot call a shared function, so this probably means a composite action or a generated workflow, which may cost more than the guard.
Activity