Skip to content

Commit 6668b3d

Browse files
cliffhallclaude
andcommitted
fix(issue-triage): fail-closed snapshot steps, step 0 temp dir, '#' in manifest issues
Copilot round 7 on #4906: - the maintainer list is captured before jq, so a failed page fails the step - the pre-class count runs only on a successful pre-class - step 0 creates the run's temp dir and says to materialize the response first - the close loop accepts '#123' as well as '123' in the issue column Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: cliffhall <cliff@futurescale.com>
1 parent e79db4c commit 6668b3d

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

‎.claude/skills/issue-triage/SKILL.md‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ one, list them with their classes for a maintainer to confirm, and go on with
8181
pass 1 for the rest meanwhile.
8282

8383
```sh
84-
# Close as not planned, with the class's response (body in a file, so quoting is
84+
# The run's temp dir; create it once, before the first close, and reuse it.
85+
D=${D:-$(mktemp -d)}
86+
# Copy the class's response from Canned responses into "$D/response.md" (the
87+
# text inside the quote, with #ORIGINAL or the SDK link filled in) first.
88+
# Close as not planned, with that response (body in a file, so quoting is
8589
# safe). An empty or missing response stops here instead of closing silently.
8690
BODY=$(cat "$D/response.md") && [ -n "$BODY" ] \
8791
&& gh issue close <N> --repo modelcontextprotocol/servers --reason "not planned" --comment "$BODY" \
@@ -310,9 +314,12 @@ gh pr list --repo $R --state open --limit 2000 \
310314
> "$D/prs.json"
311315
jq -e 'length < 2000' "$D/prs.json" >/dev/null \
312316
|| { echo "PR listing truncated or failed — raise --limit" >&2; rm -f "$D/prs.json"; }
313-
gh api "repos/$R/collaborators?per_page=100" --paginate \
314-
--jq '[.[] | select(.role_name=="admin" or .role_name=="maintain") | .login]' \
315-
| jq -s 'add' > "$D/maintainers.json" || rm -f "$D/maintainers.json"
317+
# Captured first, so a failed page fails the step instead of yielding a short
318+
# list that would turn maintainers into outside authors.
319+
RAW=$(gh api "repos/$R/collaborators?per_page=100" --paginate --slurp) \
320+
&& jq '[.[][] | select(.role_name=="admin" or .role_name=="maintain") | .login]' \
321+
<<<"$RAW" > "$D/maintainers.json" \
322+
|| { echo "maintainer list failed" >&2; rm -f "$D/maintainers.json"; }
316323
# A first-guess class from the paths alone. It is a HINT for the reading below,
317324
# never the manifest: a "server change" can be a no-op, a racing duplicate or a
318325
# security fix, and only reading the diff tells which.
@@ -326,8 +333,9 @@ jq -r --slurpfile m "$D/maintainers.json" '
326333
elif ($p | any(startswith("src/"))) then "server-change?"
327334
else "repo-level?" end) as $c
328335
| [.number, $c, ([.closingIssuesReferences[].number] | map("#\(.)") | join(" ")), .title[0:70]]
329-
| @tsv' "$D/prs.json" > "$D/pre.tsv"
330-
cut -f2 "$D/pre.tsv" | sort | uniq -c
336+
| @tsv' "$D/prs.json" > "$D/pre.tsv" \
337+
&& cut -f2 "$D/pre.tsv" | sort | uniq -c \
338+
|| { echo "pre-class failed (a missing input above?)" >&2; rm -f "$D/pre.tsv"; }
331339
```
332340

333341
`gh pr list` stops early without saying so, so a listing that fills its limit
@@ -403,6 +411,7 @@ it.
403411
# on a routine pass.
404412
SWEEP_LABEL=; SWEEP_REF=
405413
while IFS=$'\t' read -r PR CLASS ISSUE _; do
414+
ISSUE=${ISSUE#\#} # accept "#123" as well as "123"
406415
case "$CLASS" in
407416
listing|new-server) BODY=$(cat "$D/responses/registry.md") ;;
408417
archived) BODY=$(cat "$D/responses/archived.md") ;;

0 commit comments

Comments
 (0)