Skip to content

fix(quality): clear SonarCloud Quality Gate on main#73

Merged
aksOps merged 1 commit into
mainfrom
fix/sonarqube-quality-gate-cleanup
Apr 30, 2026
Merged

fix(quality): clear SonarCloud Quality Gate on main#73
aksOps merged 1 commit into
mainfrom
fix/sonarqube-quality-gate-cleanup

Conversation

@aksOps

@aksOps aksOps commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Clear the 21 security hotspots blocking the SonarCloud Quality Gate on main after PR #71 (UI design-system) and PR #72 (storage rebalance) merged.

Hotspot Severity Treatment
internal/ui/templates/*.html external CDN loads (Web:S5725) LOW Deleted — templates were embedded but never executed; React SPA in dist/ owns all routes. Pure dead code.
internal/storage/retention.go fmt.Sprintf("VACUUM ANALYZE %s", t) (go:S2077) HIGH Refactored — replaced format pattern with a []struct{table, sql string} literal so the SQL is a static string with no taint flow. Same behaviour.
16× test/*/main.go math/rand (go:S2245) MEDIUM Marked Safe in SonarCloud separately — chaos simulator services use math/rand for non-cryptographic latency jitter and failure-mode selection. Test code only.

Bonus cleanup: removed tmpl field, html/template import, and the orphaned fmtNum helper from internal/ui/ui.go since they only existed to feed the now-deleted templates.

Test plan

  • go vet ./... — clean
  • go test ./... — 516 pass / 27 packages
  • go build ./... — clean
  • CI green (especially SonarCloud)
  • After merge: SonarCloud Quality Gate clears on main (16 test/* hotspots marked Safe via API)

🤖 Generated with Claude Code

Three-part cleanup to clear the 21 security hotspots blocking the
SonarCloud Quality Gate on main after the design-system + storage
rebalance merges.

Changes
  * internal/ui/ui.go: drop the embedded HTML template machinery.
    The four base.html/header.html templates were embedded and parsed
    at startup but never executed — the React SPA in dist/ owns every
    route. Removing the dead code eliminates 4 LOW Web:S5725 hotspots
    (external CDN script/font tags violating rules/build.md). Removed
    fields, the html/template import, and the orphaned fmtNum helper.
  * internal/ui/templates/: deleted (base.html, header.html and the
    two unused partials). Pure dead code surviving the design-system
    migration.
  * internal/storage/retention.go: drop fmt.Sprintf for the per-table
    VACUUM ANALYZE / OPTIMIZE TABLE statements. The table names were
    already a hardcoded literal slice but the format pattern triggers
    the go:S2077 SQL-injection sniffer. Replaced with a struct slice
    holding literal SQL strings — same behavior, no taint flow for
    static analysis to follow.

Not changed in this PR (separately marked Safe in SonarCloud)
  * 16 MEDIUM go:S2245 hits on test/*/main.go — math/rand calls inside
    chaos simulator services. Non-cryptographic context (latency
    jitter, failure-mode selection); not a real security finding.

Verification
  * go vet ./... clean
  * go test ./... — 516 pass / 27 packages
  * go build ./... clean

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@aksOps aksOps merged commit 6edfbf1 into main Apr 30, 2026
17 checks passed
@aksOps aksOps deleted the fix/sonarqube-quality-gate-cleanup branch April 30, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant