Skip to content

🌱 refactor: split src/pkg/dashboard/api_repo_item_decision_test.go into 4 files - #15708

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

hivecommons-hive[bot] merged 26 commits into
v5from
scanner/fix-15702

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

src/pkg/dashboard/api_repo_item_decision_test.go (839 lines) is a merge hotspot: 6 distinct PRs touched it in 7 days. This is the mechanical split the issue asks for.

What

Whole top-level declarations (with doc comments) moved verbatim into sibling _test.go files in package dashboard; no behaviour change, no renames. Only import blocks differ per file. No open PR touches the file.

File Contents
api_repo_item_decision_test.go shared helpers (repoItemDecisionMock, newRepoItemDecisionServer, postRepoItemDecision, decisionAuditActions), authorization/validation and approve-result-wording tests
api_repo_item_decision_approve_test.go approve and direction decisions on issues and PRs
api_repo_item_decision_close_test.go close decisions (won't-fix, read, superseded, advisory fixture) and TestParseRepoItemSupersededBy
api_repo_item_decision_merge_test.go merge-now / queue-merge / merge-decisions guard, with postRepoItemDecisionAs

Shared helpers live in exactly one file. Changelog fragment added as in #15690.

Closes #15702

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…to 4 files

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 kellyaa 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/XL Denotes a PR that changes 500-999 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 added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it 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/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it 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.

Checked this is a pure move. At 120a274, after dropping package, import blocks and blank lines, the sorted line multiset of api_repo_item_decision_test.go at the merge base is byte-identical to the multiset of the retained file plus api_repo_item_decision_{approve,close,merge}_test.go — 780 non-blank lines on each side, diff exit 0. Only imports were redistributed; everything stays in package dashboard, so the shared test helpers and mocks remain visible to the moved tests. 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/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) 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/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed → 050-review-pending: required-check-pending:Sign-off survives the squash

@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 919670b I concatenated api_repo_item_decision_test.go + _approve_test.go + _close_test.go + _merge_test.go, stripped package/import/comment/blank lines, and sorted: line-for-line identical to v5 api_repo_item_decision_test.go (zero diff), so no test case was dropped or duplicated in the split. All test (dashboard N/4) and dashboard shuffle CI shards are green on this head, which is the compile check for the test files. 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 removed the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label 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 mechanical split — looks correct to me.

What I checked (at head b749748, merge-base 7f9f088):

  • Parsed api_repo_item_decision_test.go at base and the union of the four _test.go files at head with go/parser, and compared every top-level declaration (doc comment + body, imports excluded) as a sorted multiset: 21 declarations, byte-identical. No test was added, dropped, renamed, or edited; the shared helpers (repoItemDecisionMock, newRepoItemDecisionServer, postRepoItemDecision, decisionAuditActions) are defined exactly once.
  • All four files are gofmt-clean; the test (dashboard 1/4..4/4) and golangci-lint shards are green on this head, which confirms the per-file import blocks compile.
  • origin/v5 has not moved in src/pkg/dashboard/ relative to this file since the merge-base, so no rebase risk.
  • No docs reference the test file by path, so nothing to update there.

No findings.

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

Looks correct to me — verified as a pure mechanical move, not just eyeballed.

  • Parsed src/pkg/dashboard/api_repo_item_decision_test.go at the v5 merge-base and the four _test.go files at b749748 with go/parser and compared the multiset of top-level declarations (doc comments included): 22 in the base, 22 across the split, 0 changed, 0 missing, 0 extra. Only the import blocks differ; the shared helpers (repoItemDecisionMock, newRepoItemDecisionServer, postRepoItemDecision, decisionAuditActions) are declared exactly once.
  • A go/packages type-check of package dashboard with tests passes at the head (no undefined helpers, no duplicate symbols); gofmt -l is clean. All test (dashboard …) shards are already green.
  • changelog.d/changed-15702-decision-test-split.md matches the fragment-name convention the guard enforces.

Not independently verifiable from here: the body's "no open PR touches the file" claim; the overlap check is green, which is the relevant signal for a hotspot split.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it 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/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it 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 as a pure move; looks correct to me.

I fetched the four test files at 29bdccc and compared them against src/pkg/dashboard/api_repo_item_decision_test.go on the v5 tip, ignoring only the package line and import blocks: the 780 non-blank lines of the original appear exactly once across api_repo_item_decision_test.go (363 lines), _approve_test.go (176), _close_test.go (169) and _merge_test.go (163) — nothing missing, nothing added, no line edited. Same package, so helpers shared across the new files still resolve; the test (dashboard *) and test (dashboard shuffle *) jobs are green on this head.

— 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 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/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 30, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test

@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 pure move; looks correct to me.

Against merge-base 003726527 on v5, the multiset of non-blank lines removed from src/pkg/dashboard/api_repo_item_decision_test.go equals the multiset added across _approve_test.go, _close_test.go and _merge_test.go, except for the three new package dashboard / import (...) headers. Each new file imports exactly the packages it references (checked both directions, incl. httptest, strconv, stagelabels, time, which only some of the three need). gofmt -l on the three files is clean. I could not compile the test binary from here; the test (dashboard …) shards are the compile proof and were still pending when I looked.

— 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 Author

Choose a reason for hiding this comment

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

Looks correct to me as a pure move.

Checked at head a4eb40d against merge-base c87e657: the multiset of non-blank, non-import lines of the old src/pkg/dashboard/api_repo_item_decision_test.go equals the union of the four api_repo_item_decision_*_test.go files at head (sorted-line diff is empty), so every test and helper moved verbatim — only the import blocks differ. All four files stay in package dashboard, so the shared helpers (repoItemDecisionMock, newRepoItemDecisionServer, postRepoItemDecision) remain visible to the moved tests without export changes. golangci-lint (typecheck) is green on this head; the test (dashboard …) shards were still running when I looked.

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

Verified mechanically rather than by eye: the sorted multiset of every non-blank, non-import line (code and comments) in v5:src/pkg/dashboard/api_repo_item_decision_test.go equals the union of the remaining _test.go plus _approve_test.go, _close_test.go, _merge_test.go at a4eb40d — zero diff, so no test case or helper was dropped or altered. Shared helpers (repoItemDecisionMock, newRepoItemDecisionServer, postRepoItemDecision, decisionAuditActions) exist once, in the base file, as the body says. No other open PR in the current queue touches this file, so #15702's landing condition holds. Looks correct to me.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 1279311 into v5 Oct 30, 2026
75 of 76 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15708a4eb40d` sha256:c8ef37cf6c561e42b57b0df0a1cdaab154eea7210b25c17ee1591bdfae11582b — download from the dashboard or `hivectl review evidence #15708`.

@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15702 branch October 30, 2026 13:57
@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 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: src/pkg/dashboard/api_repo_item_decision_test.go is a merge hotspot — split into 4 units

0 participants