Skip to content

Scope the pre-Rspec wait barrier to Rspec's actual dependencies #patch - #32

Draft
wesrich wants to merge 1 commit into
mainfrom
scope-rspec-wait-barrier
Draft

Scope the pre-Rspec wait barrier to Rspec's actual dependencies #patch#32
wesrich wants to merge 1 commit into
mainfrom
scope-rspec-wait-barrier

Conversation

@wesrich

@wesrich wesrich commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Why

The wait-all: true immediately before Run Rspec Tests in rails-ci.yml blocks on every background step launched so far in the job — including Rubocop, ESLint, Brakeman, Dependency Audit, and Project Stats. None of those publish anything Rspec reads: they report their own check results independently later in the job (Brakeman via reviewdog, Rubocop via GitHub-format output, Project Stats via a later Publish Project Stats Check step).

Measured across two real bgea_volunteer_care CI runs, every dependency Rspec actually needs (gems/Ruby, apt packages, yarn/node_modules, compiled assets, the Playwright browser, parallel test DBs) was ready well before the old barrier released, but Brakeman (and once, Rubocop's slim_lint step) was consistently the last background step to finish — and Rspec started within ~2ms of it finishing every time. That's ~11s of pure idle time on a 32vcpu run and ~22s on an 8vcpu run, wasted purely on steps Rspec doesn't need. This compounds across every CI run of every app using this shared workflow.

What Changed

  • Added id:s to Compile Assets, Install Playwright Chromium Browser, and Setup Parallel Databases so they can be referenced explicitly
  • Replaced the wait-all: true before Run Rspec Tests with a wait: scoped to just Rspec's real dependencies: install-ruby, install-apt, install-yarn, compile-assets, install-playwright, setup-parallel-databases
  • Rubocop/ESLint/Brakeman/Dependency Audit/Project Stats now run concurrently with Rspec instead of gating it
  • Replaced the later wait: [save-asset-cache] (right after Run Rspec Tests) with wait-all: true, so those background lint/security/stats steps are still joined before the job's final parallel block — preserving the guarantee that a lint/security failure fails the job and that steps.project-stats.outputs.table is populated before it's published

Test plan

  • Merge and tag a new v3.x.y release
  • Confirm a consuming app's CI run (e.g. bgea_volunteer_care) still fails correctly when Rubocop/Brakeman/Dependency Audit is broken
  • Confirm Run Rspec Tests now starts as soon as its real dependencies are ready, not gated on Brakeman/Rubocop

Screenshots

N/A — no UI changes

`Run Rspec Tests` only needs gems/Ruby, apt packages, yarn/node_modules,
compiled assets, the Playwright browser, and the parallel test DBs. The
`wait-all: true` immediately before it also blocked on Rubocop, ESLint,
Brakeman, Dependency Audit, and Project Stats, even though none of those
publish anything Rspec reads — they report their own check results
independently later in the job.

Measured across two real bgea_volunteer_care CI runs, every Rspec
dependency was ready well before the old barrier released, but Brakeman
(and once, Rubocop's slim_lint step) was consistently the last background
step to finish, and Rspec started within ~2ms of it finishing every time.
That's ~11s of pure idle time on a 32vcpu run and ~22s on an 8vcpu run,
wasted on every CI run of every app using this workflow.

Replaced the barrier with a `wait:` scoped to Rspec's real dependencies
(adding `id:`s to Compile Assets, Install Playwright Chromium Browser, and
Setup Parallel Databases so they can be referenced). Rubocop/ESLint/
Brakeman/Dependency Audit/Project Stats keep running in the background
concurrently with Rspec instead of gating it. To preserve correctness,
replaced the later `wait: [save-asset-cache]` with `wait-all: true` so
those steps are still joined before the job's final parallel block —
otherwise a lint/security failure could go unnoticed and
steps.project-stats.outputs.table could be read before it's populated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wesrich wesrich self-assigned this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant