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

Review is owed from the check's green, not the preview's: a slow check queue lapsed every pull to a person tonight #1218

Closed opened this in answer to
Closed without merging

Review is now owed from the check's green, so a slow check queue no longer lapses a pull before a reviewer is asked. The new tests pass, but I couldn't run the HTTP-based test files in this sandbox. They fail with EPERM when they open a socket, so I haven't confirmed they pass.

Notes

stopped closed without shipping deploy 69ffc8f

opened this

Review is now owed from the check's green, so a slow check queue no longer lapses a pull before a reviewer is asked. The new tests pass, but I couldn't run the HTTP-based test files in this sandbox. They fail with EPERM when they open a socket, so I haven't confirmed they pass. The new file, test/review-route.test.ts's pure tests and the non-server cases in test/holds.test.ts do pass. I didn't run the type check, because tsc isn't installed here.

  • Where the clock starts: reviewAttempts in src/crew/review.ts now takes greenAt from the earliest ok check run on the head. A deploy counts only when the head has no check run at all, so a repository without a check behaves as before. The lapse and the wait are measured from greenAt.
  • Late send: a head that is past the lapse with no review sent is still sent once, up to one more lapse (60 min) after the lapse point. Its lapse clock then restarts from that send, so the late review gets its full window. waitsForPerson doesn't flag the pull while that send is due.
  • Inbox card: if a late review then lapses, the card reads "review ran late: the check took N min, and the reviewer did not answer, since …" (src/web/studio/asks.ts). N is the time from the check being queued to its green.
  • Tick log: the sweep logs one line for each pull it skips, such as review: lapsed since 04:13 or review: waiting on juniper.
  • Tests: test/review-from-check.test.ts covers three cases:
    • A deploy green at t=0 and a check green at t=70 sends review at t=70.
    • A head with no check and a green deploy behaves as before.
    • A late send is not flagged to a person while it is out, and shows the late card text if it lapses.

Left out

  • "Late" isn't stored anywhere. It is worked out from the run table by comparing when the first review run was queued with when the check went green, so there is no migration.
  • A head still unsent more than 2 h after green is treated as lapsed rather than retried each tick. This stops an unsent review (for example one blocked by the spend ceiling) from holding a pull forever.

To try it, run bun test test/review-from-check.test.ts.

Closes #1216

2 earlier comments
commented

Carried upstream as it is: Forgejo trevato-apps/forge #29 (commit 69ffc8f8 cherry-picked onto upstream main, plus the gate-list line for the new test). The runner there is idle while this forge's check lane holds 25 pulls, so the fix reaches 0.7.66 in about an hour and then rescues this queue. This pull stays open until the fork takes the update; it closes as done upstream then.

commented

Review is now owed from the check's green, not the preview's. A slow check queue had lapsed every pull to a person. A head that has lapsed is sent once, late, and the tick now says why it skips.

No further changes on this branch in response to the feedback. The cherry-pick upstream (Forgejo trevato-apps/forge #29) adds a gate-list line for the new test. I haven't made that edit here, because upstream's tree is where that list lives. If this fork should carry the line before it takes 0.7.66, say so and I'll add it.

This pull stays open until the fork takes the update, then closes as done upstream.

To try it, run bun test. The new tests cover review being owed only after the check is green, and the late single send for a lapsed head.

🤖 Generated with Claude Code

commented

Landed upstream as #29 (0.7.66) and live or building there; closing here so the lane is not spent on a copy. The fork takes it with the next update from parent.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs