Skip to content

ci(release): dry-run the release train without publishing - #5534

Merged
kovtcharov-amd merged 13 commits into
mainfrom
ci/release-train-dryrun
Oct 21, 2026
Merged

kovtcharov-amd merged 13 commits into
mainfrom
ci/release-train-dryrun

Conversation

@kovtcharov-amd

@kovtcharov-amd kovtcharov-amd commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Today the only way to find out whether a release builds is to tag one, and the flagship agent, the terminal and the Windows setup are each built by a different workflow at a different version. With this PR a maintainer can dispatch one workflow on a branch and get every first-party artifact of its commit built twice: once as the release candidate, and once as the final twin a final would promote. Each one is verified and listed with where a real train would publish it, and nothing is published. This is Phase 2 of the release train (#5172, plan in #5492). It runs Phase 1's version check (#5508).

The shared build workflows only gain optional inputs that default to empty, so publish.yml, release_components.yml, the agent releases and the PR gates build exactly what they did before. This PR's own build-installers, terminal and Windows-setup PR gates run them with those defaults. The dry run only builds the commit it's dispatched on. An earlier version took a ref to build, and CodeQL rightly flagged that it would run other code with main's cache scope, which later release builds restore. The dry run's token is read-only except in the two Agent UI installer jobs, because build-installers.yml declares contents: write and id-token: write and GitHub won't call it with less. Nothing in the dry run can use those grants: no secret is passed, publish_to_release is false, and a test pins both. Removing the grant means changing build-installers.yml in a way that isn't additive, so that waits until after v0.25.1 final.

🔍 Technical details

Run it: gh workflow run release_train_dryrun.yml --ref main -f rc_tag=v0.25.1-rc3

What verify checks

  • SHA-256 for every artifact, plus SHA256SUMS and gaia-tui-SHA256SUMS.txt (install.sh/ps1 read the latter) for each build.
  • Version stamps: wheel METADATA, sdist PKG-INFO, npm package.json, Electron latest*.yml, and the string embedded in each terminal binary. The final twin must not carry the RC string.
  • binaries.lock.json generated from this run's sidecar and terminal builds instead of the committed PENDING placeholders, packed into the flagship npm tarball, and checked against the built bytes.
  • Twin-diff of the wheel, sdist, @amd-gaia/agent-ui tarball and the .deb's app.asar, once versions and Vite chunk hashes are normalised.
  • One terminal target rebuilt from scratch to prove the Go build is reproducible.
  • Every build's existing smoke jobs must pass (Electron structural/distro/userns, DMG, MCP harness, frozen-sidecar smoke, .pkg/.deb/.rpm and Windows setup clean-runner installs, flagship npm vitest), plus a clean-venv pip install and npm install of the core packages on Linux, Windows and macOS.

Additive edits to shared workflows (every new input is required: false, default ''; test_new_callee_inputs_are_optional_and_empty_by_default pins it)

  • build-installers.yml: artifact_prefix, plus ref, because tag names a version that isn't a tag yet. An empty prefix leaves artifact names and the concurrency group unchanged, and an empty pattern: downloads every artifact as before.
  • tui_installers.yml: artifact_prefix, and a new sidecar: artifact mode. The default is still pinned.
  • windows_setup.yml: artifact_prefix, and agent_ui_artifact as a third desktop-app source, with the same name, PE and size checks.
  • publish.yml, release_components.yml, release_agent_*.yml, build_flagship_sidecar.yml and test_agent_gaia_npm.yml are untouched.

What the train would publish vs v0.25.1-rc2

  • Renamed: terminal binaries use one scheme, gaia-{linux,darwin}-x64 and gaia-win-{x64,arm64}.exe, instead of publish.yml's -amd64 / gaia-windows-*. The Windows ones also gain their icon and version resources, and gaia version prints 0.25.1-rc.2 rather than v0.25.1-rc2. install.sh/ps1 (ci(release): take installers from GitHub releases, stop uploading them to R2 #5509) fetch the old names, so Phase 5 has to pick one scheme for both.
  • Added: SHA256SUMS and release-manifest.json. A final would also gain the four terminal packages, the combined Windows setup and the flagship sidecars as GitHub assets.
  • Not built here: the two Sigstore bundles, which are signed at publish time.
  • Unchanged: the wheel and sdist have the same file contents as the published rc2 ones, and the Agent UI installers, latest*.yml, Windows setup and flagship RC manifest keep their names.
  • npm and hub: @amd-gaia/agent-ui is unchanged. The flagship tarball is still @amd-gaia/gaia (renamed @amd-gaia/agent with a gaia-agent bin in Phase 5). The hub only gets what the lock pins: the four sidecars and six raw terminal binaries (ci(release): take installers from GitHub releases, stop uploading them to R2 #5509).

Test plan

  • Dry run of this branch (main + this change) as v0.25.1-rc3: green, 51 artifacts, 48 checks, 27 min wall, 81 runner-minutes (run)
  • Dry run of the rc2 code (0b14d740d plus these workflow files, branch ci/release-train-dryrun-rc2) as v0.25.1-rc2: green, 51 artifacts, 41 min wall (the best-effort Intel Mac sidecar leg is the critical path), 100 runner-minutes (run). Green again with the final verify code: 25 min, 81 runner-minutes (run)
  • Before the ref removal, the same workflow was green on the rc2 commit and on main (rc2, main, rc2 again)
  • CodeQL passes: the 22 cache-poisoning alerts from the first version are closed as fixed
  • pytest tests/unit/test_release_train.py tests/unit/test_release_train_dryrun_workflow.py: 50 tests. Each of npm publish, a secret, a push trigger, an environment, a write grant, a publish.yml callee and publish_to_release: true added to the workflow fails the guard, and so does checking out another ref. An altered twin, a wrong stamp, a stale lock, a missing platform and an unreadable archive each fail verify.
  • python util/lint.py --all and actionlint pass on every touched workflow and its live callers
  • This PR's build-installers (including the AppImage distro and DMG smokes) and build_tui (tui_installers + windows_setup clean-runner installs) gates pass with the default inputs
  • After merge: gh workflow run release_train_dryrun.yml --ref main -f rc_tag=v0.25.1-rc3 is green: 51 artifacts, 48 checks, 28 min wall, 81 runner-minutes (run)

The branch runs used a temporary push trigger, because a dispatch needs the file on main. It is reverted in this branch.

A maintainer can now build every first-party artifact of one commit the way
the release train will, as a release candidate and as the final-stamped twin
a final would promote, and get a manifest of exactly what a real run would
publish and where, without anything being published. This is Phase 2 of the
release-train plan (#5172, #5492).

The dry run reuses the release's own build workflows. Each one gains optional
inputs (ref, artifact_prefix, and a third desktop-app source for the Windows
setup) that default to empty, so publish.yml, release_components.yml and the
PR gates build exactly what they did before.

Verify checks every checksum and version stamp, generates the flagship lock
from this run's own builds instead of the committed placeholder, diffs each
archive against its twin, and rebuilds one terminal binary to prove the Go
build is reproducible. A unit test fails if the workflow gains a trigger, a
secret, an environment, a write grant or a publish step.
The terminal rebuild differed only because the downloaded binaries sat
inside the checkout, so Go stamped the rebuild vcs.modified=true. They now
live outside it. The sdist twin-diff flagged SOURCES.txt, which lists the
same 615 files in a different order because renamed Vite chunks sort
differently; file listings now compare as a set of lines.
install.sh and install.ps1 verify the terminal binary against the release's
gaia-tui-SHA256SUMS.txt, so a train release has to carry one. Verify now
writes it for each build and lists it in the manifest.
…c3 (reverted before merge)"

This reverts commit 29c16a7.
…n rc2 (reverted before merge)"

This reverts commit 7ff93ee.
# Conflicts:
#	.github/workflows/test_unit.yml
@github-actions github-actions Bot added devops DevOps/infrastructure changes tests Test changes labels Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

This adds a manually started dry run of the release train. It builds every first-party artifact of one commit twice, once as the release candidate and once as the final, checks checksums, version stamps, the flagship lock and the candidate-vs-final diff, and writes a manifest of what a real train would publish. It publishes nothing. The guard tests make that hard to undo by accident, and the shared build workflows only gain optional inputs that default to today's behaviour. I found nothing blocking.

  • Before merging: two test-plan items are still open: the confirmation dry run with the final verify code, and this PR's own installer, terminal and flagship-npm gates under the default inputs. Those gates are what show the additive edits leave publish.yml and the PR gates unchanged, so wait for them to go green.
  • Squash on merge: the branch has two "TEMPORARY" commits and their reverts.
  • Two small hardening nits are in the details below.

Real-world evidence

N/A here: this is a CI-only change, so no evidence bundle was produced. The PR links two real green dry runs (rc2 at 0b14d740d with 49 artifacts and 48 checks, and main as rc3). I didn't run the workflow or its unit tests in this job because pytest isn't installed here. The verdict rests on reading the code plus those linked runs.

🔍 Technical details

🟢 Minor

  • Dispatch input interpolated straight into a shell script (.github/workflows/release_train_dryrun.yml:80). echo "Building ${{ inputs.ref }} = ${sha}" is the one spot in the file that skips the env-var pattern the rest of it uses (RC_TAG, PREFIX, REF). Only maintainers can dispatch it and the token is read-only, so the risk is low. It's still the textbook Actions script-injection shape, and the guard test wouldn't catch it.

            echo "Building ${REF} = ${sha}"
    

    Then add env: { REF: ${{ inputs.ref }} } to the "Resolve the commit" step.

  • A wheel without METADATA crashes verify instead of reporting (util/release_train.py:676). next(...) with no default raises a bare StopIteration traceback. Every other failure lands in report.errors and the summary. Give next a default of None and call _expect(report, False, ..., "no .dist-info/METADATA") when it comes back None.

Notes (no change needed)

  • In build-installers.yml and test_agent_gaia_npm.yml, the concurrency groups append artifact_prefix/ref. For every existing caller both are empty, so the group string is unchanged.
  • In tui_installers.yml, COMMIT still falls back to GITHUB_SHA when ref is empty, so the ldflags of PR-gate and release binaries are byte-identical to before.
  • windows_setup.yml already accepted sidecar: artifact. The new agent_ui_artifact source reuses fetch_agent_ui_setup.verify, so it gets the same name, PE and size checks as the other two sources.

Strengths

  • The verify tooling loads its artifact tables from the target checkout (installer/tui/artifacts.py, gen_binaries_lock.py, flagship_rc_assets.py) instead of copying them, so the dry run can't drift from the code that builds the release.
  • The twin-diff normalises only the three version spellings and Vite content hashes, then compares file sets. A real content change between candidate and final still fails, which is the property a promote-the-twin release depends on.
  • The workflow guard tests pin no secrets, no environment, no publish step, no publish.yml callee and publish_to_release: false, and they fail on each of those being added. That's the right defence for a workflow whose safety rests on what it doesn't do.

CodeQL flagged the dry run's `ref` input as cache poisoning, and it was
right: a dispatch on main that checked out another commit ran that code
with main's cache scope, so its npm, Go and Electron caches would be
restored by later main and release builds. The dry run now builds the
commit it is dispatched on (`gh workflow run --ref <branch>`), which is
also what the train does on a tag.

That removes the `ref` input from tui_installers.yml and windows_setup.yml
and leaves build_flagship_sidecar.yml and test_agent_gaia_npm.yml
untouched. build-installers.yml keeps an optional `ref`, which the dry run
sets to its own commit, because its `tag` input names a version that isn't
a tag yet. A test now fails if the dry run checks out any other commit.
A wheel with no METADATA, a truncated tarball or a malformed lock used to
stop verify with a traceback, so the manifest and every later check were
lost. Each one is now a named failure in the summary, and the rest of the
checks still run.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator Author

Both suggestions are in. The ref input is gone entirely: CodeQL flagged it as cache poisoning, so the dry run now builds only the commit it's dispatched on, and a test enforces that. Verify now records an unreadable archive (a wheel with no METADATA, a truncated tarball) as a failed check and runs the rest, instead of crashing.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit be2c42d Oct 21, 2026
61 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the ci/release-train-dryrun branch October 21, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops DevOps/infrastructure changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants