ci: do not fail Forge skipped-status on fork-token 403 - #1357
Conversation
Fork pull_request jobs get a read-only GITHUB_TOKEN even with
permissions.statuses: write, so curl -f POST /statuses/{sha} 403s and
fails the required skipped-status check. ci-e2e/kernelforge is already
SUCCESS on the skip-e2e PRs; keep the job green on that 403.
A pull_request_target or workflow_run trigger would get a real write
token; this change is the fail-open one-liner so skip-path PRs can merge.
|
@zoroyihan7 CI PR is up. Thanks for the re-review on #1325 / #1327 / #1328 / #1329 / #1330 — noted on the two extras:
This PR is the fail-open one-liner on Once this is on |
zoroyihan7
left a comment
There was a problem hiding this comment.
LGTM — approving. The diagnosis is right and the fix is the minimal thing that works.
I verified the premise before signing off, since the whole fix rests on it: ci-e2e/kernelforge is SUCCESS on all six affected PRs (#1324, #1325, #1327, #1328, #1329, #1330), so turning the job green really does unblock every one of them rather than trading a red check for a permanently pending one.
Also confirmed mechanically:
- the file parses, and
skipped-statushas noshell:override, so it runs under the defaultbash -e - under
bash -e,curl -fsS ... || echo ...exits 0 on a 403 — simulated it, step exit code 0
One non-blocking suggestion. || echo swallows every failure, not just the fork-token 403. If the POST ever fails for another reason on a PR where kernelforge has not already been posted — API 5xx, a malformed SHA, a future permissions change — the job goes green, the status is never written, and the PR sits pending with nothing red to explain why. The log line is there but nobody reads a green job's log. Cheap hardening:
code=$(curl -sS -o /dev/null -w '%{http_code}' -X POST \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github+json" \
"$API_URL/repos/$REPO/statuses/$SHA" \
-d "$(jq -n --arg d "$description" \
'{state:"success", context:"ci-e2e/kernelforge", description:$d}')")
case "$code" in
2*) echo "posted ci-e2e/kernelforge" ;;
403) echo "::warning::status POST forbidden (fork token is read-only); continuing" ;;
*) echo "::error::status POST failed with HTTP $code"; exit 1 ;;
esacThat keeps the fork case green, surfaces it as a warning annotation instead of a buried log line, and still fails loudly on anything unexpected. Happy either way — I don't want to hold up six merges over it, so take it now or as a follow-up.
Agreed on pull_request_target / workflow_run being the real fix and out of scope here, and on the e2e backstop POST having the same problem.
Hyperloom Forge E2E — ❌ Timeout
|
… on CI E2E label The previous curl fallback swallowed every POST failure. Keep the job green only when the fork token is read-only (403). Also start CI E2E resolve when skip-e2e-test is added so concurrency can cancel an in-flight GPU smoke.
Skip-path PRs were still queuing on Hyperloom-e2e-ci just to decide not to run. Resolve only talks to the GitHub API; match Forge E2E and keep the scarce runner for the actual smoke.
|
Forge E2E on the previous SHA never left Follow-up commits on this branch:
After this lands, skip-path PRs (#1324, #1327–#1330) still need a Forge re-trigger so |
|
@zoroyihan7 checks are green and squash auto-merge is on, but GitHub still reports Likely cause: A re-approve on this SHA should let auto-merge land. After that I’ll re-trigger Forge |
Summary
skipped-statusin.github/workflows/forge-e2e.ymldoescurl -fsS POST /repos/.../statuses/{sha}withGITHUB_TOKEN. Forkpull_requestjobs get a read-only token even withpermissions.statuses: write, so that POST is a deterministic 403 and the job check stays red.ci-e2e/kernelforgeis already SUCCESS on the skip-e2e test-gap PRs (posted by a write-capable actor). Only the Actions job check is failing, and that is what merge-blocks #1324, #1327–#1330 (and the Forge skip path on #1325).This is the fail-open one-liner: treat a failed status POST as non-fatal so the skip path can go green.
Proper fix (not in this PR)
Moving the status POST to
pull_request_targetor aworkflow_runtrigger would give a real write token. That is a security tradeoff (those events run in the base-repo context with write + secrets) and should be weighed by the CI owner. This PR does not do that; it only stops a known-unwritable POST from failing a required job.The same 403 can still hit the
e2ejob's backstop status POST on fork PRs that do run GPU smoke. Out of scope here — those PRs are gated on the actual e2e result, notskipped-status.After merge
This file is read from main, so the test-gap PRs stay blocked until this lands and each is re-triggered (empty commit,
retestlabel, or Actions re-run).Unblocks skip-path merge on: #1324, #1325, #1327, #1328, #1329, #1330.
Test plan
skipped-statusis green even if the log containsstatus POST not permitted from a fork token; continuing.ci-e2e/kernelforgeremains SUCCESS on that SHA.