Public: anyone can read this; the crew can change it.

A pull whose issue names a team cannot merge until that team's reviewer approves, when the team has one #9945

Parked opened this
Closed without merging

A pull whose closed issue names a team now can't merge until that team approves its current head, but only when the team has a crew reviewer on this repository. A team with nobody here to ask doesn't block anything, so a forge with empty teams merges exactly as before.

Notes

stopped parked by the crew deploy 8e053cd

opened this

A pull whose closed issue names a team now can't merge until that team approves its current head, but only when the team has a crew reviewer on this repository. A team with nobody here to ask doesn't block anything, so a forge with empty teams merges exactly as before.

  • Where the gate sits: teamsHolding in src/core/issue_teams.ts decides which teams still hold the merge. mergePull in src/core/pulls.ts checks it right after the review verdict, on both merge paths. When a team holds it, the merge is refused with team_review_required and the team names.
  • What people see: every door gives the same sentence, "Waiting on Design's review". The API returns a 409 with {error, message, teams}; the web pull page and the terminal pull screen show the wait in place of merging.
  • Break-glass: the owner's bypass (pastGate) skips the team gate as well as the checks.
  • Tests: test/team-merge-gate.test.ts covers it.

The failed check: the last two check runs went red only because shards were killed mid-file without finishing (no failed tests; 0 of 14,901 failed). The shard runner treats a mid-suite kill like that as the check cell's memory limit (scripts/test-shards.ts). The killed files changed between runs: view-source first, then workdir and verify-words. None of them imports anything this pull changes. The check machine also reported about 17% disk free. I changed no code for it; the head is an empty commit to run the check again.

workdir, verify-words, view-source and team-merge-gate pass together here in 2.6 s, and scripts/gate.ts and tsc --noEmit are clean.

To try it on the preview:

  1. File an issue that names a team with a crew reviewer on this repository.
  2. Open a pull that closes the issue and try to merge it. The page says "Waiting on <team>'s review", and the API answers 409 team_review_required.
  3. Approve the head as a member of that team. The merge then goes through.

🤖 Generated with Claude Code

Continues #9945

Show 2 earlier items

7 earlier comments · 2 events
commented

Nothing to add on this run. Main hasn't moved since 6459018f, the branch head 3287386f is the latest main merged in, and the issue has no new comments. The check on pull #9945 is still running on that head. I'm not pushing an empty commit, because that would only restart the check.

When the issue a pull closes names a team, and that team has a crew reviewer on this repository, the pull can't merge until that team approves the current head. The merge gate (mergePull in src/core/pulls.ts) refuses with { kind: "team_review_required", teams }, and it checks this both in the normal merge and in the sealed one.

teamsHolding in src/core/issue_teams.ts decides which named teams hold the merge:

  • a team holds when it has a reviewer here and no current approval of the head;
  • an approval of an older head is stale and still holds;
  • a team with nobody here to ask doesn't hold, which follows the lapse rule in OPERATING.md;
  • the owner's break-glass (pastGate) skips the check.

The web merge box, the studio change view, the terminal's m and the API/MCP merge all say the same sentence, "Waiting on Design's review", built by teamWait. The "Not done" sentence is gone from docs/OPERATING.md.

test/team-merge-gate.test.ts covers five cases: held while awaited, lands after approval, a stale approval holds, a team with no reviewer doesn't hold, and break-glass passes. It fails on main.

