Skip to content

fix(relay): deploy driver builds the checked commit, prompts on their own line, summarises progress - #25755

Merged
Jinwoo-H merged 2 commits into
mainfrom
fix/relay-deploy-driver-pin
Oct 6, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
fix/relay-deploy-driver-pin

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​71 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​54
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​77 $\color{#cf222e}{\Huge{\mathbf{−}}}$​49 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​28

ELI5

The script that deploys the relay director checked "is main still the commit I reviewed?" and then waited about four minutes before asking GitHub to build main. main changes about six times an hour, so on its first real use (2026-10-05) it built a different commit and, correctly, refused to deploy it. This PR makes the script build right after that check. It also fixes two things that made the run hard to follow.

What Changed

  • Build the checked commit. Before: the driver checked main, ran two read-only inspections, waited for the operator to type DEPLOY …, and only then started the image build. The build workflow takes no commit input; it always builds whatever main is at that moment. After: the driver starts the build a few seconds after checking main, before the inspections and the typed phrase. It still checks that the build is the reviewed commit and that the registry digest matches the build log. If main moves in those few seconds, the driver stops before touching rehome or the director. It then prints --commit <built commit> --publish-run <run>, which deploys that exact build once someone has reviewed it, without building again. A stop later in the run (for example, rehome found paused) already prints a re-run command that reuses the build.
  • Prompts on their own line. Before: Type PAUSE_REGIONAL_REHOMING to continue: had no trailing newline, and the operator noticed it about five minutes late. After: the prompt ends with a newline.
  • Summarised progress. Before: the driver streamed gh run watch output, which flooded the terminal. After: it polls the run every 10 s and logs one line when the status changes, plus one every 5 minutes, for example monitor: in_progress, 5 min. It still logs one line when the run finishes.
  • Docs: the driver sequence in cloud/docs/relay-workflows.md now lists publish first.

Why

The simplest fix would be to build an explicit commit. The publish workflow (cloud-publish-relay-production.yml) has no commit input, though. It always builds the head of the ref it is dispatched on. Adding that input would change an audited production workflow and its image-tag logic. Building first closes the gap with a driver-only change. Building first is safe because the build only pushes an immutable relay:sha-<commit> tag; nothing serving changes until the operator types DEPLOY. The "reuse this run" path (--publish-run) already existed and already checks the run's commit. This PR makes the stop message tell the operator to use it.

Trade-off: the build now starts before the operator types DEPLOY. A run that stops in preflight leaves an unused image, but the printed re-run command reuses it.

Linked Issue

N/A. These are follow-ups from the driver's first production use (#25642), recorded in the 2026-10-05 ops log.

Visual Proof

N/A. This is an operator command-line script with no UI.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

cd cloud && node --test dev/scripts/drive-relay-director-deploy.test.mjs: 32 pass. New tests:

  • main moving during the inspections and the typed phrase (the 22:59Z case) no longer stops the deploy.
  • main moving between the check and the build stops with nothing else dispatched, and the printed --commit … --publish-run … finishes without a second build.
  • A running workflow logs one status line, another at 5 minutes, and the final result.
  • Every typed prompt ends with a newline.

I checked that the tests catch the bug: with the early build removed, the new race tests fail. No workflow was dispatched.

Review

Merge timing: this touches cloud/ evidence code, so it must merge between rolls, not while a relay rollout is in flight.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Operator-only Node script on the operator's machine. It runs no differently over SSH, on mobile, or across platforms.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…et the deploy driver

The publish workflow builds main's head at dispatch. The driver checked main
at preflight but dispatched the publish about four minutes later, after the
inspects and the typed phrase, so a busy main stopped the first real deploy.
It now dispatches the publish seconds after the check, before anything else,
and a build of a moved main stops with the --commit/--publish-run command that
deploys it once reviewed. Typed prompts end in a newline, and runs are
summarised (status changes plus every 5 min) instead of streaming gh run watch.
@pullfrog

pullfrog Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This run was cancelled 🛑

The workflow was cancelled before completion. Please check the link below for details.

Pullfrog  | View workflow run | via Pullfrog | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b8f706c-5700-4f95-8b05-c92919854aa3
📥 Commits

Reviewing files that changed from the base of the PR and between 8164c50 and a548de1.

📒 Files selected for processing (2)
  • cloud/dev/scripts/drive-relay-director-deploy.mjs
  • cloud/dev/scripts/drive-relay-director-deploy.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The deployment driver now publishes before it reads director state and requests operator confirmation. Before publishing, it checks that no non-exempt cloud-* workflow is queued or running and that main matches the reviewed commit. If the publish run builds a different commit, the driver records the commit and run ID and reports a rerun command that reuses the build. Workflow run monitoring now polls status instead of streaming logs. Tests and workflow documentation reflect the updated sequence and polling behavior.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to a548d

No deployment-blocking issue is established; the change is ready for normal merge checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to a548d

Publishing now occurs before deployment confirmation, but serving changes remain behind commit, digest, inspection and ownership checks. No introduced security vulnerability was established. Production approval rules and credential permissions were unavailable, so the assessment remains qualified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The pre-confirmation writes evidenced here are production relay and relay-fence-broker image publications. Serving director deployment and rehome changes remain later operations. The workflow obtains the configured production deployment service account; its effective permissions beyond the shown registry operations are not established by this source.

Security Findings and Attack Paths

  • inferred — Moving main between its check and workflow dispatch can cause a different commit to be built and pushed before rejection. This race existed at the base; the PR shortens its window and retains rejection before serving changes. Exploitation would require authority to influence the dispatched source or workflow, which the available evidence does not establish for an attacker.

Trust Boundaries and Controls

  • observed — The workflow delegates from GitHub execution to a configured GCP service account through OIDC. Its declared GitHub permissions are contents-read and ID-token-write. These declarations identify the boundary but do not establish environment approval rules, provider trust restrictions or cloud IAM scope.

Resilience and Maintainability Implications

  • observed — Partial or interrupted rehome transitions retain explicit changing, unconfirmed or owned-pause state in recovery reporting. Enable recovery retains ownership only for a pause it can prove it created, rather than lifting a pause imposed by another actor or safety mechanism.

Hardening Proposals

  • proposed — A future publish contract could bind the reviewed SHA at dispatch or verify an expected SHA before production authentication and publication. This would remove the remaining branch-movement race rather than merely shorten it; it is not a verified vulnerability in this PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the checked-commit deployment fix and also names the prompt and progress updates. It is detailed but still concise enough to describe the main changes.
Description check ✅ Passed The description covers the required ELI5, changes, rationale, linked-issue context, visual-proof status, testing, review, upstream-boundary, notes, and checklist sections. It explains the automated te…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

… build

The generic re-run line named the reviewed commit without --publish-run, which
would only build the moved main again.
@Jinwoo-H
Jinwoo-H merged commit 0e9e273 into main Oct 6, 2026
23 checks passed
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