Repository navigation
Description
src/pkg/github/automerge/automerge_sweep.go keeps being touched by pull requests that are open at the same time. In the last 7 days 6 distinct PRs changed it, 9 pairs of them were open concurrently, and 0 merge conflicts or rebase failures were blamed on it. Every concurrent pair is a rebase someone (or the merge train) has to redo, and a 3242-line file makes each of those rebases slower and riskier.
Proposed fix: a mechanical split into 4 files in the same package. No behaviour change, exported API unchanged, tests move with the code they cover. Land it when no other PR is open against this file (check the merge-train overlap first) so the split itself does not become one more collision.
Evidence
| metric | value |
|---|---|
| window | 7 days |
| distinct PRs | 6 |
| concurrent PR pairs | 9 |
| conflicts attributed | 0 |
| lines | 3242 |
| kind | code |
| score | 13.5 |
PRs in window: #15308, #15430, #15442, #15455, #15485, #15491
Top-level units
AutoMergeSweepEventAutoMergeSweepOptionsAutoMergeSweepResultEngineMergerAuthorizerNewOptionsStartSelfAuthoredAutoMergeSweepSweepContributorLaneAutoMergesSweepQueuedAutoMergesSweepTrustedAuthorAutoMergesTransportTrustedAuthorDecisionTrustedAuthorPolicyTrustedAuthorizercautionSweepIntervalclassifyUpdateBranchErrorcontextWithExpectedCheckCacheexpectedCheckCacheexpectedCheckCacheContextKeyexpectedCheckCacheFromContexthasLabelhiveQueueApprovalisFreshHeadOrMissingExpectedReasonisGitHubStatusisRateLimitedlabelNameslevelHoldTransportlowPrioritymergeAPIErrorNotAppliedmergeQueueBaseKeymergeQueueRequiredMergeErrormergeTrainPolicyOptionmismatchedDeclaredChecksnewExpectedCheckCachenextSelfAuthoredSweepIntervalparseHiveQueueReviewprMergeableStateConflictingrequiredChecksExpectedMergeErrorselfAuthoredSweepIntervalselfAuthoredSweepIntervalForCandidatessortedSetKeysstaleNeedsRebaseLabelsupersededCloserTransportsweepTickDecisiontrustedAuthorPermissiontrustedRegistryClankerupdateBranchFailure
Split proposal
src/pkg/github/automerge/automerge_sweep.go— core types and the entry points other files call; keepsAutoMergeSweepEvent,MergerAuthorizer,SweepContributorLaneAutoMerges,TrustedAuthorDecision, … 8 moresrc/pkg/github/automerge/automerge_sweep_automergesweepoptions.go— movesAutoMergeSweepOptions,New,SweepQueuedAutoMerges,TrustedAuthorPolicy, … 8 moresrc/pkg/github/automerge/automerge_sweep_automergesweepresult.go— movesAutoMergeSweepResult,Options,SweepTrustedAuthorAutoMerges,TrustedAuthorizer, … 8 moresrc/pkg/github/automerge/automerge_sweep_engine.go— movesEngine,StartSelfAuthoredAutoMergeSweep,Transport,cautionSweepInterval, … 8 more
Don't splinter
- At most 4 resulting files, each at least 150 lines; fewer is better.
- No behaviour change; the package, its exported API and every import path stay the same.
- Tests move with the code they cover; no new test helpers.
- One PR; land it when the file has no open PRs against it.
Filed by the hive's merge-hotspot advisor (GET /api/hotspots). It will not file another issue for this file while this one is open.
Activity
hivecommons-hive commentedon Oct 29, 2026
🔒 Claimed by @mrbobbytables (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 29, 2026
🔓 Claim by @mrbobbytables released (lease revoked).
hivecommons-hive commentedon Oct 29, 2026
Deferred this kick: #15308 (open, stage/050-review-pending) still edits
src/pkg/github/automerge/automerge_sweep.goandautomerge_sweep_test.go, so splitting now would make the split itself the collision this issue is meant to prevent. Will pick up once #15308 lands or closes.🐝 Hive Agent:
scanner| Instance:hosted-available-oke-11-placeholder-r05x| SHA:unknown— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
hivecommons-hive commentedon Oct 29, 2026
Good first issue— superseded: hosted-available-oke-11-placeholder-r05x started working on this issue itself (claimed-by-hive, 2026-10-30T06:53:02Z), so thegood first issuelabel has been removed. Thanks for looking! Other issues open to new contributors are listed on the relay page: https://hosted-kubestellar-hive-ojv6.hive.hivecommons.dev/contribute26 remaining items
hivecommons-hive commentedon Oct 30, 2026
🔓 Claim by @onkar717 released (lease revoked).
hivecommons-hive commentedon Oct 30, 2026
Unblocked: the
blockedlabel was applied by the hive without a blocked-on marker, so nothing could lift it. This issue is actionable again.hivecommons-hive commentedon Oct 30, 2026
🔒 Claimed by agent
scanner(agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply/unclaimto release, or/claimto take it over if you outrank the holder.refactor: split automerge_sweep.go into 4 files