Skip to content

πŸ› fix: limit contributor promotion searches per sweep - #15090

Closed
Karibhou wants to merge 1 commit into
hivecommons:v6from
Karibhou:fix/15088-promotion-search
Closed

Karibhou wants to merge 1 commit into
hivecommons:v6from
Karibhou:fix/15088-promotion-search

Conversation

@Karibhou

Copy link
Copy Markdown
Contributor

Summary

  • Skip auto-promotion history searches for bot and Hive App authors.
  • Cache merged-repository discovery per author for each contributor sweep, while preserving per-repository history and revert checks.
  • Add regression coverage for bot authors, repeated authors, and a fresh sweep.

Fixes #15088

Validation

  • gofmt -l on changed Go files and git diff --check passed.
  • Go tests not run locally, as required by AGENTS.md; CI runs the test suite.

β€” hive: backend=codex

Hive-Run: hivecommons#15088
Hive-Plan: contributor-lane auto-promotion search reduction
Hive-Spec: issue-15088#acceptance-criteria
Co-authored-by: Danathar <6772335+Danathar@users.noreply.github.com>
Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added 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. labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off role/contributor Author holds the contributor tier in this hive's registry; a human must lgtm/approve stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

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
#15125 πŸ› fix: limit contributor promotion searches per sweep same files changelog.d/fixed-15088-promotion-search.md
src/pkg/github/automerge/automerge_contributor_lane.go
src/pkg/github/automerge/automerge_contributor_lane_test.go

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read the diff against the tree at 2d184d9, plus the sweep loop and callers. This looks correct to me.

  • The cache map is created once per sweep in SweepContributorLaneAutoMerges (automerge_contributor_lane.go:401) and the sweep walks repos/PRs serially (:402, :421), so the unsynchronised map is safe. Callers outside the sweep get cache == nil and fall through to the pre-existing path unchanged.
  • With a cache present the query now includes the PR's own repo (:835) and filters it out at return (:892-899); that is what lets a later PR by the same author in a different repo reuse the result correctly. A failed search is cached as nil (:871, :881), so one 403 per author per sweep is the ceiling β€” which is exactly the secondary-rate-limit scenario in #15088.
  • Bot skip at :630 ([bot] suffix or the App's own login) short-circuits before any search, matching the github-actions[bot] case the issue reports.

Suggestion only, not a defect: TestContributorPromotionSearchCachePerSweep exercises contributorCleanMergedHistory directly with a hand-built ctx; a test through SweepContributorLaneAutoMerges would also pin that the sweep actually installs the cache at :401.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read the diff against the tree at 2d184d9, plus the call chain from SweepContributorLaneAutoMerges down. Looks correct to me.

  • The per-sweep cache survives the trip to contributorMergedRepos: SweepContributorLaneAutoMerges wraps ctx at automerge_contributor_lane.go:401, and mergeDecisionPriority (automerge_sweep.go:518-523) derives from that ctx rather than replacing it, so admitContributor β†’ contributorCleanMergedHistory β†’ contributorMergedRepos sees the map.
  • In cached mode the PR's own repo is deliberately kept in the search (:835) so the entry is author-wide, and it is filtered back out on both the hit (:819-826) and fill (:892-900) paths β€” callers still get "other repos" as before. Out-of-sweep callers (cache == nil) keep the old per-call behaviour unchanged.
  • A failed search is stored as nil for the rest of the sweep (:871, :881), so one 403 no longer turns into a retry per PR by that author β€” which is the behaviour #15088 was asking for. Worth knowing as an operator: a transient search failure now sticks for the whole sweep, not just one PR.
  • The [bot] / App-login skip at :630 sits before the history call, so bot authors reach zero Search.Issues, matching the issue's first acceptance criterion; TestContributorPromotionSkipsBots and TestContributorPromotionSearchCachePerSweep cover (a), (b), (c) from the issue's test plan.

No defects found.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Ready for a human merge: verdict approved @2d184d9, 56/56 checks green, DCO yes, soak 30m0s elapsed. Blocked only by role/contributor (below require_tiers).

The hive never approves on your behalf: /lgtm /approve (or merge) if you accept it.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/hive decision supersede now: adopt #15090 in supersede mode, preserving the author's commits and sign-off; do not wait for the grace deadline

Rationale: the contributor is offline; adoption in supersede mode keeps the work moving (#13975).

Hive decided: Close this PR and open a fresh hive-authored PR with the same commits.
Why: The author's hive hasn't been connected since the nudge.
What happens next: The hive closes this PR and opens a fresh hive-authored PR with the same commits and sign-off, then finishes that one β€” expected within 30 min.
If it doesn't happen: A maintainer can merge this PR by hand, re-run the decision, close it as superseded, or send it back for a new commit.

Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule contributor-offline).

@hivecommons-hive hivecommons-hive Bot added the adoption/supersede Owner-delegate request: adopt now in supersede mode label Oct 28, 2026
hivecommons-hive Bot pushed a commit that referenced this pull request Oct 28, 2026
The merge-gate pill (#15084) read an issue row's lane reason β€” 'open PR
#15090 covers it (PR at 060-reviewed)' β€” as a gate reason and drew it as
the pill's detail, a two-line clipped label on every issue whose PR sat
at the gate. The pill is now the stage word plus a gate fact only; the
issue row reads the gate from the nested PR it mirrors so it agrees with
the PR sub-row, and the cover reason leads the glyph tooltip instead.

Fixes #15101

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

@hivecommons-hive[bot]: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

/approve

Posted by @clubanderson from the Hive dashboard; the merge gate decides from here.

@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hivecommons-hive[bot]
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

@hivecommons-hive hivecommons-hive Bot removed the adoption/supersede Owner-delegate request: adopt now in supersede mode label Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@Karibhou the hive has adopted this PR (stage/074-adopted-by-hive): your hive has been offline since the nudge. It is being finished as #15125, which carries your commits (and sign-off) unchanged; the hive will rebase and fix CI there. This PR is closed automatically once #15125 merges. If you would rather finish it yourself, push a new head here and say so on #15125.

@hivecommons-hive hivecommons-hive Bot added stage/074-adopted-by-hive Contributor PR adopted: author unavailable after red CI; the hive is finishing it (takeover path) and removed stage/090-ready-for-human-merge Hive would merge this but trust/role blocks it; a maintainer's /lgtm /approve is all that is missing labels Oct 28, 2026
@clubanderson

Copy link
Copy Markdown
Member

Superseded by #15125 (hive re-authored this PR with the same commits and sign-off; it will be merged there). Closing to keep one active PR per issue.

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

Labels

author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/contributor Author holds the contributor tier in this hive's registry; a human must lgtm/approve size/M Denotes a PR that changes 30-99 lines, ignoring generated files. stage/074-adopted-by-hive Contributor PR adopted: author unavailable after red CI; the hive is finishing it (takeover path)

Projects

None yet

2 participants