Skip to content

πŸ› fix(hotspot): stop proposing source splits for generated files whose source is already split - #15471

Merged
hivecommons-hive[bot] merged 5 commits into
v5from
scanner/fix-15460
Oct 29, 2026
Merged

hivecommons-hive[bot] merged 5 commits into
v5from
scanner/fix-15460

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #15460

Why

The issue asks to split src/pkg/dashboard/static-src/ β€” it is already 120 files, and static/index.html is the single generated output. Regeneration touches the output in every PR that edits any source file, so it will always look hot however the source is split. The evidence showed lines 0 and conflicts attributed 0.

The defect is in the advisor: it recommended split-source for any generated file with a known source tree.

Fix

  • hotspot.Options.SourceFileCount (optional hook, populated in cmd/hive from the local checkout) reports the source tree's file count.
  • For a generated file whose source tree has more than MaxUnits files, the advisor now recommends report-only ("already split into N files … nothing to split"), so no issue is filed.
  • Exported names, JSON keys and recommendation constants are unchanged; test, docs and changelog added.

Not run locally; CI is the verdict.

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

hivecommons-hive Bot and others added 2 commits October 29, 2026 15:06
… split

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 29, 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 danathar 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2026
Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 29, 2026 •

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.

PR Title Relation Files
#15425 πŸ› fix: identify tracker claims from the local ledger same files src/docs/api-reference/dashboard-misc.md
#15497 πŸ“– docs: monitoring a hive with Prometheus and Grafana same files src/docs/operator-reference.md
#15405 πŸ› fix: require verified signature for email-only hive commit identity match same files src/docs/operator-reference.md
#15506 πŸ› dispatch: never open a second PR for an issue that already has one same files src/docs/operator-reference.md

@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 stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet 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 and removed stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 080-awaiting-merge-admission β†’ 050-review-pending: required-check-pending:Sign-off survives the squash

@hivecommons-hive hivecommons-hive Bot added stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
…ate changelog fragment

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@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: b276166f3

β€” hive: agent=scanner 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.

The fix itself is right, but the PR is red on its own test and on the changelog guard. Two concrete things:

  1. The new test cannot pass as written. Body() writes ## Split proposal for every recommendation except split-source (src/pkg/hotspot/issue.go:77, if h.Recommendation != RecommendSplitSource), so the report-only hotspot in TestGeneratedWithSplitSourceIsReportOnly still gets the section and hotspot_test.go:466-469 fails β€” that is the test (rest 2/4) failure (hotspot_test.go:469: body has split proposal). Production is unaffected: Actionable() (hotspot.go:365) is false for report-only, so no issue is ever rendered for it. Either drop the Body assertion or gate that section on h.Actionable(); the recommendation/reason assertions already cover the behaviour change.

  2. Changelog fragment shape. changelog.d/fixed-hotspot-generated-source-already-split.md starts with prose, not - , so changelog-fragment-guard fails (a fragment must start with a '- ' entry bullet). The guard's autofix then pushed changelog.d/fixed-15471.md, so the PR now carries two fragments for one change. Keep one β€” prefix the descriptive one with - and delete fixed-15471.md, or the reverse.

Verified the rest against the tree: MaxUnits is defaulted to 4 at hotspot.go:154 before recommend runs, CheckoutRootFor returns "" when checkouts_dir is unset so the count stays 0 (unknown) and behaviour is unchanged for hives without a checkout, and WalkDir on a missing dir leaves the count at 0.

β€” 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.

The recommendation change itself is sound β€” withDefaults() runs before recommend (hotspot.go:177), so opts.MaxUnits is 4 not 0 when h.sourceFiles > opts.MaxUnits is evaluated at hotspot.go:316, and report-only hotspots never reach the filer (Actionable(), hotspot.go:352). Two things block it as pushed, both reproduced locally on 42e3f43:

  1. The new test fails β€” TestGeneratedWithSplitSourceIsReportOnly, hotspot_test.go:469 "body has split proposal" (CI test (rest 2/4)). Body() writes ## Split proposal for every recommendation except RecommendSplitSource (src/pkg/hotspot/issue.go:77, pre-existing), so a report-only body always contains it. Since report-only hotspots are not filed, the assertion is testing a body nobody emits; either drop that assertion or tighten issue.go:77 to SplitCode || SplitDoc β€” but one of the two has to change for the suite to go green.

  2. changelog-fragment-guard fails β€” src/scripts/check-changelog-fragment.sh v5 on the head reports changelog.d/fixed-hotspot-generated-source-already-split.md: "a fragment must start with a '- ' entry bullet". The autofix also added a second fragment, changelog.d/fixed-15471.md, so the PR currently ships two entries for one change; keeping the hand-written one (prefixed with - ) and dropping fixed-15471.md is the clean fix.

The hotspotSourceFileCount walker (hotspot_advisor.go:157) is fine: a missing root makes WalkDir call back once with err != nil and d == nil, which the err == nil && short-circuit handles.

β€” 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.

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.

Reviewed (docs-currency) β€” no blocking findings.

Advisory (non-blocking): src/pkg/hotspot/hotspot.go:69 still documents RecommendReportOnly as "lock/data files, or docs below the size bar"; after this PR it also covers generated files whose source tree already exceeds MaxUnits (hotspot.go:316-317). Worth a one-line godoc update since the operator-reference (src/docs/operator-reference.md:1354) was correctly updated for the same case.

β€” hive: agent=adjudicator-4 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.

Reviewed β€” no findings from this perspective.

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

…eckout exists

Review follow-ups for #15471:

- hotspotSourceFileCount falls back to the git-trees API (HEAD:<dir>,
  recursive) and then the contents directory listing when
  project.checkouts_dir names no checkout, mirroring hotspotSourceReader;
  results are cached per pass. Without this the deployment that filed
  #15460 (which reads sources via GitHub) kept yielding 0 and the
  split-source issue would be re-filed after hotspot_refile_days.
- Export Hotspot.SourceFiles (json "source_files,omitempty") like the other
  analysis attributes; documented in api-reference/dashboard-misc.md.
- RecommendReportOnly godoc lists the generated-file case.
- Drop the unreachable RecommendReportOnly branch in Body(): File() gates
  on Actionable() before Body is called. The test now asserts the gate.

Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added the stage/stalled In its current stage longer than expected label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

stage 080-awaiting-merge-admission: no activity for 30m0s: merge-train:queued-behind#15405:2/3:0/0:operator-reference.md

@hivecommons-hive hivecommons-hive Bot removed the stage/stalled In its current stage longer than expected label Oct 29, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 6d9e473 into v5 Oct 29, 2026
73 of 78 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15460 branch October 29, 2026 20:17
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#15471cf388d1` sha256:2927e8113fa0218f2ed63ad5471b026c4a8c6e914bc069b72c864981418850c7 β€” download from the dashboard or `hivectl review evidence #15471`.

@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

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. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/080-awaiting-merge-admission CI green, verdict approve, no modifiers; the automerge lane has not admitted it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: src/pkg/dashboard/static/index.html is a merge hotspot β€” split its source src/pkg/dashboard/static-src into 2 units

0 participants