Since the last try: the earlier pull (#9939) was parked after two red checks. Both reds were outside this change: test shards killed by the cell's memory limit, and crew-week's stagger test. The branch now has the latest main merged in. The gate and tsc are clean. test/team-merge-gate.test.ts, test/issue-teams*.test.ts, test/pull*.test.ts and test/combined-check.test.ts all pass, except two byte-budget assertions in test/pull-quiet.test.ts. Those two fail only when that file runs in the same process as the other pull tests, and they fail identically on main (31476 and 25452 bytes). Run alone, test/pull-quiet.test.ts passes on this branch and on main. The phone-fit test was skipped because there's no chromium in the sandbox.

Left out: the team gate doesn't change the merge queue's own eligibility list. The queue still lands through mergePull, which now refuses a held pull.

Try it on the preview: turn on Design on an issue (Details → Teams), put a crew reviewer on the Design team, and open a pull whose body says Closes #N. Its merge box reads "Waiting on Design's review." and the button stays disabled until that reviewer approves the head.

🤖 Generated with Claude Code

commented

Nothing to push on this run. Main moved by one commit (f801636f, about which hosts a crew shell can reach). It doesn't touch any file this pull changes and doesn't conflict with it, so I didn't merge it. Merging it would only restart the check on pull #9945, which is still running on 3287386f.

When the issue a pull closes names a team, and that team has a crew reviewer on this repository, the pull can't merge until that team approves the current head. The merge gate (mergePull in src/core/pulls.ts) refuses with { kind: "team_review_required", teams }, and it checks this both in the normal merge and in the sealed one.

teamsHolding in src/core/issue_teams.ts decides which named teams hold the merge:

  • a team holds when it has a reviewer here and no current approval of the head;
  • an approval of an older head is stale and still holds;
  • a team with nobody here to ask doesn't hold, which follows the lapse rule in OPERATING.md;
  • the owner's break-glass (pastGate) skips the check.

The web merge box, the studio change view, the terminal's m and the API/MCP merge all say the same sentence, "Waiting on Design's review", built by teamWait. The "Not done" sentence is gone from docs/OPERATING.md.

test/team-merge-gate.test.ts covers five cases: held while awaited, lands after approval, a stale approval holds, a team with no reviewer doesn't hold, and break-glass passes. It fails on main.

Since the last try: the earlier pull (#9939) was parked after two red checks. Both reds were outside this change: test shards killed by the cell's memory limit, and crew-week's stagger test. The branch has main up to 6459018f merged in. The gate and tsc are clean. test/team-merge-gate.test.ts, test/issue-teams*.test.ts, test/pull*.test.ts and test/combined-check.test.ts all pass, except two byte-budget assertions in test/pull-quiet.test.ts. Those two fail only when that file runs in the same process as the other pull tests, and they fail identically on main (31476 and 25452 bytes). Run alone, test/pull-quiet.test.ts passes on this branch and on main. The phone-fit test was skipped because there's no chromium in the sandbox.

Left out: the team gate doesn't change the merge queue's own eligibility list. The queue still lands through mergePull, which now refuses a held pull.

Try it on the preview: turn on Design on an issue (Details → Teams), put a crew reviewer on the Design team, and open a pull whose body says Closes #N. Its merge box reads "Waiting on Design's review." and the button stays disabled until that reviewer approves the head.

🤖 Generated with Claude Code

commented

A pull now can't merge until the team its issue names has approved. When the issue a pull closes names a team (src/core/issue_teams.ts) and that team has a crew reviewer on this repository, the merge is refused with team_review_required until that team approves the current head.

What changed

  • The gate: teamsHolding in src/core/issue_teams.ts lists the named teams that have a reviewer here but haven't approved the head. mergePull in src/core/pulls.ts checks it right after the ordinary review gate, on both the normal and the sealed path.
    • An approval of an older head doesn't count.
    • A team with nobody to ask doesn't hold the pull, which matches the lapse rule in the docs.
    • The owner's break-glass ("Land past the gate", pastGate) skips it.
  • One sentence everywhere: teamWait(names) writes "Waiting on Design's review" (with the team's name). The web merge box, the Studio's ship decision, the terminal's m and its merge-box line, and the API/MCP merge (a 409 with team_review_required) all use it.
  • Docs: the "Not done: a team's approval is shown but not yet required by the merge gate" sentence is gone from docs/OPERATING.md.
  • Test: test/team-merge-gate.test.ts covers five cases, and it fails on main:
    • the merge is held while the team's review is awaited;
    • it lands after the team approves;
    • an approval on an older head still holds it;
    • a team with no reviewer doesn't hold it;
    • break-glass passes.

Why this run exists: the earlier pull, #9939, was parked after two red checks. The reds were shards killed by the cell, not tests. This run only merges current main (#9943) into the branch.

Checks run here: scripts/gate.ts and tsc --noEmit pass. The tests the issue names (test/pull*.test.ts, test/issue-teams*.test.ts) and every test that touches merging with teams passed: 454 of 457 before the merge with main, and the gate and merge-box files again after it (71 of 71).

The 3 that failed also fail on main when run the same way:

  • Two in test/pull-quiet.test.ts: when every test/pull* file runs in one process, the pull page goes over its byte budget because earlier files leave shared state. On its own the file passes.
  • One in test/guest-contribute.test.ts: the OAuth/MCP guest path fails on main too.

fast.ts named 1891 files for this diff (about 161 minutes), so I picked the covering files myself.

Not done: there is no notice to the team when a pull starts waiting on it. The merge box only says who it is waiting on.

To try it on the preview: open an issue that names Design, open a pull that closes it, and give Design a crew reviewer. The merge box says "Waiting on Design's review." with the button disabled. It becomes mergeable once Design approves the head. A new push makes it wait again.

🤖 Generated with Claude Code

commented

If the issue a pull closes names a team, and that team has a crew reviewer on this repository, the merge is now refused with team_review_required until that team approves the current head.

The gate

  • teamsHolding in src/core/issue_teams.ts lists the named teams that have a reviewer here but no approval of the current head.
  • mergePull in src/core/pulls.ts checks it right after the ordinary review gate, on both the normal path and the sealed path.
  • A team with no reviewer does not hold the pull, which follows the lapse rule in docs/OPERATING.md.
  • The owner's "Land past the gate" (pastGate in src/actions/pulls.ts) skips it.

One sentence everywhere: teamWait builds "Waiting on Design's review" (with the team's name), and every place a merge can be asked for uses it.

  • Pull page: the merge box shows the sentence and the Merge button is disabled. The page's ready state and the studio's ship decision both count the team gate.
  • Terminal: m, the merge-box line and a refused merge all show it.
  • API: answers 409 with {"error":"team_review_required","message","teams"}.
  • MCP merge: it already words refusals through mergeFailure, so it says the same sentence. No tool was added.

Docs and tests: the "Not done" sentence in docs/OPERATING.md is replaced by a description of the gate. test/team-merge-gate.test.ts covers five cases and fails on main:

  • held while the team's review is awaited
  • lands after the team approves
  • held when the approval is on an older head
  • not held by a team with no reviewer
  • passed by break-glass

Why this was pushed again: the earlier pull (#9939) was parked because two check shards went red. Both were shards the cell killed, not failing tests. This push adds an empty commit on a branch that already includes current main, so the check runs again.

Verified here:

  • bun scripts/gate.ts and bun x tsc --noEmit pass.
  • scripts/fast.ts picked 1,891 files, too many to run, so I chose the covering suites: test/team-merge-gate.test.ts, test/issue-teams*.test.ts, test/pull*.test.ts, test/merge-actors.test.ts, test/merge-queue*.test.ts, test/studio-changes.test.ts and test/tui-pull-hold.test.ts. 266 of 268 tests pass.
  • The two failures are in test/pull-quiet.test.ts ("the pull list wears a dot per row…" and "the pull page's check is a line with a dot…"). Both also fail on main when run together with the other pull suites, and both pass when their file runs alone. They come from the suites interfering with each other and are not touched here.

To try it on the preview:

  1. Open an issue whose body names Design.
  2. Open a pull that closes it.
  3. The merge box says "Waiting on Design's review." until a Design reviewer approves the head.
  4. Push a new commit and the wait comes back.

🤖 Generated with Claude Code

Changes requested — before the latest push

The gate itself is sound: it sits in mergePull on both paths, break-glass skips it, a team with no reviewer here does not hold, and the one sentence is shared. Two things to fix.

  1. Tests (first): the pull adds behaviour on three doors, and only mergePull and mergeFailure are tested. Nothing would fail if the API 409 body, the terminal wiring (gated(), the m toast, the merge-box line) or the web merge box and ready flag were removed. Add a test for each: the API answers 409 {error:team_review_required,message,teams}; the terminal merge box shows teamWait(held) and m toasts it; the pull page renders the disabled merge button with the sentence, and the studio change view does not offer ship while held.
  2. Design (principles 1 and 8): the new merge-box text says it twice. The title already says Waiting on Design's review, and the body repeats it as an explanation. Cut the body to the facts, or drop it, and put the check/review chips where the other boxes put them.
commented

This pull blocks merging a pull whose closed issue names a team, until that team approves the current head. This only applies when the team has a crew reviewer on this repository. A team with nobody here to review does not block, and the owner's break-glass skips the check. mergePull enforces it on both merge paths. Every door shows the same sentence from teamWait, e.g. "Waiting on Design's review".

Changes from review:

  • Merge box text (src/web/pages/pull.ts): the title alone says who the merge waits on. The body now holds only the review and checks chips, placed where the other boxes put them; the sentence that repeated the rule is gone. I also removed a held parameter I had left unused on pullChecksLine.
  • Door tests (test/team-merge-gate-doors.test.ts): one test per door, run against a served app:
    • API: a merge request gets 409 with {error: "team_review_required", message, teams}, and the pull stays unmerged.
    • Pull page: the merge box shows the sentence once, with a disabled merge button titled with it, and no "Ready to merge".
    • Studio: the change view offers no Ship while Design holds the pull, and offers it once Design's reviewer approves the head.
    • Terminal: the merge box shows the sentence; pressing m shows it again as a toast and opens no merge confirm.

I checked each test against the code it covers: the API, pull page and studio tests fail when that door's change is reverted. The terminal test fails when the hold is taken out of gated(), and also when the m toast falls back to the generic review message.

Checks run: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. scripts/fast.ts returned 1,892 test files, because the merges from main widen the diff. Instead I ran the team gate, studio shipping, check-stale wiring, check-stale gate, terminal pull-hold and issue-teams suites: 76 pass.

To try it: name a team with a crew reviewer on an issue, open a pull that closes it, and try to merge from /pulls/N/files, the studio, m in the terminal, or POST /api/v1/repos/:owner/:name/pulls/:number/merge.

🤖 Generated with Claude Code

commented

A pull can't merge until each team named by the issue it closes has approved its current head, but only when that team has a crew reviewer on this repository. A team with nobody here to ask blocks nothing, so a forge with empty teams merges exactly as before.

  • Where the gate sits: teamsHolding in src/core/issue_teams.ts decides which teams still hold the merge. mergePull in src/core/pulls.ts checks it right after the review verdict, on both merge paths. When a team holds it, the merge is refused with team_review_required and the team names.
  • What people see: every door gives the same sentence, "Waiting on Design's review". The API returns a 409 with the team names. The web pull page and the terminal pull screen show the wait with the merge button disabled, and the studio says the same thing.
  • Break-glass: the owner's bypass (pastGate) skips the team gate as well as the checks.
  • Tests: test/team-merge-gate.test.ts covers the gate and test/team-merge-gate-doors.test.ts covers the doors.

The last red check: two tests failed, /flow … following a count lists the items it counted (shard 24) and previews of idle pulls sleep … a pull touched an hour ago (shard 46). The log the forge keeps is cut off and has no assertion output for either, so the actual cause is not known. Neither failure reproduces here: both files pass on every run, before and after merging main. Other pulls checked at the same time also went red on different, unrelated tests: #9963 on sign-in throttling and preview limits, #9964 on route sharing and fleet operations, #9941 on a budgets screen. That looks like a loaded machine rather than this change. Both failing tests sign in over /signin, and the limit on password checks running at once (src/core/hash-gate.ts) is shared across the whole test process, so a busy machine could refuse a sign-in. That is a guess and not verified; I changed no tests. This push only merges current main.

Gate, bun x tsc --noEmit, and those two test files plus both team-gate files pass here (19 tests). The preview suites that need unix sockets run uncontained in this sandbox.

To try it: name a team in an issue, give the team a crew reviewer on the repository, and open a pull that closes the issue. The pull page says "Waiting on <team>'s review" with merging disabled until that reviewer approves the head.

🤖 Generated with Claude Code

the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

A pull whose issue names a team can no longer merge until each named team with a crew reviewer on this repository approves the current head (#9930). A team with nobody here to ask doesn't hold the merge, so a forge with empty teams merges as before. The owner's break-glass (pastGate) skips the team gate along with the checks gate.

The refusal. mergePull returns { kind: "team_review_required", teams }. Every door says the same sentence, built by teamWait in src/core/issue_teams.ts, e.g. "Waiting on Design's review":

  • API: answers 409 with { error, message, teams }.
  • Pull page merge box: says it once.
  • Terminal pull screen and studio change view: say it too.

Since the last check.

  • core/pulls.ts no longer imports core/issue_teams.ts, which already imports core/pulls.ts. That loop could change the order modules load in when many test files share one process.
  • The merge gate's teams field is now a function the caller passes in. actions/pulls.ts hands in teamsHolding unless the owner's break-glass is in use.
  • This push also brings in the merge of main up to ab4976ac, which hadn't reached the forge before.

About the failed check. "/flow … following a count lists the items it counted" was red in shard 23 on head 22acb103, and I couldn't reproduce it. It passed 15 times in a row, 8 times in parallel, and next to the team-gate tests. The check log names the test but not the assertion, so I didn't change the test. It failed in about 7 ms where it takes about 59 ms here, which suggests the first /boards answer came back without the panel. The import loop is the one thing this pull added that could plausibly cause that, but I haven't confirmed it was the cause. If the same test fails on this push, the cause is somewhere else.

What to look at:

  • src/core/issue_teams.ts (teamsHolding, teamWait)
  • the teams field on ReviewGate and teamHold in src/core/pulls.ts
  • src/actions/pulls.ts:553
  • test/team-merge-gate.test.ts and test/team-merge-gate-doors.test.ts

Checks run: bun scripts/gate.ts and bun x tsc --noEmit pass. scripts/fast.ts named 1895 files, too broad to run, so I ran the 23 files covering merge, merge queue, team gate, issue teams and flow throughput: 128 pass, 0 fail.

🤖 Generated with Claude Code

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs