Repository navigation
CLI-1703 Extract shared stats rendering helpers - #1394
Conversation
✅ Deploy Preview for sonarqube-cli canceled.
|
|
The requester review request was unavailable. Add the requester through GitHub’s reviewer picker. The PR remains in draft under the ticket’s keep-draft preference. Generated by Fabrik |
Preserve summary-card and section output while exposing reusable stats-local renderers. Add helper boundaries and baseline-verified snapshots. Co-Authored-By: Fabrik <fabrik@sonarsource.com>
398fe85 to
6fb2222
Compare
Code Review ✅ Approved 🟢 Low risk 1 closed / 1 findingsThe stats renderer is extracted into shared helpers without changing options, data models, or intended output, limiting impact to presentation. Extracts the stats rendering helpers (summary card, bar, sparkline, aligned totals layout) into a shared module so other stats files can import them, with text output unchanged. Resolved the type check failure that appeared when merged with the nullable entitlement change in #1393. No issues remain open. ✅ 1 closed✅ Cross-PR: Type check fails when merged with #1393's nullable entitlement
Verification Rules 3/3 met PRs 1 inspectedFunctional validation No results Rules 3 passed 2 not applicable
Broader impact PRs 1 inspectedCross-PR 1 PR inspected 0 open impacts
Auto-approval Approved For more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|



CLI-1703 https://sonarsource.atlassian.net/browse/CLI-1703
Human description
Stats rendering helpers were private to the text report. Other stats files can now import the summary card, bar, sparkline and aligned totals layout. The text output stays the same.
Agent description
Approach: Move the existing rendering logic to one stats-local module. Keep section rendering and entitlement resolution in the report. Export the widths used by both modules so their alignment stays consistent. No options or data models change.
Acceptance coverage: The helpers are importable. Thirteen unit cases cover charts, alignment, time windows, entitlement placeholders and daily bucketing. Six output snapshots pass against both the original implementation and the extracted helpers. All fourteen existing stats integration tests pass. Type checking, lint and formatting pass. Full platform suites remain to current-head CI.
Vortex: Project SonarSource_sonarqube-cli is bound, with context and analysis enabled. Vortex supplied project guidelines and TypeScript guidance for complexity, types and tests. The extraction preserves dependency direction and uses type-only imports. DEEP analysis found no issues. Changed-file secrets scanning found no secrets. Dependency scanning found sixteen existing risks, including deliberately vulnerable E2E fixtures. No manifest or lockfile changes are included.
Decision record: none required or changed. The implementation follows the bounded extraction plan. Human approval and merge remain required.
Assumptions and warnings: Interpret short/full as the existing rendering consumers; this change adds no new view. The linked Confluence refinement was unavailable, so the explicit unchanged-output criteria define this refactor. Reviewers can correct that interpretation if needed. Root agent instructions exist, but the repository has no ADR directory; no guidance files are added. Dependency risks remain outside this refactor.
Validation gaps: The restricted independent-review sandbox could not reproduce eight scanner-dependent integration cases because scanner or hook setup failed. All fourteen cases passed in both the task workspace and clean host preparation at this head. Preserve that host evidence and confirm scanner coverage in current-head CI. Full platform tests and the repository Sonar gate await CI.
Attachments used: none; the refreshed inventory is complete and empty.
Independent review: clean, round 1, gpt-6.1-sol, zero blocking findings. The reviewer independently passed thirteen helper tests, six snapshots, type checking and focused lint.
Usage: gpt-6.1-sol, 4,553,250 processed tokens across run sessions, including 525,960 review tokens. These are measured processing totals, not billing.
This PR was opened as a draft by the autonomous Fabrik workflow. Keep draft per the ticket's fabrik-keep-draft label. The requester will mark it ready after all mechanical gates pass. Human approval and merge are required.
🤖 Co-authored by Fabrik