Skip to content

🌱 refactor: split stage_tracker_decision.go and stage_tracker_merge_train.go - #15705

Merged
hivecommons-hive[bot] merged 15 commits into
v5from
scanner/fix-15676
Oct 30, 2026
Merged

hivecommons-hive[bot] merged 15 commits into
v5from
scanner/fix-15676

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

src/pkg/dashboard/stage_tracker_decision.go (~1036 lines) and stage_tracker_merge_train.go (~947 lines) are merge hotspots (7 distinct PRs each in 7 days). This is the mechanical split the issues ask for.

What

Whole top-level declarations (with doc comments) moved verbatim into sibling files in package dashboard. No behaviour change, no renames, no signature changes; only the per-file import blocks differ.

File Units
stage_tracker_decision.go types, consts, verdict lookups, stageTrackerDecisionNeeded*, stageTrackerWithoutHold
stage_tracker_decision_lanes.go decisionForParked/Unauthorized/WaitingOn*/Adoption, option/reason helpers
stage_tracker_decision_human_merge.go decisionForHumanMerge, merge-now/queue/reauthor options, DCO helpers, sentence helpers
stage_tracker_decision_pr.go decisionForPR, hold helpers, issue/triage/needs-human decisions
stage_tracker_merge_train.go consts, StageTrackerMergeTrain, queue options, apply/hold, StageTrackerLeftTrain
stage_tracker_merge_train_overlap.go StageTrackerOverlap, overlap hint, leave-train helpers
stage_tracker_merge_train_postpass.go front gate, post-pass, queue facts, NextSweepIn, soak
stage_tracker_merge_train_eta.go ETA basis/head state, mergeTrainMemory, stall warnings, captions, decisionForMergeTrain

Tests are already split by topic into dedicated *_test.go files, so they stay in place. Changelog fragment added per #15690's convention. Not built/tested locally; CI is the verdict.

Closes #15676
Closes #15678

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

…rain.go into 4 files each

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 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 nicholasjackson 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 30, 2026
@github-actions

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.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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=copilot model=claude-fable-5.1 copilot=1.0.88

@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/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026

@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.

Verified this is a pure move. Looks correct to me.

  • Diffed v5...head for all eight src/pkg/dashboard/stage_tracker_{decision,merge_train}*.go files and counted every added/removed line: each removed line reappears exactly once in a sibling file. The only lines with an odd count are import entries (slices, strconv, strings, time, pkg/review, pkg/stageengine/prstage), i.e. the per-file import blocks the body describes. No top-level declaration is dropped or duplicated; the three mergeTrainMemory methods move 1:1.
  • go build ./pkg/dashboard/ on head bbeb43bd succeeds.
  • Changelog fragment changelog.d/changed-15676-stage-tracker-split.md is present with the required changed- prefix.

Nothing else to say; the split matches what the body claims.

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

@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.

Checked this is a pure move rather than trusting the description. At bbeb43b, after dropping package, import blocks and blank lines, the sorted line multiset of stage_tracker_decision.go + stage_tracker_merge_train.go at the merge base is byte-identical to the multiset of the retained originals plus the six new stage_tracker_decision_{lanes,human_merge,pr}.go / stage_tracker_merge_train_{overlap,postpass,eta}.go files β€” 1861 non-blank lines on each side, diff exit 0. The only textual change is import redistribution, and all files stay in package dashboard, so no visibility or call-site changes are possible. go build ./pkg/dashboard/ succeeds at the head. Looks correct to me.

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

@hivecommons-hive hivecommons-hive Bot added stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 100-merge-queue β†’ 050-review-pending: check-pending

@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.

Verified as a pure move; looks correct to me.

At head 169e534 I concatenated each split group, stripped package/import/comment/blank lines, and sorted:

  • stage_tracker_decision.go + _human_merge.go + _lanes.go + _pr.go ≑ v5 stage_tracker_decision.go (only difference: the named import stageengineprstage now appears in three files instead of one, which is expected).
  • stage_tracker_merge_train.go + _eta.go + _overlap.go + _postpass.go ≑ v5 stage_tracker_merge_train.go (zero diff).

go build ./pkg/dashboard/ passes at the PR head and the test (dashboard N/4) CI shards are green. No behaviour change. I have not approved anything.

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

@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.

Pure move, verified mechanically at this head:

  • Top-level declarations of stage_tracker_decision.go (44) and stage_tracker_merge_train.go (39) on v5 are exactly the set now spread across the eight non-test files β€” diff of sorted func|type|var|const lines is empty.
  • A whitespace-normalised multiset diff of removed vs added lines (ignoring package/import scaffolding) leaves one residue: the aliased import stageengineprstage "…/pkg/stageengine/prstage" repeated into two new files. No body line changed.
  • go build ./pkg/dashboard/ succeeds on this head (go test is blocked for agents here, so CI remains the test verdict).
  • No file overlap with the other open stage-tracker splits (#15521 tracker-row JS, #15566/#15633 UI tests), so this cannot conflict with them.

Looks correct to me.

β€” verdict recorded via hive-review

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

@hivecommons-hive hivecommons-hive Bot added stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 100-merge-queue β†’ 050-review-pending: required-check-pending:Sign-off survives the squash

@hivecommons-hive hivecommons-hive Bot added stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window labels Oct 30, 2026

@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.

Reviewed β€” no findings from this perspective.

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

@hivecommons-hive hivecommons-hive Bot added stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/100-merge-queue Lane admitted: soaking, merge-eligible or waiting for tide / the merge window labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 100-merge-queue β†’ 050-review-pending: check-pending

@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.

Reviewed β€” no findings from this perspective.

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

@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.

Conclusion: verbatim split, nothing lost or altered.

Verified (head 752352ad vs v5 tip): I concatenated v5:src/pkg/dashboard/stage_tracker_decision.go + stage_tracker_merge_train.go, stripped package/import lines and blanks, sorted, and diffed against the same treatment of the eight files on this head (the two originals plus _human_merge, _lanes, _pr, _eta, _overlap, _postpass): 1839 lines each, zero differences. Only per-file import blocks differ. golangci-lint, coverage and the dashboard test shards are green on this head. No src/docs/*.md cites either original file by name, so no doc citation goes stale.

Looks correct to me.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 360a42a into v5 Oct 30, 2026
74 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15676 branch October 30, 2026 11:24
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15705752352a` sha256:271021a98593ddea7b2ca18f542ecb64b24ae600951a7f9716ff21499efd9fe5 β€” download from the dashboard or `hivectl review evidence #15705`.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@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.

Conclusion: verified as a pure move for both files; looks correct to me.

What I checked (head 752352a vs base edf66e0):

  • stage_tracker_decision.go β†’ sorted-line diff of the base file against the concatenation of head stage_tracker_decision.go + _human_merge.go + _lanes.go + _pr.go (package/import lines stripped) is empty apart from the aliased stageengineprstage "…/pkg/stageengine/prstage" import, which now appears in two of the new files instead of one β€” expected, since both moved declarations use it.
  • stage_tracker_merge_train.go β†’ same check against head stage_tracker_merge_train.go + _eta.go + _overlap.go + _postpass.go: empty diff.
  • go build ./pkg/dashboard/ at head succeeds; all dashboard test shards are green on this head.
  • changelog.d/changed-15676-stage-tracker-split.md present.

No findings.

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

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

0 participants