Repository navigation
🌱 refactor: split src/pkg/dashboard/api_repo_item_decision_test.go into 4 files - #15708
Conversation
…to 4 files Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
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
|
stage 060-reviewed → 050-review-pending: required-check-pending:Sign-off survives the squash |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.goat base and the union of the four_test.gofiles at head withgo/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; thetest (dashboard 1/4..4/4)andgolangci-lintshards are green on this head, which confirms the per-file import blocks compile. origin/v5has not moved insrc/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
There was a problem hiding this comment.
Looks correct to me — verified as a pure mechanical move, not just eyeballed.
- Parsed
src/pkg/dashboard/api_repo_item_decision_test.goat thev5merge-base and the four_test.gofiles atb749748withgo/parserand 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/packagestype-check ofpackage dashboardwith tests passes at the head (no undefined helpers, no duplicate symbols);gofmt -lis clean. Alltest (dashboard …)shards are already green. changelog.d/changed-15702-decision-test-split.mdmatches 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
There was a problem hiding this comment.
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
|
stage 060-reviewed → 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
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.gofiles inpackage dashboard; no behaviour change, no renames. Only import blocks differ per file. No open PR touches the file.api_repo_item_decision_test.gorepoItemDecisionMock,newRepoItemDecisionServer,postRepoItemDecision,decisionAuditActions), authorization/validation and approve-result-wording testsapi_repo_item_decision_approve_test.goapi_repo_item_decision_close_test.goTestParseRepoItemSupersededByapi_repo_item_decision_merge_test.gopostRepoItemDecisionAsShared 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