Skip to content

πŸ› stage: a refused shared-CI re-run no longer hides the PR's real blocker - #19024

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/rerun-refusal-keeps-real-blocker
Nov 18, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/rerun-refusal-keeps-real-blocker

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

When the shared-CI rerun is refused (403, because the App has no Actions write, which is an owner decision), the PR's stage became unauthorized:rerun-shared-ci at 085. That happened whatever was actually holding the PR, so a maintainer reading "re-run CI" never saw the real blocker. On the projectbluefin hive it covered:

The refusal now takes the stage only when CI is what holds the PR and no review gate stands. Otherwise the PR keeps its real stage and caption, and the re-run ask stays as the hive:unauthorized note.

Why it happened

#16277 added the refusal as a post-classification override in two places: the stage-label pass and DerivePR's mirror. It set stage 085, the reason and the route for any PR whose current head had a refused rerun, as long as it had any stage at all. The intent was to keep an infrastructure failure out of source fixing. It was not meant to outrank a changes request, a decision request, or another 085.

The fix

  • stageengine.RecoveryUnauthorizedOwnsStage(verdict, reason, detail) is true only when all of these hold:
    • the PR is not already at 085, terminal, or without a stage;
    • the reviewer verdict neither blocks (changes requested / reject) nor asks for a person;
    • the reason is CI: a red or pending check, a shared-CI incident deferral, base-branch red, or a red optional check.
  • Both override sites use it.
  • sharedCIRecoveryUnauthorized still runs first, so the hive:unauthorized label and its actionable comment are written either way.
  • When the re-run really is the only blocker, behaviour is unchanged.
  • docs/github-app-setup.md ("Optional shared-CI recovery") now says this.

Other unauthorized steps checked

  • approve-workflow-runs: the contributor lane's own reason when held runs stop CI (automerge_contributor_held_runs.go).
  • merge-workflow-path: a merge-time refusal.

Both go through ClassifyStage like any lane reason, and they really are the blocker at that point. Only rerun-shared-ci is applied as an override, so only it is changed.

Tests

  • TestRecoveryUnauthorizedOwnsStage, a table:
    • takes the stage: a red required check, a shared-CI deferral, a red optional check;
    • keeps the real reason: a changes request, a red check under a changes request, a requested decision, an existing 085, no stage, terminal, a non-CI reason.
  • TestDerivePRRecoveryPermissionBlockKeepsAChangesRequest: a changes-requested PR with a refused rerun stays at fixing.
  • Unchanged: TestDerivePRRecoveryPermissionBlockIsNotSourceFixing still covers the case where the re-run is the only blocker.

Locally I ran only gofmt -l (AGENTS.md bans local go test/go build/go vet) and check-docs-citations.py, which verified 2183 references. CI is the test run.

Appendix: code refs

  • src/pkg/stageengine/derive_pr_classify.go: RecoveryUnauthorizedOwnsStage
  • src/pkg/stageengine/derive_pr.go: the DerivePR override
  • src/pkg/github/automerge/automerge_stage_labels.go: the stage-label pass override
  • src/pkg/github/automerge/shared_ci_recovery.go: sharedCIRecoveryUnauthorized (label and comment, unchanged)

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…blocker

The rerun 403 (`unauthorized:rerun-shared-ci`, hivecommons#16277) replaced the stage,
reason and route of every PR whose exact head it was refused for, whatever
held the PR: on projectbluefin it showed "re-run CI" over a reviewer's
changes request (utah#1313), a withheld security approval
(utah-packages#1013) and high-risk decision requests. It was meant to keep an
infrastructure failure out of source fixing, not to outrank review gates.

RecoveryUnauthorizedOwnsStage lets it take the stage only when CI is what
holds the PR (a red/pending check, a shared-CI or base-branch-red deferral,
a red optional check) and no review gate stands; it is used by both the
stage-label pass and DerivePR. The hive:unauthorized label and comment are
still written either way.

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 18, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#19015 ✨ auto-merge: an owner's approval of the head releases the human-merge-path hold (opt-in per repo) same files src/pkg/github/automerge/automerge_stage_labels.go
#19021 ✨ settings: dashboard toggle and admin-MCP write for shared_ci_rerun.enabled same files src/docs/github-app-setup.md

@hivecommons-hive
hivecommons-hive Bot merged commit c5d4751 into hivecommons:v6 Nov 18, 2026
81 of 82 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#19024efd4513` sha256:a1c8cd03d5187e93718d54d2427c423b7451a488879801f3489958fbb0383d78 β€” download from the dashboard or `hivectl review evidence #19024`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant