Repository navigation
Conversation
Port AgentWorkforce/cloud #4350/#4351 so the merge-train sweeper can manage this repo: - All 18 promotion workflows run the trunk -> main PR on opened/reopened/ labeled only (never synchronize, edited or ready_for_review); every gated job skips label events other than `ci:run`. relayflow-pr-proof-broker's pull_request_target trigger gets the same types. - Concurrency gives unrelated label events a throwaway group so they never cancel a real promotion run; push runs key off the sha. - New `Merge-train ready check` on `mergeable` feature PRs into trunk, forks included (no secrets under pull_request): lint, prettier, typecheck, contract test. - scripts/merge-train-ci-workflows.test.mjs discovers every promotion workflow and pins types, the exact job gate (extra `&&` conditions allowed, no top-level `||`), the throwaway groups, the `changes / Detect change scope` marker and the ready check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
There was a problem hiding this comment.
All reported issues were addressed across 19 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit de4ca5d. Configure here.
- Ready check runs fork code, so it uses GitHub-hosted ubuntu-latest, never the self-hosted CI_LINUX_RUNNER pool; actions pinned to the repo's SHAs. - Manual dispatches and schedules get a run-scoped concurrency group instead of sharing push-<sha>, so they never replace a queued push run. - tests/fixtures/pr-proof-contract.test.ts asserts the proof broker's new trigger types and ignored-label concurrency group. - The contract test pins the ready check's complete `if` and its runner. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
CI on the trunk -> main PR must be intentional: it runs only when the merge train or an agent adds `ci:run` once the PR is ready. Opened, reopened and synchronize run nothing. - Promotion workflows trigger on `labeled` only, and every trunk-gated job requires `github.event.action == 'labeled' && github.event.label.name == 'ci:run'` (trunk head / main base checks and the throwaway concurrency group for other labels are unchanged). - The contract test pins the new gate and trigger types (red-first: it fails against the opened/reopened version). - The feature-PR `Merge-train ready check` is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 19 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Closing: the merge train is cloud-only now (Khaliq's decision). This repo goes back to normal per-PR CI on main, and a separate revert PR removes the trunk gating and the merge-train snippet. |

Prepares relay for the merge-train sweeper (AgentWorkforce/cloud
packages/web/lib/merge-train), porting cloud #4350/#4351. Same shape as the merged relaycast#497, relayauth#101, relayfile#546 and relayhistory#399. relay stays in dry-run.mainhere requires an approving review. Until Khaliq decides otherwise, promotion stays human-approved: the sweeper can open and maintain the trunk -> main PR, but GitHub will refuse its merge without a human approval.Changes
ci:runis added (labeledtrigger; every job requires theci:runlabel event). Opened, reopened and synchronize run nothing.targeted-feature-verificationalso dropsready_for_review, andrelayflow-pr-proof-broker'spull_request_targetdropssynchronize,editedandready_for_review.large-files.ymlmoves fromon: [pull_request]to the mapping form.ci:run. Jobs that already had extra conditions keep them as(gate) && (...).ignored-<run_id>group, so they can't cancel a real promotion run (#4351).github.ref, so merges no longer cancel each other.relayflow-pr-proof-brokerkeeps its per-head group, plus the ignored-label throwaway.merge-train-ready.yml(Merge-train ready check): runs on feature PRs intotrunkwhilemergeableis on, including fork PRs. Underpull_requesta fork gets no secrets and a read-only token; trust is the sweeper's gate. Events the job will skip get a throwaway group. Steps:npm ci, the contract test,npm run lint,format:checkandtypecheck.scripts/merge-train-ci-workflows.test.mjs:cancel-on-merge;&&condition is allowed, a top-level||bypass isn't);changes / Detect change scope(test.yml'schangesjob) and the ready check.Effect on manual promotion
A human trunk -> main PR (e.g. #1939) gets CI only when
ci:runis added, by the sweeper or by hand. Pushes to trunk no longer re-run it automatically.Verification
node --test scripts/merge-train-ci-workflows.test.mjs: 4/4 pass. Red-first: 3 of 4 fail against the old workflows.actionlintshows no new findings (one pre-existingubuntu-20.04label warning intest-install.yml).prettier --checkpasses on every changed file.🤖 Generated with Claude Code
Note
Medium Risk
Changes when and how CI runs for all promotion PRs and merge-train gates; misconfiguration could block merges or skip required checks, but behavior is contract-tested and limited to workflow YAML.
Overview
Aligns relay with the merge-train sweeper by batching full promotion CI on the trunk →
mainPR until theci:runlabel is applied, instead of running on every PR open/sync.Promotion workflows (~18):
pull_requesttriggers switch totypes: [labeled]only; jobifconditions additionally requireaction == labeledandlabel.name == ci:runfor same-repotrunk→mainPRs. Pushes tomainand manual dispatch behavior are unchanged. Concurrency is reworked so PR runs group per PR (cancel in progress), push runs key off commit SHA (parallel merges don’t cancel each other), and non-ci:runlabel events use throwawayignored-*groups so they can’t cancel a real run.New
merge-train-ready.yml: Lightweight gate for PRs targetingtrunkwhile themergeablelabel is present (labeled / synchronize / reopened), running lint, format, typecheck, and the workflow contract test—intended for feature PRs before merge-train promotion.scripts/merge-train-ci-workflows.test.mjspins the shared contract (gate expression,labeled-only triggers, ignored concurrency groups, sweeper CI marker job, ready check shape).pr-proof-contract.test.tsexpectations forrelayflow-pr-proof-broker.ymlare updated for the same label-gated promotion model.Reviewed by Cursor Bugbot for commit 08978dd. Bugbot is set up for automated code reviews on this repo. Configure here.