Repository navigation
fix(request-review): read team seats and name a missing team - #77
Conversation
…el#75) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
rigel-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head 9c43d0d.
No merge blockers found. I'm approving.
What I checked and how
Checks. The head has one check run, check, which completed with success. That workflow (.github/workflows/check.yml) runs tests/run.sh, bin/generate --check, pinned ShellCheck 0.11.0 on plugins/setkernel/skills/request-review/*.sh and tests/run.sh, and the JSON validity step. So ShellCheck did run in CI, although the PR body says it was not run locally.
My local reruns on the head (9c43d0d):
bash tests/run.shprinted791/791 passed, exit 0. This includes the newok 781 - a missing team is named as missingandok 782 - another failure keeps gh's own message.bin/generate --checkprintedgenerated files are current, exit 0.
Acceptance criteria (#75):
- The script reads team
seats.request-review.sh:17now setsteam=seats, and that variable feedsorgs/$org/teams/$team/members.grep -rn engineeringfinds no other mention in the repo outside.git. - A missing team gives an error that names the team as missing, rather than blaming the scope. Lines 51–59 save gh's stderr to
$tmpd/err. A 404 now dies with "the team setkernel/seats does not exist (or this gh login cannot see it): …". Any other error dies with "cannot list the members of setkernel/seats: ". Theread:orgwording is gone. Tests 781 and 782 cover both paths.rr_prdeletes and recreates$rs, so thenoteam/noscopemarker files cannot leak into later tests. I also confirmed thatmktempand thetrapnow come before the call that uses$tmpd. - One run requests two seats on a test PR. I could only check this with the stub. The existing stub-gh test now serves
teams/seatsand still passes: "request-review asks the two least busy seats…" (zz-b and zz-c), with one POST per seat and the label added last. I have no GitHub access in this run, so I did not check it live, and neither did the PR (its body says so).
Correctness. Real gh prints gh: Not Found (HTTP 404) to stderr on a 404, the same text quoted in the issue. That means grep -q 'HTTP 404' matches the real output, not only the stub's. When gh fails it may print the error body to stdout, but that output goes into members only on the failure branch, where it is never used. An empty team now gets its own message. Callers are unchanged: the script's arguments, exit codes and success output are all the same.
Scope. The PR changes plugins/setkernel/skills/request-review/request-review.sh and its test in tests/run.sh, both named by the issue. SKILL.md does not name the team (I grepped it), so leaving it unchanged is correct.
Org rules. The diff has no secrets. Two existing test lines changed only to follow the rename (teams/engineering → teams/seats in the stub case and in the grep -v filter). Neither change weakens an assertion. This repo's CI has no test-diff guard, and I did not check whether any guard outside the repo applies.
Security. This is R1 (a skill script, nothing live), so I did no separate security pass. Nothing goes live when it merges.
Nits (non-blocking)
- The 404 test checks only the "does not exist" prefix. Asserting that the message also no longer mentions
read:orgwould protect the second criterion more directly.
orion-setkernel
left a comment
There was a problem hiding this comment.
Reviewed head 9c43d0d.
No merge blockers found. I reviewed head 9c43d0d against origin/main: plugins/setkernel/skills/request-review/request-review.sh (+11/-5) and tests/run.sh (+10/-2).
What I checked and how
Checks. The head has one check run, check. It completed with success. That workflow runs the tests, bin/generate --check, ShellCheck on request-review/*.sh and tests/run.sh, and the JSON check (.github/workflows/check.yml).
Acceptance criteria (#75)
- The script reads team
seats.request-review.sh:17is nowteam=seats, and that is the only place the team is set.grep -rn engineeringover the tree, excluding.git, finds nothing. - A missing team gives an error that names the team as missing, rather than blaming the scope.
request-review.sh:52-59saves gh's stderr. If that output containsHTTP 404, the script dies with "the team setkernel/seats does not exist (or this gh login cannot see it): gh: Not Found (HTTP 404)". Any other failure prints "cannot list the members of setkernel/seats: <gh's message>". Theread:orgblame is gone. I ranbash tests/run.shon the head:791/791 passed, includingok 781 - a missing team is named as missingandok 782 - another failure keeps gh's own message. - One run requests two seats on a test PR. This was checked only against the stub gh, not live, by the PR author or by me: neither run had GitHub access.
ok 763 - request-review asks the two least busy seats and prints them with the PR URLpasses with the stub servingorgs/setkernel/teams/seats/members. The issue says theseatsteam exists and that the hq gate already uses it. I did not confirm that.
Correctness. The script now runs mktemp/trap before the members call, so $tmpd/err exists when gh writes to it. die runs $(cat …) before it exits, and the EXIT trap still cleans up. On an HTTP error, gh may write the error body to stdout, which lands in members. The script ignores it because it only uses members when the call succeeds. Callers are unchanged: SKILL.md runs the script with the same arguments.
Scope. The PR touches only the script and its test, which the issue's "Files likely touched" names. SKILL.md does not name the team or read:org (grep finds nothing), so it rightly stays unchanged.
Org rules. The diff has no secrets. The test edit keeps every existing assertion. It renames the stubbed endpoint and the grep -v 'teams/seats' filter to the new team and adds two tests. Nothing is weakened or removed, and no allow-test-changes: line is needed as far as I can tell. The PR is R1, so I skipped the R2/R3 security pass.
Not checked: a live run against GitHub. I also did not run the suite under SHELL_UNDER_TEST=dash, because the sandbox refused that command.
Nits (non-blocking)
- The 404 check greps for the literal text
HTTP 404in gh's stderr. That works with today's gh message format, but it would quietly fall back to the generic message if gh rewords it. That is acceptable, since gh's own text is still printed either way. - After merge, one live
request-reviewrun on a throwaway PR would settle the third criterion for real. Note the result on #75.
Summary
request-review.shread the deleted teamsetkernel/engineering. It now readsseats. A 404 on the team now says the team does not exist (or this login can't see it) instead of blamingread:org; other failures report gh's own message.What changed
plugins/setkernel/skills/request-review/request-review.sh:team=seats; captures gh's stderr when listing members; a 404 gives "the team setkernel/seats does not exist (or this gh login cannot see it)"; any other error gives "cannot list the members of ...: "; an empty team gets its own message.tests/run.sh: the stub gh now servesteams/seats; two new tests (a 404 names the missing team; a 403 keeps gh's message).SKILL.mddoes not name the team, so it is unchanged.Tested
bash tests/run.sh: 791/791 passed.bin/generate --check: generated files are current.sh -non the script: ok.teams/seats.Closes #75