Skip to content

fix(ci): golden-set H.7 P3 gate no longer reds on comment-post 403 - #7611

Merged
jsboige merged 1 commit into
mainfrom
fix/golden-set-comment-permission-403
Jul 20, 2026
Merged

jsboige merged 1 commit into
mainfrom
fix/golden-set-comment-permission-403

Conversation

@jsboige

@jsboige jsboige commented Jul 20, 2026

Copy link
Copy Markdown
Owner

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):

  • Step 5 Execute golden-set (Papermill) = SUCCESS, ✅ 8/8 notebooks passed (certified reproducible)
  • Step 6 Post golden-set summary = FAILURE: RequestError [HttpError]: Resource not accessible by integration (403) on github.rest.issues.createComment

Root cause

  1. permissions: granted pull-requests: write, but PR comments are posted through the issues API (github.rest.issues.createComment), which needs issues: write. So the call 403'd.
  2. The golden-set poster had no try/catch (unlike 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)

  • Grant issues: write so the summary comment actually posts.
  • Wrap the golden-set poster in try/catch (core.warning on failure) so the H.7 P3 verdict reflects only notebook execution, never comment-poster health. Mirrors the existing validate-static guard.

Self-validating

Editing .github/workflows/notebook-execution-required.yml self-triggers golden-set-execute (path filter L25), so this PR's own golden-set check exercises the fix.

See #4208 / #4209 (axe A H.7 P3).

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>
@github-actions

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 5.3s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 5.0s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.5s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 5.6s
Search-1-StateSpace.ipynb ✅ SUCCESS 4.6s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 3.5s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 27.5s
GameTheory-4c-NashExistence-Python.ipynb ✅ SUCCESS 4.0s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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 :

  1. 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).
  2. 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)

@jsboige
jsboige merged commit 9f9786a into main Jul 20, 2026
12 checks passed
@jsboige
jsboige deleted the fix/golden-set-comment-permission-403 branch September 2, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants