fix: generate mandatory analytics.pb in fabricated scanner report#480
Conversation
Compute Engine now hard-rejects analysis reports missing analytics.pb (SonarQube Server/Cloud change as of 2026-07-06). Add the Analytics message to the scanner report proto and write analytics.pb with ci_name=sonar-migration-tool so migrated analyses are accepted and distinguishable from real scanner runs. Fixes #478 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Code Review ✅ ApprovedAdds mandatory analytics.pb file to fabricated scanner reports to satisfy Compute Engine schema requirements. No issues found. 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 |
|
|
Code Review:
|
Review + live e2e — safe to merge ✅Reviewed the change and ran a full live Code review
Live e2e
No regression attributable to this change. Unrelated aside from the same run: the e2e surfaced a pre-existing hotspot-migration gap (target 0 vs 31 on source, all in REVIEWED state on the source). This PR touches only report packaging — the hotspot migration/extract code is unchanged — so it's out of scope here, but worth a separate look. |
joshua-quek-sonarsource
left a comment
There was a problem hiding this comment.
All Good
|
Did a Live Test and it runs properly. The "Safe" hotspots did NOT get migrated. |



Summary
analytics.pb(server-side change, RP-1034, effective 2026-07-06)Analyticsmessage toscanner-report.proto(mirrors theScannerReport.Analyticsschema from sonar-scanner-engine) and regenerated the Go bindingsPackageReport()now writesanalytics.pbwith a single propertyci_name=sonar-migration-tool, so migrated analyses are accepted by CE and identifiable as coming from this toolFixes #478
Test plan
go build ./...go vet ./...go test ./internal/scanreport/...(updatedTestPackageReportMinimalto assertanalytics.pbis present in the zip)🤖 Generated with Claude Code