Repository navigation
Description
Target: v6.
Summary
On a 19-repo hive, the contributor-lane auto-promotion check runs hive-wide Search API queries for every non-admitted PR author on every automerge sweep: bots included, nothing cached between PRs by the same author. It trips GitHub's search secondary rate limit, and the hive then sheds all low-priority REST work (automerge sweeps included) for the caution window. On hosted-projectbluefin-knuckle-gjvq this happened four times on 2026-10-28 (17:22, 18:56, 19:43, 20:00 UTC). Before #15050 each trip cost ~70 minutes with zero merges; with #15050 it is ~11 minutes, but it still recurs.
Evidence
The first failing call in every trip is this one (hive log, warn, 2026-10-28):
contributor-lane auto-promotion repo search failed; counting the PR's repository only
repo=projectbluefin/utah-packages author=github-actions[bot]
GET .../search/issues?q=is:pr is:merged author:github-actions[bot] repo:projectbluefin/website ... 403 You have exceeded a secondary rate limit
followed within ~2 s by 403 API secondary rate limit exceeded until … on unrelated REST calls (pulls/761, collaborators/…/permission, labels, commits/…/status) and github pacing: low-priority work shed … caller=automerge:self-authored-sweep.
The author is github-actions[bot] (utah-packages#763, a workflow-opened bump PR). A [bot] login can never hold a registry tier, so the search can never promote it.
Code (at 079541810)
src/pkg/github/automerge/automerge_contributor_lane.go:629-630:admitContributorcallscontributorCleanMergedHistoryfor every author the claim path did not admit, with no[bot]exclusion.:728contributorCleanMergedHistory: lists the PR's own repo, then, whenhiveWideand short, callscontributorMergedRepos(:756).:808contributorMergedRepos: chunksrepo:qualifiers into the 256-charqlimit, so a 19-repo hive costs 3–4Search.Issuescalls (:837) per PR evaluated. The result is not memoized, so N open PRs by the same author cost N × 3–4 searches per sweep.
The Search API's secondary limit is far lower than the core quota (core sat at 87% remaining during the 17:22 trip).
Proposed fix
- Skip auto-promotion evaluation entirely for
[bot]logins (and the hive App). They cannot be promoted, andautomerge_review_gate.go:335/automerge_human_changes_requested.go:60already treat[bot]as non-human the same way. - Memoize
contributorMergedRepos(or the wholecontributorMergedHistory) per(author, sweep), so each author costs at most one set of searches per sweep, not one per PR. - Optional: cache the hive-wide merged-repos result per author for a short TTL (for example 30 minutes), since merged history only grows.
Acceptance criteria
- A sweep over PRs by
github-actions[bot],mergeraptor[bot]and other[bot]authors makes zeroSearch.Issuescalls from the auto-promotion path. - A sweep over K PRs by the same human author makes at most one set of merged-repos searches for that author.
- Existing auto-promotion behaviour for human authors is unchanged (the Contributor-lane auto-promotion counts clean merges per repo, not across the hive's repos #14517 hive-wide count, [sec-check] contributor-lane auto-promotion re-trusts revoked contributors and misses reverted-PR evidence #12874 revocation, revert and sentinel checks).
Test plan
- Unit tests in
automerge_contributor_lane_test.gowith a fake transport countingSearch.Issuescalls: (a) bot author → 0 calls; (b) three PRs, same human author, one sweep → one search set; (c) two different authors → two sets. - Existing contributor-lane auto-promotion tests stay green.
Out of scope
- Changing
AutoPromoteAfterMergedPRthresholds or the hive-wide counting rule. - The forgestate outcome-count reconcile. It already paces itself (
forgestate/counts.go:388: per-pass budget, pace, early stop on a rate-limit refusal) and is not the first failure in any of the four trips.
Activity
Danathar commentedon Oct 28, 2026
Two more trips since filing, same first failing call (auto-promotion search, author
github-actions[bot], repoprojectbluefin/utah-packages): 20:17:22Z (and 20:00:57Z before it), so five on 2026-10-28, now every ~20–60 minutes. Each caution window also sheds the dashboard's low-priority refreshes: during the 20:17Z window the Overview snapshot stayed at 19:59:45Z and the PR/issue counts were markedstale: GitHub rate-limited (partial: 13 of 19 repos counted), so the owner-facing cards stop updating as well as merges.hivecommons-hive commentedon Oct 28, 2026
🔒 Claimed by @Karibhou (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Oct 28, 2026
🔓 Claim by @Karibhou released (lease revoked).
🐛 fix: limit contributor promotion searches per sweep (#15125)
hivecommons-hive commentedon Oct 28, 2026
Fixed by #15125 (merged 215ded4). Closing. Reply /reopen if the problem persists.
github-actions commentedon Oct 28, 2026
@Danathar this issue was closed by @hivecommons-hive[bot] as completed.
If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.
If you are still seeing the problem, comment
/reopenand it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.🐛 fix(automerge): cache contributor merged-repo search across sweeps (#…
🌱 top-up: reconcile v5 tests and ratchets with v6 after the forward-m…