Conversation
ToreMerkely
commented
Apr 15, 2026
- Added hard coded test for sonarqube PR scan to reproduce error server/#5348
- Fixed problem and change to use kosli attest sonar for test
|
Claude finished @ToreMerkely's task in 2m 38s —— View job PR Review: #780 — SonarQube PR Scan Fix
Static AnalysisAll checks pass: SummaryThis PR fixes SonarQube PR scan support (server/#5348) by:
The core fix is well-structured — the PR/branch detection in IssuesPre-existing: Response body leaks (not introduced by this PR)Three functions still have response body close issues. These are pre-existing but worth cleaning up since the file is already being improved:
Fix all three body close issues → Nit:
|
…t-task.txt access Allows users to pass the SonarQube CE task URL directly, bypassing the need for the .scannerwork/report-task.txt file. This solves the case where the scanner and the Kosli CLI run in different containers (e.g. Jenkins with Kubernetes pod agents) and don't share a filesystem. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reorder the error check to come before taskRequest.Header.Add() to prevent a nil pointer dereference if NewRequest fails. Pre-existing bug, but now more reachable via the new --sonar-ce-task-url flag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ctions Same nil pointer dereference pattern as fixed in GetCETaskData, now fixed in GetProjectAnalysisFromRevision, GetProjectAnalysisFromAnalysisID, GetQualityGate, and GetTaskID. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add instructions for updating the PR scan test fixture to update-sonarqube-test-data.txt. Fix comment on readFile that incorrectly claimed it extracts the project key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Response body was never closed, leaking connections. Also moved the error check before the loop for consistency with GetPRAnalysisData. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>