Repository navigation
π fix: stop retrying shared-ci reruns the App may not perform - #15339
Conversation
A 403 'Resource not accessible by integration' on rerun-failed-jobs is a permanent installation permission gap. One PR with N red workflows emitted N identical WARNs per pass. Stop the pass on the first refusal, remember it per repo for 1h, warn once, and classify the new message in fleetreport. Closes #15336 Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
changelog-fragment-guard requires a '- ' entry bullet; the auto-added fixed-15339.md already carries the entry. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
hive/awaiting-ci: pushed 884cfcb removing the duplicate fragment without a π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Looks correct to me β read shared_ci_rerun.go and advisory.go at 884cfcb.
src/pkg/github/shared_ci_rerun.go:279-291: the refusal check sits inside the run loop and the forbidden branchbreaks, so the first 403 ends the pass for that PR andsharedCIRerunRefusedshort-circuits every later PR in the repo without a POST. The new test asserts exactly one POST across two PRs with five red runs, which is the behaviour the body describes.isWriteForbiddenError(src/pkg/github/advisory.go:128-139) already matches both the typed*gh.ErrorResponse403 and the stringified form, so the fake's{"message":"Resource not accessible by integration"}403 goes down the right branch.- Keyword
shared-ci rerun forbiddenis unique infleetreport/runtime.go(the pre-existingshared-ci rerun failedWARN does not contain it), so classification will not bleed between the two. - Lock discipline matches the existing
sharedCIRerunSeenpattern (samesharedCIRerunMu, lazy map init).
One informational note, not a defect: when a PR is skipped at :279 because the repo is already marked forbidden, rerun is empty and :302 calls markSeen(), memoising that PR's (updatedAt, incidents) state. After the 1h TTL lapses, those PRs are not re-attempted until they change β so "remembered for 1h" in the body is accurate for new PRs/states but unchanged PRs stay quiet indefinitely. That is the pre-existing memo semantic and arguably what you want for a permanent permission gap; mentioning it so the TTL is not read as a retry interval.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the tree at 884cfcb (shared_ci_rerun.go, advisory.go, fleetreport/runtime.go). The mechanism is sound and I found no defect; two small notes below.
Correctness. isWriteForbiddenError (src/pkg/github/advisory.go:128-139) matches both the structured 403 and the stringified form, so the fake's {"message":"Resource not accessible by integration"} and a real go-github ErrorResponse take the same branch. After the break, rerun is empty so the existing markSeen() at shared_ci_rerun.go:297-301 memoizes the PR β same as the pre-existing "every re-run was refused" path, so no new retry loop is introduced. The map is guarded by the existing sharedCIRerunMu and lazily allocated, so newTestClient needs no change.
Two notes (not blockers):
-
shared_ci_rerun.go:279β thesharedCIRerunRefused(repo)check sits inside the per-run loop, afterlistIssueComments(:252) andlatestFailedWorkflowRuns(:266). For a repo already known-forbidden, each remaining PR in the pass still costs those two API calls before the loop breaks on its first iteration. Hoisting the check to just beforelistIssueComments(returningmarkSeen()-less so the PR is retried once the TTL lapses) would save the calls and avoid memoizing PRs that were never actually attempted. The test asserts "exactly one POST", which both placements satisfy. -
Operator docs:
src/docs/operator-reference.md:886-912describes the sweep but does not say the App needs Actions: write forrerun-failed-jobs, nor that a 403 now backs the repo off for an hour and surfaces asshared_ci_rerun_forbiddenin the fleet report. One sentence there would let an operator who sees the new warning know what to grant.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
The 403 'Resource not accessible by integration' on rerun-failed-jobs is a permanent installation permission gap. One PR with N red workflows emitted N identical WARNs per pass and tripped the fleet unclassified-repeat threshold. Now the first refusal stops the pass, is remembered per repo for 1h (later PRs/passes skip rerun calls), and warns once with a stable message that fleetreport classifies (shared_ci_rerun_forbidden).
Closes #15336
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88