opencode-sonarqube 1.2.33 → 1.2.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +61 -46
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20666,8 +20666,9 @@ Fix these issues before ${operationType === "commit" ? "committing" : "pushing"}
|
|
|
20666
20666
|
safeLog(`[processAnalysisResult] issues=${JSON.stringify(issues)}, blockingSeverity=${blockingSeverity}`);
|
|
20667
20667
|
const hasBlockingIssues = checkBlockingIssues(issues, blockingSeverity);
|
|
20668
20668
|
safeLog(`[processAnalysisResult] hasBlockingIssues=${hasBlockingIssues}, qualityGate=${analysisResult.qualityGateStatus}`);
|
|
20669
|
-
const
|
|
20670
|
-
|
|
20669
|
+
const qgPassed = analysisResult.qualityGateStatus === "OK" || analysisResult.qualityGateStatus === "NONE";
|
|
20670
|
+
const passedCheck = qgPassed && !hasBlockingIssues;
|
|
20671
|
+
safeLog(`[processAnalysisResult] qgStatus=${analysisResult.qualityGateStatus}, qgPassed=${qgPassed}, hasBlockingIssues=${hasBlockingIssues}, passedCheck=${passedCheck}`);
|
|
20671
20672
|
if (passedCheck) {
|
|
20672
20673
|
await showToast("SonarQube: Quality check passed!", "success");
|
|
20673
20674
|
return { block: false };
|
|
@@ -20876,36 +20877,45 @@ Git operation completed with changes. Consider running:
|
|
|
20876
20877
|
if (result.block && args) {
|
|
20877
20878
|
const aiMessage = `echo "
|
|
20878
20879
|
================================================================================
|
|
20879
|
-
\uD83D\uDEAB COMMIT BLOCKED
|
|
20880
|
+
\uD83D\uDEAB COMMIT BLOCKED - SonarQube Quality Gate Failed
|
|
20880
20881
|
================================================================================
|
|
20881
20882
|
|
|
20882
|
-
Your commit was
|
|
20883
|
+
STOP! Your commit was blocked. DO NOT:
|
|
20884
|
+
❌ Delete opencode.json
|
|
20885
|
+
❌ Remove plugins
|
|
20886
|
+
❌ Retry without fixing issues
|
|
20883
20887
|
|
|
20884
|
-
|
|
20885
|
-
|
|
20886
|
-
|
|
20887
|
-
|
|
20888
|
-
|
|
20889
|
-
|
|
20888
|
+
================================================================================
|
|
20889
|
+
\uD83D\uDCCB YOU HAVE A SONARQUBE TOOL - USE IT!
|
|
20890
|
+
================================================================================
|
|
20891
|
+
|
|
20892
|
+
You have access to the 'sonarqube' MCP tool (same as mcp_sonarqube).
|
|
20893
|
+
Call it NOW to see exactly what issues are blocking you:
|
|
20890
20894
|
|
|
20891
|
-
|
|
20895
|
+
sonarqube({ action: 'issues' }) ← CALL THIS TOOL NOW!
|
|
20892
20896
|
|
|
20893
|
-
|
|
20897
|
+
This tool will show you:
|
|
20898
|
+
- Every issue found in the code
|
|
20899
|
+
- The file and line number
|
|
20900
|
+
- The severity (BLOCKER/CRITICAL/MAJOR/MINOR/INFO)
|
|
20901
|
+
- Description of what's wrong
|
|
20902
|
+
- How to fix it
|
|
20894
20903
|
|
|
20895
|
-
|
|
20896
|
-
|
|
20897
|
-
|
|
20898
|
-
|
|
20899
|
-
|
|
20900
|
-
|
|
20901
|
-
|
|
20904
|
+
Other useful tool calls:
|
|
20905
|
+
sonarqube({ action: 'status' }) ← See why quality gate failed
|
|
20906
|
+
sonarqube({ action: 'analyze' }) ← Re-run analysis after fixes
|
|
20907
|
+
|
|
20908
|
+
================================================================================
|
|
20909
|
+
⚡ WHAT TO DO NOW:
|
|
20910
|
+
================================================================================
|
|
20902
20911
|
|
|
20903
|
-
|
|
20912
|
+
1. CALL THE TOOL: sonarqube({ action: 'issues' })
|
|
20913
|
+
2. READ the issues it returns
|
|
20914
|
+
3. FIX the code problems
|
|
20915
|
+
4. THEN try to commit again
|
|
20904
20916
|
|
|
20905
|
-
|
|
20906
|
-
|
|
20907
|
-
sonarqube({ action: 'status' }) → Check quality gate status
|
|
20908
|
-
sonarqube({ action: 'analyze' }) → Re-run full analysis
|
|
20917
|
+
The quality gate may fail due to issues in existing code, not just your changes.
|
|
20918
|
+
Use sonarqube({ action: 'status' }) to see what conditions failed.
|
|
20909
20919
|
|
|
20910
20920
|
================================================================================
|
|
20911
20921
|
" && exit 1`;
|
|
@@ -20920,37 +20930,42 @@ AVAILABLE COMMANDS:
|
|
|
20920
20930
|
if (result.block && args) {
|
|
20921
20931
|
const aiMessage = `echo "
|
|
20922
20932
|
================================================================================
|
|
20923
|
-
\uD83D\uDEAB PUSH BLOCKED
|
|
20933
|
+
\uD83D\uDEAB PUSH BLOCKED - SonarQube Quality Gate Failed
|
|
20924
20934
|
================================================================================
|
|
20925
20935
|
|
|
20926
|
-
Your push was
|
|
20936
|
+
STOP! Your push was blocked. DO NOT:
|
|
20937
|
+
❌ Delete opencode.json
|
|
20938
|
+
❌ Remove plugins
|
|
20939
|
+
❌ Retry without fixing issues
|
|
20927
20940
|
|
|
20928
|
-
|
|
20929
|
-
|
|
20930
|
-
|
|
20931
|
-
- Retrying the same push repeatedly
|
|
20932
|
-
|
|
20933
|
-
This blocking is INTENTIONAL to maintain code quality!
|
|
20934
|
-
|
|
20935
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
20941
|
+
================================================================================
|
|
20942
|
+
\uD83D\uDCCB YOU HAVE A SONARQUBE TOOL - USE IT!
|
|
20943
|
+
================================================================================
|
|
20936
20944
|
|
|
20937
|
-
|
|
20945
|
+
You have access to the 'sonarqube' MCP tool (same as mcp_sonarqube).
|
|
20946
|
+
Call it NOW to see exactly what issues are blocking you:
|
|
20938
20947
|
|
|
20939
|
-
|
|
20940
|
-
Run: sonarqube({ action: 'issues' })
|
|
20941
|
-
|
|
20942
|
-
2️⃣ THEN: Fix the reported issues in your code
|
|
20948
|
+
sonarqube({ action: 'issues' }) ← CALL THIS TOOL NOW!
|
|
20943
20949
|
|
|
20944
|
-
|
|
20950
|
+
This tool will show you:
|
|
20951
|
+
- Every issue found in the code
|
|
20952
|
+
- The file and line number
|
|
20953
|
+
- The severity (BLOCKER/CRITICAL/MAJOR/MINOR/INFO)
|
|
20954
|
+
- Description of what's wrong
|
|
20945
20955
|
|
|
20946
|
-
|
|
20956
|
+
Other useful tool calls:
|
|
20957
|
+
sonarqube({ action: 'status' }) ← See why quality gate failed
|
|
20958
|
+
sonarqube({ action: 'analyze' }) ← Re-run analysis after fixes
|
|
20947
20959
|
|
|
20948
|
-
|
|
20960
|
+
================================================================================
|
|
20961
|
+
⚡ WHAT TO DO NOW:
|
|
20962
|
+
================================================================================
|
|
20949
20963
|
|
|
20950
|
-
|
|
20951
|
-
|
|
20952
|
-
|
|
20953
|
-
|
|
20964
|
+
1. CALL THE TOOL: sonarqube({ action: 'issues' })
|
|
20965
|
+
2. READ the issues it returns
|
|
20966
|
+
3. FIX the code problems
|
|
20967
|
+
4. Commit your fixes
|
|
20968
|
+
5. THEN try to push again
|
|
20954
20969
|
|
|
20955
20970
|
================================================================================
|
|
20956
20971
|
" && exit 1`;
|