Build, test, and release automation
The repository uses one automation system to build its JavaScript packages, exercise the Ruby gem and generated apps, check code quality, and publish matching package and gem versions. Local Rake tasks and repository scripts provide the main paths that GitHub Actions uses. Release tasks add checks that protect tags, registries, release branches, and the process that performs live publication.
This page is part of the developer toolchain. For app creation, see application scaffolding. For runtime performance checks, see performance benchmarks.
Workspace package orchestration
The workspace is a private pnpm workspace that joins the public JavaScript packages with the dummy apps used for validation. Its main goal is to build and check related packages together so that a change in the core package is tested against Pro packages and generated app flows.
The four published JavaScript packages are built in a fixed order from the root package.json: core React on Rails, Pro, the Pro Node renderer, and the app creation CLI. Recursive pnpm commands then run package tasks where the package defines them. The workspace lockfile and the exact pnpm version in packageManager keep local and release dependency state aligned. pnpm also limits lifecycle builds to an explicit set of trusted dependencies, so a new native or compiled dependency needs an intentional workspace change.
The main root commands form these broad paths:
| Command | Purpose |
|---|---|
pnpm build | Produce the JavaScript package output for tests and publication. |
pnpm test | Run tests for the packages under packages/. |
pnpm check | Run lint, custom rule checks, and each workspace package's check task. |
pnpm type-check | Check TypeScript without producing package output. |
pnpm size | Build packages and compare tracked bundle sizes. |
pnpm publish | Delegate publication to each workspace package. The release Rake task is the controlled path for a complete release. |
The build output is also usable as a separate distribution. scripts/publish-to-builds-repo.sh builds the packages, copies their package metadata and compiled lib output to the builds repository, removes development-only package settings, and can push a branch and version tag. Its dry-run mode prepares the distribution without pushing it.
The package flow is therefore a shared input to both validation and release:
flowchart LR
Source[Package source] --> Install[Locked workspace install]
Install --> Build[Build core, Pro, renderer, and CLI]
Build --> Tests[Package and app tests]
Build --> Dist[Publishable package output]
Dist --> Registry[npm or builds repository]
References: package.json• L7-16 package.json• L86-106 package.json• L126-192 packages/…/package.json• L7-15 packages/…/package.json• L7-19 packages/…/package.json• L135-143 packages/…/package.json• L9-20 scripts/publish-to-builds-repo.sh• L1-24
Ruby task and generator workflows
Ruby automation prepares the gem, dummy apps, and generated examples that show whether the public Rails integration still works. The package Rakefile keeps the high-level lifecycle small: the default path runs lint and tests, prepare_for_ci prepares the Node package and dummy apps, and ci combines preparation with the test and lint paths.
The root Rakefile provides compatibility wrappers for common package tasks. A root task enters the react_on_rails package bundle before it runs the package-owned task. This keeps root tooling dependencies separate from the gem's dependencies while still giving engineers one familiar command surface. Root lint is intentionally limited to root-tooling RuboCop. The full package lint path remains owned by the package bundle.
Generator automation creates example Rails apps for several React and Shakapacker combinations. It installs the local React on Rails package, aligns the Shakapacker npm and gem versions, applies the requested React version, creates packs, and builds assets before tests run. This makes generator tests validate a complete app shape instead of only checking generated text.
The main Ruby task groups are:
| Task group | System goal |
|---|---|
lint:* | Check Ruby, JavaScript, and stylesheet quality. |
run_rspec:* | Run gem, dummy app, and generated example tests with the needed environment. |
shakapacker_examples:* | Remove, create, and prepare generated example apps. |
dummy_apps:* | Install dependencies and generate packs for the shared dummy app. |
rbs:* | Validate Ruby type signatures and related checks. |
update_changelog | Create release headers and comparison links from release versions. |
Generated example apps use their own Ruby bundle when they run tests. This keeps each example's dependency choice separate from the monorepo bundle and lets the matrix cover older supported combinations.
References: react_on_rails/Rakefile• L3-19 Rakefile• L24-94 Rakefile• L96-180 react_on_rails/…/lint.rake• L5-47 react_on_rails/…/run_rspec.rake• L20-35 react_on_rails/…/run_rspec.rake• L53-94 react_on_rails/…/shakapacker_examples.rake• L157-238 react_on_rails/…/dummy_apps.rake• L8-30 react_on_rails/…/update_changelog.rake• L491-568
Repository script coordination
Repository scripts decide which checks are useful for a change and protect boundaries that GitHub Actions cannot infer from a single workflow. The central change detector compares the current revision with a merge base, classifies changed paths, and emits flags for lint, Ruby tests, JavaScript tests, dummy apps, generators, Pro paths, end-to-end tests, and benchmarks.
The detector is conservative in two ways. Documentation-only changes can avoid runtime suites. Unknown changes request the full test set. CI plumbing also requests the full test set but does not request benchmarks because a workflow change cannot change product speed. Suite-specific workflow files can select the suite they describe without turning on unrelated benchmarks.
The detector also knows that release tooling has its own coverage. Changes to the release Rake task or its forward-port helpers select release-related Ruby tests, lint, and the release-supervisor harness without forcing generator or JavaScript suites. This gives release controls focused coverage while still failing closed when their classification cannot be trusted. Its Bash harness covers path categories, selector combinations, comment rules, and the separation between test selection and benchmark selection.
Hosted workflows use script/ci-required-diff-base as the verified entry point for change selection. It receives the pull request base and head identity from the event or a manual rerun. An explicit force-full request bypasses path selection, but hosted readiness alone does not widen the selected suites.
The shared diff-base helper makes this decision safe in shallow checkouts. It validates branch inputs, fetches missing branch history, deepens shallow history with bounded retries, and uses a timed unshallow fallback. Hosted CI uses the strict policy so a failed base fetch stops the decision rather than skipping all suites. The documentation sidebar check uses the lenient policy only for its initial fetch, then still fails when it cannot resolve a real merge base.
The documentation sidebar check applies the same merge-base rules to newly added published documents. It confirms that each new docs/oss or docs/pro page has a sidebar entry or an explicit exclusion, and it ignores comments and partial matches when it reads the sidebar.
The local and hosted decision flow is:
flowchart TD
Change[Changed revision] --> Base[Resolve a trusted merge base]
Base --> Classify[Classify changed paths]
Classify --> Docs{Documentation only?}
Docs -->|Yes| Light[Focused documentation or no runtime suite]
Docs -->|No| Flags[Emit suite flags]
Flags --> Known{Known category?}
Known -->|Yes| Selected[Run the required related suites]
Known -->|No| Full[Run the full test set]
Other scripts support this policy. They validate workflow inputs, check generated precompile output, check package and React resolution, enforce Pro license headers, and verify that release branches can be reconciled with main. These scripts are part of the contracts used by the workflows and should be treated as CI interfaces rather than ad hoc helpers.
References: script/ci-changes-detector• L27-61 script/ci-changes-detector• L97-119 script/ci-changes-detector• L450-487 script/ci-changes-detector• L717-759 script/ci-changes-detector• L963-1005 script/check-docs-sidebar• L1-12 script/check-docs-sidebar• L37-65 script/check-docs-sidebar• L86-148 script/…/git-diff-base• L30-35 script/…/git-diff-base• L344-385 script/…/git-diff-base• L456-565 script/ci-changes-detector-test.bash• L936-1018 script/…/git-diff-base-test.bash• L592-665
GitHub Actions CI suites
GitHub Actions runs on pull requests, pushes to main and release/**, merge queue entries, and selected manual dispatches. Each hosted suite first selects its hosted-CI mode and resolves a trusted diff base. It then runs only the change-related jobs unless a full run is required by the event or explicitly requested.
The main suites form several layers:
| Suite | Product risk covered |
|---|---|
| Required gate | Pinned workflow-copy integrity, workflow and script validity, change classification, required hosted-CI policy, repository seam checks, and merge-queue package coverage. |
| JavaScript package tests | Core, Pro, and app-creation package tests after a workspace build. The matrix checks the latest Node lane and adds the minimum lane in broad contexts. |
| Ruby gem tests | Gem RSpec coverage with latest or minimum Ruby and dependency levels. Generator specs use setup-safe shards when selected, and release changes can run a focused release-supervisor harness. |
| Integration tests | Dummy Rails apps across Webpack and Rspack. Each bundler and dependency level owns an independent build-to-integration path. |
| Generator tests | Generated Rails examples across current and pinned React versions. Full matrix contexts add the minimum Ruby lane while example jobs use the minimum supported Node floor for Shakapacker compatibility. |
| Precompile check | Production-style asset compilation and output validation for the dummy app. |
| Pro package and integration tests | Pro Ruby and JavaScript tests, licensed dummy apps, Node renderer behavior, Redis-backed flows, Playwright coverage, RSC coverage, and additive Rspack validation for the ExecJS-compatible dummy. |
| End-to-end tests | A standalone minimum-runtime Playwright path for the OSS dummy app. |
| Bundle size | Base-versus-PR bundle measurement with dynamic limits. |
| Rails DX benchmark replay | Frozen dependency, starter type, and benchmark artifact checks for the isolated Rails-tier Rspack and Vite benchmark package. |
| Node renderer fresh-install engines | A scheduled and dependency-triggered check that tests whether newly resolved renderer dependencies still support the renderer's lowest advertised Node version. |
| Claude review and command workflows | Automated pull request review and maintainer-requested repository assistance. Both paths authorize the actor and protect the review result from silent success. |
The required gate is the policy boundary for pull requests. It starts for pull request open, synchronize, reopen, and ready-for-review events, merge-queue entries, and controlled manual rechecks. Label events do not start this gate. It validates pinned external workflow sources, repository seam rules, workflow YAML, and CI scripts before it uses the change detector. It also runs the CI contract tests, checks mirrored workflow blocks, and checks merge-queue package coverage. Its concurrency group includes the pull request head, so a rerun for one head cannot cancel the newest head's gate.
When a hosted-CI control label changes, the label-dispatch workflow finds the current pull-request gate run and reruns it so the gate reads the new label state. This keeps status labels from retriggering or blocking the gate. The gate supports a controlled manual recheck after hosted-label cleanup. That path carries the pull request base reference and base commit, and it marks hosted CI as not requested for the recheck. The safety suite treats this input and the related fail-closed behavior as a workflow contract, so a manual cleanup run cannot silently reuse stale hosted-CI evidence. It also checks that each hosted workflow uses the shared selector and verified diff-base helper with the event's base and head identities instead of running a separate changed-file detector.
Hosted CI can be optimized for normal pull requests. A trusted collaborator can request it with a PR comment such as +ci-run-hosted; +ci-force-full bypasses path selection. Labels retain the chosen mode for later commits. Coverage is bound to the exact PR head, base, and workflow run IDs. The command workflow serializes older command runs, saves an in-progress marker before dispatch, validates the exact run returned by GitHub, and records durable UNKNOWN state when it cannot prove the result. If GitHub does not provide enough proof, later commands stop instead of guessing. Release-target and Dependabot requests receive full-matrix treatment only when the trusted dispatch proof is present.
The command workflow also owns the label lifecycle. It accepts stop, skip, status, and help commands from collaborators with write access. It adds hosted-CI labels only after all requested dispatches succeed and after it checks for newer stop or skip commands. It saves the final coverage proof before it reruns the required gate. A failed or uncertain dispatch removes or withholds the control labels so the required gate remains the safe fallback.
The hosted-label workflow handles changes to ready-for-hosted-ci and force-full-hosted-ci. It ignores ordinary status labels, bot-created label events, fork pull requests, untrusted actors, and Dependabot label requests. It dispatches the hosted suite set for accepted control-label changes, removes labels after a dispatch failure, and reruns the matching pull-request gate after label state changes. Removing one control label does not rerun the gate while the other control label remains.
The lint workflow also has a focused documentation path. Documentation-only pull requests run a format check, while documentation-only pushes to main and matching merge-queue events pass through a safety check for the previous revision. A forced hosted-CI request bypasses optimized selection and enables the main lint, JavaScript, Ruby, dummy-app, and generator suites. Its full quality job also checks Ruby and JavaScript style, RBS signatures, dead code, TypeScript, SCSS, package type and publish shape, and packed source-map links. It uses a private pnpm install state from the root manifest and lockfile.
The standalone Playwright workflow always considers pushes to main and release/**, but its change detector can skip the heavy browser job for irrelevant changes. It excludes branch-deletion pushes because those refs are not checkoutable. Its manual dispatch accepts the same base identity inputs used by the other hosted suites, and force-full mode bypasses optimized selection. The browser job runs one OSS end-to-end lane on the minimum Ruby and Node floors, uses a pinned Ubuntu 24.04 runner for browser compatibility, builds the workspace and dummy-app assets, runs the browser tests, and stores the report even after failure.
The fresh-install renderer check covers a dependency state that the locked workspace cannot show. On the newest Node release, it resolves the renderer's runtime dependencies from the npm registry as a new install would, then compares every resolved engines.node range with the renderer's lowest advertised Node version. It runs weekly and when renderer dependency or checker files change. The workflow is advisory rather than required, and a scheduled failure opens or updates one issue so registry drift reaches maintainers without blocking unrelated changes.
The test suites keep expensive setup tied to the checks that use it. Ruby generator examples split into three deterministic setup-safe shards that keep context-level setup together and balance shared setup cost. Integration tests split Webpack latest and minimum lanes into separate chains so one build failure does not hide another chain. The JavaScript package workflow runs the latest Node lane on pull requests and adds the minimum Node lane for broad matrix contexts. Pro package checks cover current and minimum Ruby lanes, while the Pro integration workflow uses minimum Ruby with the current Node lane for licensed dummy apps. Pro Rspack coverage includes both the RSC runtime path and an additive ExecJS-compatible dummy build; the latter verifies the reported Rspack build and emitted manifest so a silent fallback to Webpack does not pass.
Renderer-backed jobs use a shared HTTP/2 readiness check before tests begin and always preserve the renderer log. The benchmark workflow keeps hosted benchmark runs manual-only while its pull-request path checks benchmark scripts and replays the isolated Rails DX benchmark package with pinned dependencies and starter type checks. Dedicated local hardware remains the source for the trusted Bencher trend because shared hosted runners are too noisy for automatic regression claims.
The hosted-CI safety test replays key workflow expressions and checks cross-workflow contracts. It covers suite concurrency, benchmark trigger rules, matrix shape, generator and release-supervisor selection, renderer readiness, benchmark replay, trusted dispatch, exact-head evidence, required-gate policy, hosted workflow diff-base inputs, the label-dispatch boundary, and the standalone Playwright path. The command and label-dispatch tests run the embedded GitHub scripts against fake API responses. They cover command serialization, exact-run proof, label cleanup, required-gate reruns, stale events, forks, permissions, and fail-closed recovery. This makes edits to one workflow fail when they weaken an assumption used by another workflow.
The Claude review workflow runs on pull request changes and prepares a read-only diff that it checks against the same PR head before and after retrieval. It posts feedback as GitHub comments through a restricted tool set. Its completion check treats an execution error as a failed review when the action reports success, while allowing an intentional action skip to pass. The verifier is fetched from the trusted default branch rather than executed from the candidate revision. The command workflow accepts @claude requests only after it verifies write or admin access for both the workflow actor and the requester. Its checkout does not persist credentials, and its action permissions are limited to the read and comment operations needed by the task.
References: .github/…/ci-required.yml• L1-165 .github/…/ci-commands.yml• L7-25 .github/…/ci-commands.yml• L724-769 .github/…/ci-commands.yml• L895-1170 .github/…/ci-commands.yml• L1205-1381 .github/…/ci-commands.yml• L1415-1579 .github/…/ci-commands.test.cjs• L293-351 .github/…/ci-commands.test.cjs• L422-520 .github/…/ci-commands.test.cjs• L1622-1756 .github/…/hosted-ci-label-dispatch.yml• L1-25 .github/…/hosted-ci-label-dispatch.yml• L94-150 .github/…/hosted-ci-label-dispatch.yml• L191-425 .github/…/hosted-ci-label-dispatch.test.cjs• L145-256 .github/…/hosted-ci-label-dispatch.test.cjs• L258-385 .github/…/hosted-ci-safety.test.cjs• L148-216 .github/…/hosted-ci-safety.test.cjs• L361-465 .github/…/hosted-ci-safety.test.cjs• L468-616 .github/…/hosted-ci-safety.test.cjs• L631-672 .github/…/playwright.yml• L1-171 .github/…/package-js-tests.yml• L108-165 .github/…/gem-tests.yml• L102-361 .github/…/integration-tests.yml• L106-237 .github/…/examples.yml• L106-257 .github/…/precompile-check.yml• L99-191 .github/…/pro-integration-tests.yml• L600-918 .github/…/pro-test-package-and-gem.yml• L45-243 .github/…/pro-test-package-and-gem.yml• L255-500 .github/…/benchmark.yml• L17-21 .github/…/benchmark.yml• L77-126 .github/…/benchmark.yml• L128-216 .github/…/lint-js-and-ruby.yml• L1-264 .github/…/node-renderer-fresh-engines.yml• L1-77 script/check-node-renderer-fresh-engines.mjs• L1-25 script/check-node-renderer-fresh-engines.mjs• L50-90 script/check-node-renderer-fresh-engines.mjs• L103-175 .github/…/claude-code-review.yml• L1-102 .github/…/claude.yml• L3-16 .github/…/claude.yml• L47-110
Security and quality gates
Quality gates check both product code and the automation that builds it. The goal is to prevent a green build from hiding a bad package boundary, an unsafe workflow, a missing license notice, or a production asset failure.
The main protections are:
- Ruby, JavaScript, TypeScript, SCSS, and formatting checks.
- Ruby signature validation and dead-code checks.
- Package type and publishing checks through
attwandpublint. - Pro license-header checks before the more costly Pro build work and again in packed Pro JavaScript output.
- Workflow syntax checks through Actionlint and security checks through Zizmor.
- CodeQL analysis for Ruby and JavaScript/TypeScript on pull requests, main pushes, and a weekly schedule.
- Bundle-size review against the merge commit's first parent so the baseline matches the PR build.
- Production asset precompile checks that validate both command success and expected output.
- Benchmark workflow replay checks that verify the isolated Rails DX path keeps its locked install and starter checks.
- Fresh-install dependency engine checks that expose registry drift outside the workspace lockfile.
Actionlint checks workflow correctness. Zizmor checks workflow security risks such as unpinned actions and unsafe credential use. Zizmor findings are advisory while the baseline is reduced, but a broken audit tool or configuration still fails the job. CodeQL supplies a separate source analysis layer for the two main languages. The required gate also checks pinned Shaka seam validation, mirrored workflow blocks, merge-queue package coverage, and the scripts that select hosted suites. The hosted-CI safety test adds contract checks for trusted dispatch, exact-head evidence, suite concurrency, matrix shape, renderer readiness, Pro Rspack coverage, benchmark replay, label-trigger behavior, and the Playwright selector and diff-base path. The fresh-install engine check adds a separate view of npm's current dependency resolution, while its known mismatch list keeps tracked exceptions visible and rejects new or changed mismatches.
The Pro package workflow places the source license check before dependency and build work. It then checks the built and packed JavaScript files because compilation can remove a source header. This protects the artifact that npm users receive, not only the repository source.
References: .github/…/lint-js-and-ruby.yml• L96-264 .github/…/pro-test-package-and-gem.yml• L130-243 .github/…/pro-test-package-and-gem.yml• L218-230 .github/…/pro-integration-tests.yml• L600-918 .github/…/ci-required.yml• L65-165 .github/…/hosted-ci-safety.test.cjs• L218-349 .github/…/hosted-ci-safety.test.cjs• L361-465 .github/…/hosted-ci-safety.test.cjs• L536-616 .github/…/hosted-ci-safety.test.cjs• L631-672 .github/…/ci-commands.test.cjs• L870-1010 .github/…/hosted-ci-label-dispatch.test.cjs• L258-348 .github/…/actionlint.yml• L17-93 .github/…/zizmor.yml• L1-23 .github/…/zizmor.yml• L61-101 .github/…/codeql.yml• L11-39 .github/…/bundle-size.yml• L40-180 .github/…/precompile-check.yml• L99-191 .github/…/node-renderer-fresh-engines.yml• L1-77 script/check-node-renderer-fresh-engines.mjs• L38-90
Publishing and release controls
Release automation aims to publish one coherent version across the JavaScript and Ruby products. A normal release updates four npm packages and two Ruby gems, creates a Git tag and GitHub release, and verifies that the registry artifacts match the requested version. The release task can preview the complete plan without changing the checkout or publishing anything.
Before publication, the release path checks the workspace state. It requires the lockfile and installed dependency lock to match. It also requires the installed pnpm version to match the exact version in the root package metadata. Each release package must build before the task can continue. If a pull changes the checkout while readiness runs, the task binds the result to the new exact commit and repeats the check rather than using stale evidence.
The release path uses a staged sequence:
- Confirm the package manager, lockfile, installed dependency state, and package builds.
- Resolve or validate the target version and its changelog section.
- Confirm branch, tag, version, and CI conditions for the release type.
- Publish npm packages and Ruby gems with registry conflict checks and retry handling.
- Verify all expected artifacts and create or update the GitHub release.
After an npm publish, release automation checks the online registry for the exact package version and retries while the registry becomes consistent. It also rejects published workspace protocol dependencies because external package managers cannot resolve them. This turns a successful publish command into a verified package contract rather than treating the command exit as proof.
Stable releases require the complete required check set. Prereleases have a narrower required-check rule, but they still reject known failures and unknown evidence. Release branches can also use the ShakaPerf release gate for performance-sensitive release evidence. An accelerated RC path may publish while approved gates finish, but it records evidence on a maintainer-controlled tracker and must be reconciled before final promotion. This path does not apply to stable releases.
The release task treats a publish result as a state to verify, not as proof from a command exit alone. It checks registry visibility after publication and supports idempotent recovery only when the existing artifact is proven to belong to the interrupted release. npm and RubyGems authentication use one-time passwords when required. The release supervisor binds live work to an exact release-line contract and refreshes that contract before outward writes.
The live entry point is script/release. It reads the first prepared version after ### [Unreleased] in CHANGELOG.md; operators do not pass a version as a positional argument. A dry run uses the same changelog-selected version without a live process contract. A live run validates the release branch, then starts the Rake task in a dedicated process group.
The supervisor and Rake task share a private local contract. The contract binds the release version, release line, branch, process group, parent process, and liveness channel. The Rake task must pass this contract check before it pushes a version commit, creates a tag, publishes a package, or performs another outward write. Direct live Rake publication is refused without the wrapper contract.
The supervisor also owns process cleanup. It starts a death watch beside the release process and closes the liveness channel when it receives a signal or loses child ownership. The death watch then terminates the release process group. This prevents an orphaned child from continuing publication after its supervisor is gone.
The supervised release boundary is:
sequenceDiagram
participant Maintainer
participant Wrapper as script/release
participant Rake as Release task
participant CI as GitHub checks
participant Registries as npm and RubyGems
participant GitHub as GitHub release
Maintainer->>Wrapper: Preview or start changelog-selected release
Wrapper->>Wrapper: Validate branch and start process guard
Wrapper->>Rake: Start exact release contract
Rake->>Rake: Validate lockfile, pnpm, builds, versions, and tags
Rake->>CI: Verify release-tip evidence
CI-->>Rake: Healthy or blocked result
Rake->>Registries: Publish all package and gem artifacts
Registries-->>Rake: Visible versions and package metadata
Rake->>GitHub: Create or update tagged release
Wrapper-->>Maintainer: Release result or safe recovery state
Claim cleanup uses the same exact-identity path for normal completion and recovery. If cleanup fails or another claim blocks acquisition, the supervisor reports the authoritative coordination state and prints recovery guidance only when the local process identity is safe to use. A maintainer must prove that the reported release process group is dead before releasing that exact claim. This prevents recovery from unlocking a replacement release process by mistake.
Release-train helpers keep branch work separate from publication. release-finish promote is a preview and handoff step: it checks that the release branch tip is the accepted RC or a positively classified non-runtime descendant, then directs live publication to script/release. release-finish close-out checks that source changes and changelog work reached main before it removes the temporary release branch. The branch delete uses remote leases and a recovery ref. Post-delete checks restore the branch when main races and retain the recovery ref when the result is unknown. release-forward-port builds a plan for moving release-only changes to main and requires explicit review for ambiguous commits.
The separate builds repository is an alternative distribution path for pre-built JavaScript output. It is generated from the workspace and tagged from the core package version. It is not a second source of package code.
References: rakelib/release.rake• L315-326 rakelib/release.rake• L9229-9397 rakelib/release.rake• L9703-9946 rakelib/release.rake• L9950-9972 rakelib/release.rake• L10293-10342 rakelib/release.rake• L10414-10629 rakelib/release.rake• L10658-10700 script/release• L12-17 script/release• L51-67 script/release• L90-169 script/release• L245-281 script/release• L283-370 script/release• L447-473 script/release• L631-675 script/release-test.bash• L74-170 script/release-test.bash• L198-281 rakelib/release_lease_guard.rb• L5-17 rakelib/release_lease_guard.rb• L41-117 script/release-finish• L9-28 script/release-finish• L182-200 script/release-finish• L232-275 script/release-finish• L324-388 script/release-finish• L401-515 script/release-finish• L654-699 script/release-forward-port• L137-177 scripts/publish-to-builds-repo.sh• L75-182
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the root workspace package list, package build order, and release package list aligned. A package can build locally yet be omitted from a published release.
- Keep the root
packageManager, lockfile, workspace overrides, and trusted lifecycle dependency list aligned. A dependency can install in one environment but fail the frozen or safe CI path. - Keep
script/ci-changes-detectorcategories aligned with therun_*outputs consumed by every workflow. A missing category can skip needed checks or trigger unrelated benchmarks. - Keep the hosted workflow list in .github/…/ci-commands.yml and .github/…/hosted-ci-label-dispatch.yml aligned with the workflows that prove release and generator coverage.
- Keep the required gate's event triggers, per-head concurrency group, manual recheck inputs, and hosted-label rerun contract aligned. A change can cancel the wrong head or let a stale gate result stand.
- Keep the shared
script/ci-required-diff-baseinputs aligned across every hosted workflow. Base and head identity must remain tied to the revision being tested. - Keep the required gate's pinned Shaka revision, seam checks, and mirrored workflow copies aligned. A drift check that does not cover a new copy or seam can leave policy changes untested.
- Keep the required gate's hosted-label cleanup inputs aligned with the dispatch workflow and hosted selector state. A recheck can otherwise trust stale label evidence.
- Keep hosted control-label events separate from ordinary status-label events. Only control-label changes should dispatch hosted suites or rerun the required gate.
- Keep CI command serialization, dispatch anchors, exact run IDs, coverage markers, and label updates in one fail-closed contract. A change in one step can make an uncertain dispatch look successful.
- Keep command and label-dispatch gate reruns scoped to the same pull request, head, and current gate run. A shared head can belong to another pull request.
- Keep suite concurrency expressions aligned across hosted workflows. Pull request updates must cancel the old head without cancelling unrelated suites or same-head non-PR runs.
- Keep benchmark path triggers and manual-only event rules aligned with the benchmark replay assertions. A label event must not create a duplicate hosted benchmark run.
- Keep benchmark path triggers, isolated lockfiles, starter checks, and hosted replay assertions aligned. A new benchmark fixture can otherwise run locally without CI proving its replay path.
- Keep the fresh-install renderer workflow triggers aligned with the renderer dependency manifest and the checker contract. A new dependency path can otherwise escape the registry-drift check.
- Keep the renderer's advertised Node floor, fresh-resolution checker, and tracked known-mismatch entries aligned. An exception must identify the exact dependency engine range and its issue.
- Keep Pro source-header checks aligned with packed-package header checks. A source file can pass while the compiled artifact loses its required notice.
- Keep Pro workflow change flags aligned with the jobs they enable. New Rspack or dummy-app legs must use the correct Pro test category and the same exact-head and manual-dispatch controls as sibling jobs.
- Keep Pro runtime matrices aligned with the versions used by setup actions. A changed current or minimum Ruby lane can silently remove compatibility coverage.
- Keep Rspack verification aligned with the selected bundler and emitted output. A build log check that does not match the active configuration can accept a fallback build or reject valid coverage.
- Keep renderer readiness checks, renderer URLs, time limits, and log artifact paths aligned across all renderer-backed Pro jobs. A new job can otherwise start tests before the service is ready or lose the evidence needed to diagnose failure.
- Keep security audit baselines and workflow action pins aligned when workflow or composite-action files change.
- Keep the hosted-CI safety assertions aligned with every workflow that consumes hosted selectors, diff-base inputs, matrix outputs, or shared service readiness. A new workflow can otherwise escape the cross-workflow contract checks.
- Keep the Playwright workflow's runner, minimum runtime inputs, force-full selector, docs-only safety input, and browser report path aligned. A change can otherwise skip the only minimum-runtime OSS browser lane or make its failure hard to inspect.
- Keep package packing checks aligned with every published package's build and source-map output. A new package can pass source checks while publishing a broken tarball if it is not packed and checked.
- Keep release version conversion aligned between RubyGems versions, npm prerelease versions, package metadata, and changelog headers.
- Keep release readiness checks aligned with the lockfile and the exact pnpm version declared in the root package metadata.
- Keep publish-time workspace dependency conversion aligned with post-publish registry verification. A temporary local fix must not leave
workspace:ranges in the public package metadata. - Keep the supervisor contract fields, process-group setup, liveness channel, and Rake write fences aligned. A mismatch can block valid releases or leave an outward write outside supervision.
- Keep the release wrapper's changelog selection and branch rules aligned with the Rake task's version and branch policy. A wrapper that accepts a different release scope can start an unsafe task.
- Keep exact release-claim acquire, renew, and release arguments aligned with the authoritative coordination contract. A mismatched identity can leave a claim held or release the wrong state.
- Keep recovery guidance limited to claims with safe identities and require process-group death proof before the exact release command is used.
- Keep release metadata paths aligned with the runtime-tree rules used to reuse ShakaPerf evidence.
- Keep release-train promotion and close-out checks aligned with the forward-port plan. Branch deletion must remain protected by the checked main and release tips.
- Keep sidebar IDs, exclusions, and diff-base policy aligned when published documentation paths change. A new page can otherwise pass content checks but remain absent from navigation.
- Keep documentation-only push safety inputs aligned with the previous revision used by
ensure-main-docs-safety. A missing or wrong prior SHA can weaken the guard for main and merge-queue updates.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Workspace lockfile or installed pnpm state differs | Release readiness stops before publication. | Frozen dependency state and exact lockfile and pnpm-version checks. |
| A trusted lifecycle dependency is missing from the pnpm allowlist | Install or build behavior can differ from CI or fail before package checks. | Explicit onlyBuiltDependencies policy in the root package manifest. |
| A package build fails | Tests or release publication do not proceed with incomplete output. | Root build orchestration and per-package build checks. |
| Change classification cannot resolve a valid merge base | CI stops instead of skipping all suites. | The change detector fails on the hosted diff path. |
| A workflow bypasses the verified diff-base helper or passes the wrong revision identity | A suite can test the wrong change or make an unsafe skip decision. | Hosted-CI safety assertions and the required gate's workflow checks. |
| A generator change has no required hosted coverage | The required PR gate blocks. | Hosted-CI enforcement in the required gate. |
| A hosted control label is added by an untrusted actor, bot, fork, or Dependabot path | Hosted CI is not accepted and the control label is removed or ignored. | Permission, repository, actor, and command-path checks in label dispatch. |
| An ordinary status label changes | No hosted suite or required-gate rerun starts. | The label workflow job condition allows only the two hosted-CI control labels. |
| A hosted label changes without a matching pull-request gate run | The gate cannot be safely refreshed. | The label workflow waits for the head's gate run and fails visibly if it cannot rerun it. |
| A hosted command has an older active command or an unknown dispatch result | No new command is trusted and later commands remain blocked. | Bounded command serialization, durable UNKNOWN markers, and exact run proof. |
| The PR head or base changes during hosted dispatch planning | No workflow or label is accepted for the stale snapshot. | Snapshot rechecks before and after the dispatch anchor. |
| A returned workflow run has the wrong event, path, or head | The dispatch becomes uncertain instead of proving coverage. | Exact run lookup and workflow identity validation. |
| A docs-only main push or merge-queue update has no valid previous revision | The update does not pass the documentation safety path. | The main-push guard receives and checks the previous SHA. |
| A pull request update does not cancel its prior run | Stale and current suite results can compete for the same change. | Per-suite pull-request concurrency groups and safety tests. |
| A benchmark label event starts an automatic run | Duplicate or untrusted hosted benchmark work can consume resources. | Manual-only benchmark triggers and benchmark event assertions. |
| A fresh renderer install resolves a dependency that rejects the renderer's lowest advertised Node version | A new registry compatibility drift is reported for action before it reaches a normal locked CI install. | Newest-Node fresh resolution, engine-range comparison, and scheduled issue reporting. |
| Pro source or packed output lacks its license header | Pro quality checks fail before publication or package use. | Source and packed-package license-header checks. |
| Pro Rspack output uses a different bundler than requested | A green job can report coverage that did not exercise Rspack. | The ExecJS-compatible dummy checks the completion log and manifest. |
| A renderer job starts tests before the HTTP/2 endpoint is ready | Renderer-backed tests fail or report a misleading service error. | The shared readiness action with a bounded wait and preserved renderer log. |
| The benchmark replay path loses its frozen install or starter checks | Benchmark artifacts can drift or fail without the workflow proving the stored path. | The isolated Rails DX benchmark check and hosted-CI safety assertions. |
| A packed package points to a source map that its tarball does not contain | Consumers and error tools cannot resolve package source locations. | Packed-package source-map checks in the lint workflow. |
| npm does not show a just-published exact version during the consistency window | The release stops or cannot prove publication completeness. | Online registry reads with bounded retries before artifact verification fails. |
A published npm package contains a workspace: install dependency | Consumers cannot install the public package from npm. | Temporary publish metadata conversion and registry metadata checks. |
| Release readiness was checked before the checkout changed | Publication can use stale package evidence. | Readiness is bound to an exact SHA and rerun after a changed pull. |
| The live Rake task runs without the wrapper contract | Outward release writes are refused. | ReleaseLeaseGuard activation and per-write fences. |
| The release wrapper receives a signal or loses child ownership | The release process group is terminated instead of continuing unsupervised. | Liveness channel, death watch, bounded termination, and group reaping. |
| Release branch contains runtime-bearing or unclassified commits after the accepted RC | Final promotion stops and does not hand off to the release supervisor. | RC ancestry and release-commit classification checks in release-finish promote. |
| A target registry version already exists outside an idempotent retry | Publication stops to avoid attaching the wrong source to an existing artifact. | Registry conflict preflight and exact visibility checks. |
| A foreign release-line claim exists or authoritative claim state is unknown | Release acquisition stops and no takeover occurs. | Pre-acquisition status validation and atomic exact-identity claims. |
| Claim cleanup fails or release process death is not proven | The release cannot safely restart and the claim remains protected. | Exact recovery guidance after process-group proof. |
| Main changes during release-branch close-out | The branch is restored or retained for review. | Remote-tip leases, recovery refs, and post-delete verification. |
Key files
| File | Why to read it |
|---|---|
| package.json | Defines the workspace, root build and check commands, package manager pin, dependency build policy, and publication entry point. |
Rakefile | Shows how root Ruby commands delegate to the core package bundle and which root lint files are in scope. |
react_on_rails/Rakefile | Defines the local test, lint, preparation, and CI task groups. |
react_on_rails/rakelib/shakapacker_examples.rake | Explains how generated Rails examples become runnable compatibility checks. |
react_on_rails/rakelib/run_rspec.rake | Maps Ruby test task groups to gem, dummy, and example coverage. |
script/ci-changes-detector | Defines the change categories and the suite flags used by hosted CI. |
| script/ci-changes-detector-test.bash | Shows the selector contracts for docs, source, CI infrastructure, comments, release tooling, and benchmarks. |
script/lib/git-diff-base | Resolves a usable merge base when CI starts from shallow or incomplete Git history. |
| script/…/git-diff-base-test.bash | Shows the expected behavior for ref validation, fetch repair, shallow history, and failure handling. |
script/check-docs-sidebar | Enforces navigation coverage for newly added published documentation. |
| script/check-node-renderer-fresh-engines.mjs | Compares fresh npm dependency resolution with the Node floor advertised by the Pro renderer and tracks known registry mismatches. |
| .github/…/ci-required.yml | Defines the required policy gate, its event and per-head concurrency rules, pinned external workflow checks, repository seam checks, merge-group coverage, and controlled hosted-CI rechecks. |
| .github/…/ci-commands.yml | Defines maintainer-controlled hosted-CI commands, exact-head coverage proof, command serialization, and required-gate refreshes. |
| .github/…/ci-commands.test.cjs | Shows fail-closed command dispatch, exact-run validation, coverage recovery, label changes, and gate-rerun contracts. |
| .github/…/hosted-ci-label-dispatch.yml | Dispatches hosted CI for control-label changes and refreshes the required gate without reacting to ordinary status labels. |
| .github/…/hosted-ci-label-dispatch.test.cjs | Defines the label-event permissions, cleanup, stale-event, fork, concurrency, and required-gate rerun contracts. |
| .github/…/hosted-ci-safety.test.cjs | Replays workflow contracts for trusted dispatch, revision identity, concurrency, matrices, renderer readiness, benchmark replay, label dispatch, and required-gate policy. |
| .github/…/integration-tests.yml | Shows the independent build-to-dummy-app integration chains for Webpack and Rspack. |
| .github/…/gem-tests.yml | Shows Ruby matrix selection, deterministic setup-safe generator sharding, and focused release-supervisor coverage. |
| .github/…/examples.yml | Shows generated Rails example coverage across runtime and dependency lanes. |
| .github/…/package-js-tests.yml | Shows latest and minimum Node package-test coverage and workspace build orchestration. |
| .github/…/playwright.yml | Shows the minimum-runtime standalone OSS browser test path, hosted change selection, browser setup, and report retention. |
| .github/…/precompile-check.yml | Shows production asset compilation and output validation for the dummy app. |
| .github/…/pro-test-package-and-gem.yml | Shows Pro change selection, license checks for source and packed output, current/minimum Ruby package coverage, and Pro package test orchestration. |
| .github/…/pro-integration-tests.yml | Shows licensed Pro, Node renderer, Redis, Playwright, RSC, and additive ExecJS-compatible Rspack validation. |
| .github/…/lint-js-and-ruby.yml | Collects change selection, documentation-only safety, and the main quality, type, package, format, and packed-artifact gates. |
| .github/…/node-renderer-fresh-engines.yml | Runs the advisory scheduled and dependency-triggered fresh-install engine check and reports scheduled drift through one issue. |
| .github/…/benchmark.yml | Separates manual hosted performance runs from pull-request benchmark artifact and Rails DX replay checks. |
| .github/…/claude-code-review.yml | Shows read-only PR diff capture, restricted review tools, trusted verifier loading, and the guard against silent review failure. |
| .github/…/claude.yml | Shows the actor and requester permission gate for maintainer-requested assistant actions. |
rakelib/release.rake | Defines version checks, CI evidence, registry publication verification, workspace dependency protection, recovery, and GitHub release work. |
script/release | Supervises the release process and its exact local release-line contract from validation through cleanup. |
| rakelib/release_lease_guard.rb | Defines the private contract and write fence that keeps live publication under the release supervisor. |
script/release-claim | Provides exact-identity acquire, renew, and recovery release operations for the release-line claim. |
| script/release-test.bash | Exercises changelog selection, local release setup, process cleanup, supervisor fencing, and secret-safe test doubles. |
script/release-finish | Coordinates accepted-RC promotion preview and safe release-branch close-out. |
| script/release-finish-test.bash | Exercises promotion guards, remote checks, race handling, recovery refs, and close-out deletion safety. |
script/release-forward-port | Plans and applies reviewed release-to-main changes. |
| scripts/publish-to-builds-repo.sh | Generates the pre-built package distribution repository. |