Skip to content

fix(ci): serialize staging-coder.ddev.com integration tests without cross-cancelling other runs - #188

Merged
rfay merged 3 commits into
mainfrom
20260727_ci_staging_concurrency
Jul 27, 2026
Merged

fix(ci): serialize staging-coder.ddev.com integration tests without cross-cancelling other runs#188
rfay merged 3 commits into
mainfrom
20260727_ci_staging_concurrency

Conversation

@rfay

@rfay rfay commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Serialize real-workspace provisioning across integration-test.yml, drupal-integration-test.yml, and drupal-contrib-integration-test.yml so concurrent runs no longer starve the single shared staging-coder.ddev.com box (flaky mid-build SSH drops, "workspace build already active" on cleanup).
  • Fix a regression from the first pass at this: a global cancel-in-progress: false group meant a push to a PR was queuing behind (and effectively delaying/interfering with) unrelated runs on main or other PRs, forcing manual restarts. Concurrency is now two-tiered: workflow-level stays ref-scoped with cancel-in-progress: true (a new commit only cancels that PR's own stale run), while a literal job-level group (staging-coder-integration, cancel-in-progress: false) on every job that actually provisions a real workspace serializes box usage globally without ever preempting someone else's in-flight build.
  • Job-level groups match within a run as well as across runs, so this also serializes drupal-plain-gh/drupal-issue-fork-gh and contrib-plain-gh/contrib-issue-fork-gh, which previously ran in parallel against the box within a single workflow run.
  • Add timeout-minutes: 30 to the box-provisioning jobs as a backstop, since a hung run under cancel-in-progress: false would otherwise block every future trigger indefinitely.

Test plan

  • YAML syntax validated (ruby -ryaml) and actionlint run over all three files -- no new findings introduced by this change
  • Push to main and open a PR simultaneously; confirm the PR run queues behind main's box-provisioning job instead of running concurrently or cancelling it
  • Push a second commit to an open PR; confirm the PR's own prior run is cancelled (not left queued/running)
  • Confirm drupal-plain-gh and drupal-issue-fork-gh (and the contrib equivalents) no longer provision workspaces on staging-coder.ddev.com at the same time

🤖 Generated with Claude Code

rfay and others added 2 commits July 27, 2026 09:45
…l triggers

integration-test.yml, drupal-integration-test.yml, and
drupal-contrib-integration-test.yml each provision real Coder workspaces
(nested Docker/Sysbox builds) on the single shared staging-coder.ddev.com
box, but their concurrency groups were scoped per-ref (github.ref /
github.head_ref). A push to main and any open PR -- or two different
PRs -- land in different groups, so GitHub Actions runs them at the same
time, and the box's finite CPU/RAM/Docker capacity gets starved. Observed
symptom: flaky mid-build "SSH connection ended unexpectedly" during ddev
start, followed by cleanup failing with "a workspace build is already
active" -- resource contention, not a real test failure.

Switch all three to one shared literal concurrency group so any run that
provisions real staging workspaces queues behind another, regardless of
which branch, PR, or push triggered it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…x via job-level concurrency

696eeac fixed cross-ref resource contention on staging-coder.ddev.com by
collapsing all three integration-test workflows into one literal
concurrency group with cancel-in-progress: false -- but that also
disabled the pre-existing behavior where a new commit on an open PR
cancels that PR's own stale run, and it let a PR push queue behind,
but never cancel, an in-progress run on main or another PR. It also
missed that drupal-plain-gh/drupal-issue-fork-gh and
contrib-plain-gh/contrib-issue-fork-gh run in parallel within a single
workflow run with no dependency between them, so they could still
starve the box even after that fix.

Split concurrency into two tiers instead:
- Workflow-level: ref-scoped, cancel-in-progress: true -- a new commit
  on a PR (or push to main) cancels only that ref's own stale run,
  never another ref's.
- Job-level, on every job that provisions a real workspace on
  staging-coder.ddev.com: literal shared group across all three
  workflows, cancel-in-progress: false -- serializes real box usage
  globally without ever preempting someone else's in-flight build.
  Job-level groups match within a run as well as across runs, so this
  also serializes the previously-unaddressed parallel GH-hosted job
  pairs against each other.

Also add timeout-minutes: 30 to those jobs -- with cancel-in-progress
false on a shared group, a hung run would otherwise block every future
trigger indefinitely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-27 20:04 UTC

The job-level concurrency group added in 54ff4f4 was the wrong tool: a
single PR push fires five box-provisioning jobs across the three
integration-test workflows at nearly the same instant, and GitHub
Actions concurrency groups only keep one job running plus one pending
-- every other simultaneous contender gets silently CANCELLED, not
queued. On PR #188 this dropped 3 of 5 templates outright (0 steps
run, no red flag beyond a generic "cancelled" status) while only the
first and the last-arriving job actually executed.

Drop the job-level concurrency: group entirely. Each box-touching job
now calls the new scripts/ci-wait-for-staging-box.sh right before
creating its workspace: it polls the Coder server's actual ci-bot
workspace count and waits its turn, so every job eventually runs
instead of some being dropped. Bump timeout-minutes to 75 on those
jobs to cover worst-case queued time (up to ~4 other jobs ahead, each
several minutes) plus the job's own runtime.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rfay
rfay merged commit 90130ec into main Jul 27, 2026
17 of 18 checks passed
@rfay
rfay deleted the 20260727_ci_staging_concurrency branch July 27, 2026 20:03
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.

1 participant