gc forgejo pr comment: one call to comment on a pull request #62
No reviewers
Labels
No labels
No milestone
No project
No assignees
3 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/gascitypacks!62
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-pce"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds
gc forgejo pr comment --repo <worktree> --pr <url|number> --body-file <path>: one call posts one comment on a pull request as the account of the token, and--jsonprints the comment's id and URL (HQ root-i0s, item 5).POST /repos/{o}/{r}/issues/{n}/comments. An empty body is refused with exit 2 before any request; a missing pull request exits 7 and a foreign one 8, as the other commands do; a forge answer that is not a 201 or names no comment is a failure (exit 1).comment.go; the fake forge gets one route and one field inmain_test.go, its handler is incomment_test.go(11 tests).worker-reworkskill's Part 6 bullet carries thepr commentblock, to run in the same Bash call as Part 6'spr openblock (which sets$PR_URL), and the Worker's skill says a comment on a pull request is one call. The formula is main's, unchanged: since #60 its step is 7,998 of the 8,000 characterstests/formula.shallows. The repo held no rawcurlfor a comment (the Reviewer reads the forge withcurland posts only throughpr review).help.mdfor the command; changelog fragment.changelog/pr-comment.md. No new shell: the command'srun.shis the one-line wrapper.Rebased onto main (
d41dd39) in review round 2; README.md and main.go keep main'srevieworder andreview taketext and addpr comment.Checked at this head, with the city's variables removed:
go vet,go test ./...,go test -race -run PRComment, every script intests/,gc lint ., and the changelog v2 checker.Bead: gascitypacks-pce
The factory review of 2026-11-12 (HQ root-i0s, item 5) counted 99 raw curl calls in a day for the Worker's handover, and asked for one command to comment on a pull request. `pr comment --repo <worktree> --pr <url|number> --body-file <path>` reads the pull request first (so a number naming a plain issue gets no comment, and a missing or foreign one is refused with the tool's exit statuses 7 and 8), then posts POST /repos/{o}/{r}/issues/{n}/comments and prints the comment's URL, or with --json its id and URL. An empty body is refused with exit status 2 before any request. A forge answer that is not a 201 or names no comment is a failure. The Go is in a file of its own, comment.go, with a handler added to the fake forge in comment_test.go. The Worker's formula gets step 3a in Part 6: on rework it posts the "Rework done, head ..." note with the command. The repo held no curl for a comment (the Reviewer's formula reads the forge with curl and posts only reviews, through `pr review`), so the formula and the skill now say that a comment goes through the command. Validation: go vet and go test ./... in forgejo, bash tests/*.sh, gc lint ., and the changelog v2 checker. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>Review of
a5dc56ce59for gascitypacks-pce. Checks of the head: failure (test / lintfailed;scriptsandchangelogpassed).Verdict
fail
Findings
tests/formula.sh:136fails with "gc bd show prints about 28730 characters of the step, past the 28000 a Worker's Bash call keeps below its 30000 limit". This is the lint job's failure (run 171, joblint), and I reproduced it locally on the head and on the head merged into main; main alone passes. The step needs to lose at least ~730 characters. You could shorten 3a: one sentence and the three-line block are enough, and "Post no comment on a pull request any other way" repeats what the Worker's skill now says. Or you could trim prose elsewhere in the step, as the Part 1 change recorded in CHANGELOG.md did.be97be3). Both files conflict with #78 (handover order) and #79 (order checks), which landed after the branch was cut, and the forge reportsnot_mergeable. Rebase onto current main and keep both sides. In the README rows, keep main'shandoverorder, itschecksorder and "for each rig and for the city's own repository", and addpr comment. In main.go, the usage error should listpr comment,order merge,order checksandorder schedule, and the package comment should keep main'sorder checkssentence.$PR_URL, which is set only by step 3's block. A Worker that runs 3a in a new Bash call gets exit 2 ("needs --pr") and, under the step's own rule, halts. Step 4 already relies on the same carry-over, so this is not new. Still, putting 3a's block in the same call as step 3, or saying so in the text, would remove the trap.Verified
curlposts a PR comment on the head or on main; the onecurl -X POSTin roles/ ispermission deny's, which does not post a comment./issues/{n}/comments, and treating an answer that is not 201 or names no comment as a failure. All of it matches the README and help.md. The tests in comment_test.go check what they claim (no request on an empty body, none on a foreign--pr, token kept from other hosts, each forge failure).go vet ./...ok,go test ./...ok,go test -race -run PRCommentok,bash tests/reviewer.shok,bash tests/formula.shFAIL (above). Merged into origin/main: conflicts in README.md and forgejo/assets/forgejo/main.go;tests/formula.shon the merged tree fails the same way.a5dc56ce59f387787bffRework done, head
f387787bff. Round 1 findings:pr openand on not waiting for CI is shorter (the sentence tests/formula.sh looks for stays).tests/formula.shpasses.c06effd), keeping main'shandoverandchecksorders and the "for each rig and for the city's own repository" wording, and addingpr commentto the README rows, the usage error and the package comment. The forge reports the pull request mergeable.$PR_URL: 3a now says it runs in the same Bash call as step 3, which sets it.Also run at this head:
go vet,go test ./..., every script in tests/ underenv -i, andgc lint ..Review of
f387787bfffor gascitypacks-pce. Checks of the head: success.Verdict
fail
Findings
0e49d7c), and the forge reportsnot_mergeable. The round fixed the size budget against the old main but did not rebase. Main has moved 9 commits since the merge basec06effd. Besides #78 and #79, it now has #58 (therevieworder andreview take) and #60 (the Worker's step cut under 8,000 characters). Rebase onto current main. In the README row, keep main's text, including "therevieworder (the tool'sorder review, off the same way)", and addpr comment. In main.go, the package comment keeps main'sreview take/order reviewsentences and adds "posts a comment on it". The usage lists bothpr commentandreview take. The error reads "expectedpr open,pr state,pr merge,pr review,pr comment,review take,order merge,order checks,order scheduleororder review". I resolved these two files that way in my clone:go vet,go test ./...andgo test -race ./...pass on the merged tree.tests/formula.sh:148's 8,000 limit, and the test says to move text out, never to raise the number. I added a one-paragraph version of 3a to main's Part 6 and it measured 8,243 (FAIL: the step is 8243 characters). The rework note is something only some runs need, so it belongs inroles/agents/worker/skills/worker-rework/SKILL.md, which the step already loads for a bead withmetadata.pr_url. Extend its "Part 6 is the same" bullet with thepr commentblock, and say there that it runs in the same Bash call as Part 6'spr openblock, since that block sets$PR_URL. Leave the step on main as it is.worker-reworkskill.Verified
tests/formula.shok at the head), and the$PR_URLtrap is addressed in the text. The rebase was not done.curlposts a comment on main or on the head; the onlycurl -X POSTin roles/ ispermission deny's.go vet ./...ok,go test ./...ok,go test -race -run PRCommentok,bash tests/formula.sh,tests/reviewer.shandtests/operator-overlay.shok. The head's CI checks: success.tests/reviewer.shandtests/operator-overlay.shpass, andtests/formula.shfails on the 8,000 limit as above. On main alone,tests/formula.shpasses at 7,998.gc lint .or the changelog checker locally; both passed in the head's CI. There is no REVIEW.md, AGENTS.md or CLAUDE.md on main.f387787bff6f0aeba5eaRework done, head
6f0aeba5ea. Round 2 findings:d41dd39); README.md and main.go keep main's review order and review take text and add pr comment, as the review resolved them. The formula is main's, unchanged.Run at this head with the city's variables removed: go vet, go test ./..., go test -race -run PRComment, every script in tests/, gc lint ., and the changelog v2 checker.
Review of
6f0aeba5eafor gascitypacks-pce. Checks of the head: success.Verdict
pass
Findings
gc forgejo pr comment, but theworker-reworkskill and the formula use the binding (gc <forge>/{{forge}}), because a rig can bind the pack under another name. Writinggc <forge> pr comment …here, asworker-reworkdoes, would keep the two the same. Not blocking:forgejois the default and the only binding in use.Verified
d41dd39and merges into current main (62ca905) without conflict; the forge saysmergeable. README.md and main.go keep main'srevieworder andreview taketext and addpr comment, and the usage error lists every command. (2)roles/formulas/mol-worker-work.tomlis untouched. The rework note is inworker-rework's "Part 6 is the same" bullet, run in the same Bash call as Part 6'spr openblock, which sets$PR_URL(formula line 174 on main). (3) The worker skill and.changelog/pr-comment.mdpoint at theworker-reworkskill.--pr), postsPOST /repos/{o}/{r}/issues/{n}/comments, and treats any answer other than a 201 naming an id and an html_url as a failure (exit 1, nothing on stdout). The README section, help.md and run.sh (a one-line wrapper, no new shell logic) match it. The 11 tests in comment_test.go test what they claim against the fake forge.curlposts a comment in roles/ or forgejo/ on the merged tree. The onlycurl -X POSTispermission deny's, and the Reviewer's formula usescurlonly to read.go vet ./...ok,go test ./...ok,go test -race ./...ok. Every script intests/passed (formula, reviewer, operator-overlay, worktree-setup, worktree, gnu-tools, merge, handover, apply, upgrade, view-beads, view-mail, permission-deny, permission-request).gc lint .passed (2 packs ok).-base=main:valid=true.