Skip to content

πŸ› fix: get stale Dependabot PRs moving without refused commands - #18446

Merged
kubestellar-prow[bot] merged 3 commits into
v5from
scanner/fix-18441
Nov 17, 2026
Merged

kubestellar-prow[bot] merged 3 commits into
v5from
scanner/fix-18441

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Why

Stale Dependabot PRs sat stuck because the hive asked Dependabot to rebase them, and Dependabot refused every time (#18370):

  • Dependabot takes @dependabot rebase / recreate only from users with push access. The hive App never qualifies ("Sorry, only users with push access can use that command").
  • Once another identity has pushed to the branch, Dependabot refuses rebase from anyone. The NOTICE autofix push does exactly that ("edited by someone other than Dependabot").
  • The scanner prompt said "@dependabot rebase stale ones", so the same refused comment went up on every pass. The automerge sweep also posted @dependabot rebase on autofix-pushed Dependabot heads (πŸ› ci: Dependabot PRs that get a NOTICE autofix push never satisfy the required verify PR contents contextΒ #11923), and that was refused too.

What changed

The hive now never posts a Dependabot command. A stale Dependabot PR on the trusted-bot lane is handled like this (decideDependabotStale):

State Action
behind (no conflicts) The App calls PUT /pulls/{n}/update-branch. Dependabot does not rebase a branch that is only behind.
conflicting, only Dependabot's commits Left alone. Dependabot rebases conflicting branches itself.
conflicting, edited by others Closed once per head with a note, so Dependabot opens a fresh PR. The note says a maintainer can comment @dependabot recreate to restore it now.
  • leaveBaseSyncToDependencyBot now lets Dependabot PRs through on the update-branch and current-base steps only. Renovate and the merge-forward / merge-train paths behave as before (πŸ› fix: leave dependency-bot branches to the bot on every base-sync pathΒ #16862).
  • The held-runs path (nudgeDependabotRebase, same name) now only logs once per head and holds as required-check-never-ran. It posts nothing. The head unsticks when the base moves and the App's update-branch push triggers the workflows.
  • Scanner prompt step 2: never comment @dependabot rebase/recreate. Use update-branch when the PR is only behind. Close it when it conflicts and has a commit not authored by Dependabot. Otherwise leave it to Dependabot.
  • The close note and the close are annotated writeback:solicited, because the operator listed dependabot[bot] as a trusted bot. The writeback baseline for automerge_held_runs.go drops from 3 to 2, since the refused comment is gone.
  • Tests cover the decision table (behind, conflicting, edited by others), the step exemption, the behind update-branch path, close-once-per-head with no @dependabot command line, and the updated held-runs and current-base expectations.

Caveat: when a Dependabot PR is closed, Dependabot does not reopen that same version. It opens a PR for the next release, or a maintainer runs @dependabot recreate.

Fixes #18441 (remaining: the NOTICE autofix workflow still pushes onto Dependabot branches; moving NOTICE regeneration so it no longer edits Dependabot's branch is a non-trivial workflow change, left for a follow-up)

πŸ€– Generated with Claude Code

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 requested_by=@clubanderson

… Dependabot PRs

Dependabot refuses @dependabot rebase/recreate from the hive App and refuses rebase on a branch someone else pushed to (the NOTICE autofix). The automerge sweep and the scanner prompt no longer post those commands. A behind Dependabot PR is updated with the update-branch API; a conflicting one is left to Dependabot's own rebase unless it was edited by others, in which case it is closed once per head so Dependabot opens a fresh PR.

Refs #18441

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 16, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

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

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Routing to a human: this adds an automatic PR close, and the close condition can be triggered by the PR's own behaviour. The code is otherwise consistent with the body.

Finding (medium): the App's update-branch merge makes a Dependabot PR closeable later.

  • automerge_dependabot_stale.go (isDependabotCommit / dependabotEditedByOthers) treats any commit not authored by dependabot[bot] as an edit by others. The comment on dependabotEditedByOthers lists "an App update-branch merge" as one of those edits.
  • The same PR makes the lane call update-branch on a behind Dependabot PR (leaveBaseSyncToDependencyBot now returns false for update-branch/current-base).
  • So the sequence is: behind β†’ the App merges the base in (a non-Dependabot commit) β†’ the base moves again and the PR conflicts β†’ resolveConflictingDependabotPR sees edited=true β†’ closes it. A PR no human touched is closed because of the hive's own earlier action. Before this change it would have been left to Dependabot.
  • The body says it closes PRs where "someone else pushed" and names the NOTICE autofix. It doesn't say the lane's own merge commit also counts. Excluding the App's own update-branch merge commits from editedByOthers, or documenting the behaviour, would address it. Which is intended is a maintainer's call.

Why this is a decision rather than a nit: closing a PR is an external, hard-to-reverse action, and the PR's test table (decideDependabotStale) covers the close path only with edited supplied as a bool. I did not see a test where the only non-Dependabot commit is the App's own merge. I read the diff but had no checkout, so I could not check the author the commit-list API reports for an App update-branch commit. If it were reported as dependabot[bot], the finding doesn't apply. That is an open question.

Read and found consistent with the body: the held-runs change only logs (nudgeDependabotRebase), the writeback baseline drops 3 β†’ 2 to match the removed CreateComment, and the changelog fragment is at repo root.

I have not closed or approved anything.

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing

gremlins found 3 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.

File Line Mutation
src/pkg/github/automerge/automerge_dependabot_stale.go 125 CONDITIONALS_NEGATION
src/pkg/github/automerge/automerge_dependabot_stale.go 178 CONDITIONALS_NEGATION
src/pkg/github/automerge/automerge_dependabot_stale.go 184 CONDITIONALS_NEGATION

Verdict: lived (#17349).

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read automerge_dependabot_stale.go, the trySweepSelfAuthoredPR wiring and the leaveBaseSyncToDependencyBot exemption. The behind -> update-branch / conflicting -> leave-or-close-once split matches the body, renovate and merge-forward/merge-train paths are unchanged, and the held-runs nudge no longer posts anything.

One low-severity note: dependabotEditedByOthers counts any non-Dependabot commit as grounds to close a conflicting PR, so a PR carrying a maintainer's manual fix, or the App's own earlier update-branch merge commit, is closed rather than left for a human. Closing is reversible and the note explains @dependabot recreate, so I read this as intended; flagging it for the maintainer who owns the trusted-bot lane.

β€” hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.325

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

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

PR Title Relation Files
#18455 ✨ Fold the auto-merge note into the PR hive:status card (quiet mode) same files src/pkg/github/automerge/automerge_sweep_trusted.go

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 16, 2026
@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 17, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @ca66158
  • the review found: the reviewer marked this change high-risk
  • reviewer question: @clubanderson should decide whether the automerge lane may close conflicting Dependabot PRs on its own, given that its own update-branch merge commit makes a PR count as "edited by others".
  • the automerge lane will not merge this unattended

Head: verdict requires_human @ca66158, 72/73 checks green, 1 pending, DCO yes, soak 0s of 10m0s.

What to do: approve this head (ca66158) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

…icting Dependabot PR closeable

Dependabot stops rebasing a branch once anyone other than Dependabot has
committed to it, including the App's update-branch merge. A PR that went
behind -> update-branch -> conflicting is therefore stuck and is closed
with the recreate note, like any other edited PR (#18441).

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Nov 17, 2026
@clubanderson

Copy link
Copy Markdown
Member

Owner decision on the reviewer question: yes, the lane may close a conflicting Dependabot PR on its own, including when the only non-Dependabot commit is the App's own update-branch merge. Dependabot stops rebasing a branch once anyone else has committed to it, so a PR that went behind -> update-branch -> conflicting is stuck either way; closing it once per head with the recreate note is the intended outcome, and the code comment on dependabotEditedByOthers already says so. Pushed e119d81 with a test case pinning that path, plus a signed v5 base sync (792b01a) so CI runs against today's #18502 / #18518 / #18542. Merges when green.

@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

The pull request process is described 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 merged commit 4be5f07 into v5 Nov 17, 2026
104 of 108 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-18441 branch November 17, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

πŸ› scanner: stale Dependabot PRs stay stuck (App's @dependabot rebase is refused; NOTICE commit blocks rebase)

1 participant