Skip to content

fix(land): merge with workflow write when the prepared head brings a workflow change - #374

Merged
kixelated merged 3 commits into
mainfrom
fix/land-merge-workflows
Nov 1, 2026
Merged

kixelated merged 3 commits into
mainfrom
fix/land-merge-workflows

Conversation

@kixelated

@kixelated kixelated commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

moq-dev/quest#286 stalled the moq-dev/quest gate on 2026-11-01. PUT /pulls/286/merge returned 403 Resource not accessible by integration, and the daemon retried the whole batch every time, so nothing else landed. I took #286 out of the queue to unstick it.

Cause. The gate merged main into #286's old head (efcaa14). That merge commit carries main's deletion of .github/workflows/land.yml. GitHub refuses an App's merge of a PR whose commits touch workflows unless the token has workflows. The gate's push of efcaa14 already asked for workflow write, since push() diffs the pinned head against the prepared head. The merge token didn't: touchesWorkflows only looked at the squash's own diff.

Changes.

Tests.

  • New: the gate's base merge brings a workflow change, so the merge uses a workflow token.
  • New: an author's own merge of main brought a workflow change, the head is up to date, and the merge still uses a workflow token. This test fails without the base..head check.
  • New: a non-rate-limit 403 ejects only that PR as merge_refused, and the batch-mate stays queued. This test fails without the fix.
  • New: an allowed 403 that is a rate limit is waited out.
  • Changed: the existing scoping test reorders its PRs so a merge without a workflow token is still covered. A PR merged after a workflow PR now correctly gets workflow write.

Checks

  • just check passes.
  • Land, land-serve, land-apply and github tests: 198 passed.
  • Full vitest run with CLAUDE_CONFIG_DIR unset: 807 passed. The 6 failures are environment tests, the same ones that fail on main locally: gate admission, worktree disk, Ctrl-C, and the diff3 driver test. I confirmed the diff3 test fails on origin/main too.

Review

Codex gpt-6.1-sol, medium effort (quest review --base origin/main), session 01a1994a-73c5-7562-bf66-bda6a7b55656.

  • Round 1, head 637a1e4: one finding. Allowing 403 skipped the client's rate-limit wait. Fixed in 4d943a9: the client checks rate limits before allow.
  • Round 2, head 4d943a9408dc5ac69ac70a1de6a009f9ffd8fbdd: no findings.
  • Round 3, head bbf8ce96946d1f3a99c6f4f90e97a6af5d667aa0: no findings. This round reviewed widening the check to every commit the PR brings.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits November 1, 2026 14:45
…workflow change

GitHub refuses an App's merge of a PR whose commits touch .github/workflows.
The gate's own merge of a base that changed a workflow is such a commit, but
the merge token asked for workflow write only when the squash itself changed
one. #286 hit this, and the 403 failed the whole batch on every
retry, stalling the queue.

The merge token now also asks for workflow write when the prepared head
changes a workflow since the pinned head. Any other 403 from the merge
endpoint, except a rate limit, stops only that PR as merge_refused, so the
rest of the queue keeps landing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…atus

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 965323c7-fb2f-4c68-9ca4-ac69d3a446ca
Commits

Reviewing files that changed from the base of the PR and between 3b4e77c and bbf8ce9.

Files selected for processing: 5
  • README.md
  • src/cli/github.ts
  • src/cli/land-serve.ts
  • test/github.test.ts
  • test/land.test.ts
  • Autofix · 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

…ly the gate's merge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated enabled auto-merge (squash) November 1, 2026 22:55
@kixelated
kixelated merged commit 0bfeadc into main Nov 1, 2026
13 checks passed
@kixelated
kixelated deleted the fix/land-merge-workflows branch November 1, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant