Repository navigation
fix(sync): wait for a queued sync PR to leave the merge queue - #695
Conversation
A target with a merge queue refuses pushes to a queued PR's branch, so a sync that ran while the previous sync PR was queued failed red (melodic-software/standards#703). Before checking the target out, the sync job now polls the open PR on chore/standards-sync and waits, up to 30 minutes, until it merges or drops out of the queue. A merged predecessor becomes the base of a fresh sync PR; a dequeued one is updated in place. Past the budget the target fails and the next sync run reconciles it. Targets without a merge queue proceed after one query. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Validate MAX_POLLS and POLL_SECONDS so a bad value fails instead of removing the bound or hot-spinning, wait only on PRs whose head lives in the target repository, and name the re-run remedy in the timeout message. Tests now assert each 30-second sleep, the fork case, and the budget validation, and the test file is Biome-formatted. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b45070f611
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Claude finished @kyle-sexton's task in 3m 35s —— View job Security review — no issues found
I reviewed the three changed files for logic flaws, authorization/trust-boundary gaps, injection surfaces, and unsafe credential handling (GitHub Actions hardening — unpinned actions, trigger/permission widening — is zizmor's advisory lane, so I didn't re-report on that axis):
I did not re-report the installation-token scope concern Codex already raised inline (whether the mint needs No Result: no security findings. |
|
claude-security-review has reviewed this pull request through 3400ca5; a later push is reviewed from there. |
The sync App token holds no merge-queues permission. A probe run with a pull-requests:read token of that App read isInMergeQueue and the PR's ADDED/REMOVED_FROM_MERGE_QUEUE timeline events without error, but whether isInMergeQueue reports true without that permission is unproven, so a PR whose latest queue event is AddedToMergeQueueEvent also counts as queued. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Claude finished @kyle-sexton's task in 4m 8s —— View job Claude is running
|
|
Claude finished @kyle-sexton's task in 2m 12s —— View job Claude security review (incremental)
This pass covers only what changed since What changed: Security read:
Whether No new test-file ( Result: no security findings in this incremental diff. |
|
claude-review has reviewed this pull request through 3400ca5; a later push is reviewed from there. |
## Summary Registers the nine ci-workflows reusables at the v0.38.1 tag `2531d56a21e79b7b5222643fadbee95c23a4525b` in `components/runner-policy/policy.json`. Without them the automated repin #711 fails `check-policies` (the sync job's routing reads `needs`, so its new SHA cannot be auto-approved). #711 carries the merge-queue wait from ci-workflows#695 into this repo's sync, which fixes #703. ## Fix - `policy.json`: nine new keys, each body a verbatim copy of its `95732fd` (v0.38.0) entry, text-spliced (121 insertions, 0 deletions; a JSON comparison confirms each copy equals its source). - `README.md`: review note for v0.38.1. v0.38.1 adds only ci-workflows#695 on top of v0.38.0: eight workflow blobs are byte-identical. `maintenance-sync-standards.yml` adds one `actions/github-script` step that uses the target-scoped App token it already mints, and raises the `sync` job timeout from 15 to 45 minutes. No input, secret, caller permission or `runs-on` routing moved. The `95732fd` and `fb56986` entries stay until every consumer repins. ## Verification - `git diff 95732fd..2531d56` in ci-workflows: only #695's three files. - `npm run test:runner-policy` 297/297, `npm run lint:runner-policy` pass, markdownlint and biome clean. - With #711's patch applied on top locally, `runner-policy.mjs --root .` passes and the 297 tests pass. ## Related - #703 - #711 (automated repin to v0.38.1) - melodic-software/ci-workflows#695 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

Summary
Standards-sync runs failed red with "A pull request for this branch has been added to a merge queue … cannot be updated" whenever the target's previous sync PR was queued (standards runs 37241627436 and 37242006896, claude-code-plugins#6383). Fixes melodic-software/standards#703 once standards repins to a release containing this.
Fix
A new step in the
syncjob, placed beforeCheck out target, polls the open PR onchore/standards-sync(GraphQLisInMergeQueue) every 30 s, up to 60 polls (30 min):create-pull-requestopens a fresh sync PR carrying the newer state;The
syncjob timeout rises from 15 to 45 minutes to cover the wait. Job names, the matrix, and theplan/attest/syncstructure are unchanged. Observed queue time on claude-code-plugins sync PRs is 7–11 min (#6383: queued 22:56:05, merged 23:02:48).Verification
node --test .github/scripts/*.test.cjs: 240 pass, including the newstandards-sync-merge-queue-wait.test.cjs(runs the extracted inline script against mocked GraphQL for each case above, and checks step order, branch agreement with the PR step, and timeout headroom).actionlintclean.Related
🤖 Generated with Claude Code