Found: schedule order's head_moved treats an open review bead as a Worker on the pull request #77

Merged
city-root merged 2 commits from worker/gascitypacks-n905 into main 2026-11-12 19:29:19 +00:00
Contributor

The schedule order's headMoved took any open bead of a pull request, other than the Operator's pr_event beads, for a Worker on it. A review bead (pr_url, review_head) is open while the pull request is under review, so no_worker was never raised for a pushed head that nobody works on.

  • schedule.go: headMoved now skips a bead that carries review_head, as the merge order does (gascitypacks-omd, #58, still open; this branch does not depend on it, the key is a literal).
  • schedule_test.go: TestScheduleHeadMovedWithOnlyAnOpenReviewBeadIsNoWorker makes a pull request with a closed bead for the old head and an open review bead, moves the head, and expects one no_worker bead for the Operator. It fails without the fix (no bead is raised) and passes with it.
  • .changelog/schedule-review-bead.md: the changelog note, as a fragment.

Verified: go test ./..., go vet ./... and gofmt -l in forgejo/assets/forgejo are clean.

Bead: gascitypacks-n905

Bead: gascitypacks-n905

The `schedule` order's `headMoved` took any open bead of a pull request, other than the Operator's `pr_event` beads, for a Worker on it. A review bead (`pr_url`, `review_head`) is open while the pull request is under review, so `no_worker` was never raised for a pushed head that nobody works on. - `schedule.go`: `headMoved` now skips a bead that carries `review_head`, as the merge order does (gascitypacks-omd, #58, still open; this branch does not depend on it, the key is a literal). - `schedule_test.go`: `TestScheduleHeadMovedWithOnlyAnOpenReviewBeadIsNoWorker` makes a pull request with a closed bead for the old head and an open review bead, moves the head, and expects one `no_worker` bead for the Operator. It fails without the fix (no bead is raised) and passes with it. - `.changelog/schedule-review-bead.md`: the changelog note, as a fragment. Verified: `go test ./...`, `go vet ./...` and `gofmt -l` in `forgejo/assets/forgejo` are clean. Bead: gascitypacks-n905 Bead: gascitypacks-n905
fix: schedule's headMoved skips an open review bead (gascitypacks-n905)
All checks were successful
test / changelog (pull_request) Successful in 4s
test / lint (pull_request) Successful in 22s
test / scripts (pull_request) Successful in 33s
ee4e389328
headMoved decides whether anyone works on a pull request whose head moved to one no bead holds. It skipped only beads that carry pr_event (the Operator's), and returned nil on any other bead of the pull request that is not closed. A review bead (pr_url, review_head, labels service and review) is open for as long as the pull request is under review, so no_worker was never raised while one existed.

A bead that carries review_head is now skipped too, as the merge order does (gascitypacks-omd). The key is a literal in schedule.go, so this branch does not depend on omd's constant.

Validation: the new TestScheduleHeadMovedWithOnlyAnOpenReviewBeadIsNoWorker fails with the fix removed (no bead for the Operator) and passes with it; go test, go vet and gofmt are clean for the package.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
city-root-review requested changes 2026-11-12 18:20:11 +00:00
Dismissed
city-root-review left a comment

Review of ee4e389328 for gascitypacks-n905. Checks of the head: success.

Verdict

fail

Findings

  • [blocking] README.md:273: the README's table of the schedule order's answers states the rule this change alters, and still states the old one: "When no bead of the pull request holds the pull request's head (every bead with its pr_url, except a bead made for the Operator, is closed and none has the head as its gc.work_commit) ...". After this change a review bead (one that carries review_head) is excepted too, so the README now says an open review bead hides no_worker, which is the bug being fixed. Fix: name the review bead in that parenthesis, e.g. "except a bead made for the Operator (pr_event) or a review bead (review_head)". The README is where this repository documents each order's rules, and the change log says the behaviour changed; the reference should not contradict it.
  • [minor] forgejo/assets/forgejo/schedule.go:499: o.meta("review_head") spells the key as a literal, but the constant metaReviewHead (checks_order.go:19, same package, already on main) is the one the checks and review orders use for exactly this test (revieworder.go:36-39 says so). The PR description gives the literal as a way to avoid depending on #58, but the constant is not #58's: it is on main now. o.meta(metaReviewHead) would keep one spelling of the key in the package.

Verified

  • Read the work bead (description, design, notes) and the PR description: the fix asked for is the one made, with a go test and a changelog fragment, and nothing unrelated.
  • Read the whole diff (3 files, +20 -2) and headMoved around it: skipping a bead with review_head before the Status != "closed" test is correct; Operator beads and Worker beads are handled as before.
  • Merged the head into origin/main (c82ad40) in a clone: clean, and the forge says mergeable.
  • On the merge result, with the city's variables removed: go vet ./..., go test ./... and go test -race ./... pass; gofmt -l forgejo roles is empty; gc lint . (2 packs ok); tests/formula.sh, tests/reviewer.sh, tests/operator-overlay.sh and every test of the scripts job pass.
  • Removed the fix (back to if o.meta(metaPREvent) != "") and ran go test -run TestScheduleHeadMoved: TestScheduleHeadMovedWithOnlyAnOpenReviewBeadIsNoWorker fails ("beads for the Operator: []"); with the fix it passes. The test does test the fix.
  • Built the changelog checker from sarak.sh/mikluko/changelog v2.1.0 (the version validate@v2 resolves to) and ran it with -base=main: exit 0; the fragment .changelog/schedule-review-bead.md is in the form of main's fragments (### Fixed, one entry).
Review of ee4e3893281804432f2f47b8fe837a10217a6c39 for gascitypacks-n905. Checks of the head: success. ### Verdict fail ### Findings - [blocking] README.md:273: the README's table of the `schedule` order's answers states the rule this change alters, and still states the old one: "When no bead of the pull request holds the pull request's head (every bead with its `pr_url`, except a bead made for the Operator, is closed and none has the head as its `gc.work_commit`) ...". After this change a review bead (one that carries `review_head`) is excepted too, so the README now says an open review bead hides `no_worker`, which is the bug being fixed. Fix: name the review bead in that parenthesis, e.g. "except a bead made for the Operator (`pr_event`) or a review bead (`review_head`)". The README is where this repository documents each order's rules, and the change log says the behaviour changed; the reference should not contradict it. - [minor] forgejo/assets/forgejo/schedule.go:499: `o.meta("review_head")` spells the key as a literal, but the constant `metaReviewHead` (`checks_order.go:19`, same package, already on main) is the one the `checks` and `review` orders use for exactly this test (`revieworder.go:36-39` says so). The PR description gives the literal as a way to avoid depending on #58, but the constant is not #58's: it is on main now. `o.meta(metaReviewHead)` would keep one spelling of the key in the package. ### Verified - Read the work bead (description, design, notes) and the PR description: the fix asked for is the one made, with a go test and a changelog fragment, and nothing unrelated. - Read the whole diff (3 files, +20 -2) and `headMoved` around it: skipping a bead with `review_head` before the `Status != "closed"` test is correct; Operator beads and Worker beads are handled as before. - Merged the head into origin/main (c82ad40) in a clone: clean, and the forge says `mergeable`. - On the merge result, with the city's variables removed: `go vet ./...`, `go test ./...` and `go test -race ./...` pass; `gofmt -l forgejo roles` is empty; `gc lint .` (2 packs ok); `tests/formula.sh`, `tests/reviewer.sh`, `tests/operator-overlay.sh` and every test of the `scripts` job pass. - Removed the fix (back to `if o.meta(metaPREvent) != ""`) and ran `go test -run TestScheduleHeadMoved`: `TestScheduleHeadMovedWithOnlyAnOpenReviewBeadIsNoWorker` fails ("beads for the Operator: []"); with the fix it passes. The test does test the fix. - Built the changelog checker from sarak.sh/mikluko/changelog v2.1.0 (the version `validate@v2` resolves to) and ran it with `-base=main`: exit 0; the fragment `.changelog/schedule-review-bead.md` is in the form of main's fragments (`### Fixed`, one entry).
mikluko force-pushed worker/gascitypacks-n905 from ee4e389328
All checks were successful
test / changelog (pull_request) Successful in 4s
test / lint (pull_request) Successful in 22s
test / scripts (pull_request) Successful in 33s
to 3936c85a7e
All checks were successful
test / changelog (pull_request) Successful in 4s
test / lint (pull_request) Successful in 22s
test / scripts (pull_request) Successful in 47s
2026-11-12 18:22:15 +00:00
Compare
city-root-review left a comment

Review of 3936c85a7e for gascitypacks-n905. Checks of the head: success.

Verdict

pass

Findings

  • [minor] PR description: it still says "the key is a literal", but since 3936c85 schedule.go:499 uses the constant metaReviewHead. It does not mention the README change, and it has the line "Bead: gascitypacks-n905" twice. Worth correcting when you next edit it. This does not block the merge.

Both findings of review 329 (head ee4e389) are fixed:

  • README.md:275: the head_moved row now names the review bead (review_head) next to the Operator's bead (pr_event), so it states the new rule.
  • forgejo/assets/forgejo/schedule.go:499: uses o.meta(metaReviewHead), the constant from checks_order.go:19, which the checks, merge and review orders use too.

Verified

  • Read the work bead (design and notes, rounds 0 and 1), the PR description and review 329. The diff (4 files, +21 -3) is the fix the bead asks for: a Go test, a changelog fragment and the README line. Nothing unrelated.
  • headMoved skips a bead that carries review_head before the Status != "closed" test, so an open review bead no longer hides no_worker. Operator beads and Worker beads are handled as before. README:287's statement about pr_event is still true.
  • Merged the head into origin/main (745749e) in a clone. The merge is clean, and the forge reports mergeable.
  • Ran these on the merge result with the city's variables removed: go vet ./..., go test ./... and go test -race ./... pass, and gofmt -l forgejo roles lists no files. gc lint . reports 2 packs ok. Every script of the lint and scripts jobs passes: formula, reviewer, operator-overlay, researcher, worktree-setup, worktree, gnu-tools, merge, handover, apply, upgrade, view-beads, view-mail, permission-deny and permission-request.
  • Put the condition back to if o.meta(metaPREvent) != "": TestScheduleHeadMovedWithOnlyAnOpenReviewBeadIsNoWorker fails ("beads for the Operator: []"). With the fix it passes, along with the other two TestScheduleHeadMoved* tests.
  • Built the changelog checker from sarak.sh/mikluko/changelog v2.1.0 (the tag v2 points to) and ran it with -base=main: valid=true, exit 0. The fragment has the same form as main's fragments (### Fixed, one entry).
Review of 3936c85a7ef51aeffa191c47e7e94ae78139877c for gascitypacks-n905. Checks of the head: success. ### Verdict pass ### Findings - [minor] PR description: it still says "the key is a literal", but since 3936c85 `schedule.go:499` uses the constant `metaReviewHead`. It does not mention the README change, and it has the line "Bead: gascitypacks-n905" twice. Worth correcting when you next edit it. This does not block the merge. Both findings of review 329 (head ee4e389) are fixed: - README.md:275: the `head_moved` row now names the review bead (`review_head`) next to the Operator's bead (`pr_event`), so it states the new rule. - forgejo/assets/forgejo/schedule.go:499: uses `o.meta(metaReviewHead)`, the constant from `checks_order.go:19`, which the `checks`, `merge` and `review` orders use too. ### Verified - Read the work bead (design and notes, rounds 0 and 1), the PR description and review 329. The diff (4 files, +21 -3) is the fix the bead asks for: a Go test, a changelog fragment and the README line. Nothing unrelated. - `headMoved` skips a bead that carries `review_head` before the `Status != "closed"` test, so an open review bead no longer hides `no_worker`. Operator beads and Worker beads are handled as before. README:287's statement about `pr_event` is still true. - Merged the head into origin/main (745749e) in a clone. The merge is clean, and the forge reports `mergeable`. - Ran these on the merge result with the city's variables removed: `go vet ./...`, `go test ./...` and `go test -race ./...` pass, and `gofmt -l forgejo roles` lists no files. `gc lint .` reports 2 packs ok. Every script of the `lint` and `scripts` jobs passes: formula, reviewer, operator-overlay, researcher, worktree-setup, worktree, gnu-tools, merge, handover, apply, upgrade, view-beads, view-mail, permission-deny and permission-request. - Put the condition back to `if o.meta(metaPREvent) != ""`: `TestScheduleHeadMovedWithOnlyAnOpenReviewBeadIsNoWorker` fails ("beads for the Operator: []"). With the fix it passes, along with the other two `TestScheduleHeadMoved*` tests. - Built the changelog checker from sarak.sh/mikluko/changelog v2.1.0 (the tag `v2` points to) and ran it with `-base=main`: valid=true, exit 0. The fragment has the same form as main's fragments (`### Fixed`, one entry).
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mikluko/gascitypacks!77
No description provided.