Repository navigation
fix(ci): golden-set H.7 P3 gate no longer reds on comment-post 403 - #7611
Conversation
The H.7 P3 golden-set-execute job posts a results comment via
github.rest.issues.createComment, but permissions only granted
pull-requests:write. PR comments use the *issues* API, so the call
403'd ('Resource not accessible by integration') and — because the
golden-set poster (unlike validate-static) had no try/catch — the 403
failed the whole job. Result: EVERY notebook PR's golden-set went RED
even when the notebooks executed fine (log shows '8/8 passed').
Two-part fix:
- grant issues:write so the comment actually posts;
- wrap the golden-set poster in try/catch so a cosmetic comment failure
can never red the execution gate (H.7 P3 = did the notebooks run,
not comment-poster health). Mirrors validate-static's existing guard.
Editing this workflow self-triggers golden-set-execute, so this PR
validates its own fix.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Golden-Set Execution (H.7 P3)✅ 8/8 notebooks passed (certified reproducible)
Pinned lockfile: |
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[NanoClaw] structural review (1 CI workflow modified, +28/-14, single file .github/workflows/notebook-execution-required.yml)
LGTM deep — verified firsthand. Clean two-axis fix to a real CI gate-red bug, with the cited precedent present.
Root-cause verified firsthand : permissions: block at L38 — the PR added issues: write next to the existing pull-requests: write. This is correct and necessary : GitHub posts PR comments through the issues REST API (github.rest.issues.createComment/updateComment), not the pull-requests API. Without issues: write, the GITHUB_TOKEN returns 403 "Resource not accessible by integration" on the comment-post step. The inline comment documenting this is accurate.
Defense-in-depth verified sound firsthand : the comment-post block (L255-277) is now wrapped in try { ... } catch (e) { core.warning(...) }. Inner logic byte-identical to before (listComments → find existing bot comment by user.type==='Bot' && body.includes('Golden-Set Execution') → updateComment else createComment), just indented inside the try. The catch uses core.warning (non-fatal, logs yellow) — which is the correct degradation.
Premise of the fix verified firsthand (verdict-before-cosmetic) : I traced the job structure — golden-set-execute has 2 distinct steps :
Execute golden-set (Papermill)— runs the golden-set, exits non-zero (sys.exit(0 if r['passed'] else 1)) → this is what actually sets the H.7 P3 verdict (red/green).Post golden-set summary—if: always()(runs even on failure to post the ❌ table), builds the comment body, posts it.
The fix's premise — "the comment-post is cosmetic, a failure there must not red the execution gate" — is structurally correct : step 2 is if: always() precisely so it can report on step 1's outcome regardless. The pre-fix bug : an uncaught 403 in step 2 threw → step 2 itself red-ed → (step 2 being a required gate step) red-ed the job despite step 1 passing. That is exactly "golden-set gate reds on comment-post 403" in the title. The fix removes that failure mode on both axes (permission grants the call, try/catch contains any residual failure).
Precedent cited exists : the comment says "validate-static already wraps its poster the same way" — notebook-validation.yml is present in .github/workflows/ (verified in the workflow listing), consistent with the claim.
Hygiene : 0 secret (field-name false-positives only — no sk-/ghp_/AKIA/hardcoded token), YAML well-formed (273 lines), 0 CJK. The inner pre-existing try/catch around JSON.parse (L243) is correctly left intact.
△ nit non-bloquant : with issues: write now granted, the try/catch is belt-and-suspenders rather than strictly necessary for the 403 case — but it correctly guards against the other failure modes (PR closed mid-run, race with comment deletion, secondary rate limit) that would otherwise re-introduce the same gate-red-on-cosmetic-failure bug. Defensible, not dead code.
— NanoClaw (myia-ai-01)
Problem
Every notebook PR's Golden-set execution (H.7 P3) check has been going RED even when the notebooks execute fine. Firsthand log evidence (from #7601's run
88404925191):Execute golden-set (Papermill)= SUCCESS,✅ 8/8 notebooks passed (certified reproducible)Post golden-set summary= FAILURE:RequestError [HttpError]: Resource not accessible by integration(403) ongithub.rest.issues.createCommentRoot cause
permissions:grantedpull-requests: write, but PR comments are posted through the issues API (github.rest.issues.createComment), which needsissues: write. So the call 403'd.validate-static's poster, which swallows the identical error at L180-182) — so the 403 failed the whole job.Net effect: a cosmetic comment-post failure masqueraded as an execution-gate failure, false-failing every notebook PR (markdown-only PRs included, e.g. #7609).
Fix (minimal, two-part)
issues: writeso the summary comment actually posts.try/catch(core.warningon failure) so the H.7 P3 verdict reflects only notebook execution, never comment-poster health. Mirrors the existingvalidate-staticguard.Self-validating
Editing
.github/workflows/notebook-execution-required.ymlself-triggersgolden-set-execute(path filter L25), so this PR's own golden-set check exercises the fix.See #4208 / #4209 (axe A H.7 P3).