opencode-sonarqube 1.2.31 → 1.2.32

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.
Files changed (2) hide show
  1. package/dist/index.js +86 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20674,7 +20674,7 @@ Fix these issues before ${operationType === "commit" ? "committing" : "pushing"}
20674
20674
  }
20675
20675
  if (fixBeforeCommit && autoFix) {
20676
20676
  await sendAutoFixPrompt(analysisResult);
20677
- return { block: shouldBlock, message: "SonarQube is fixing issues. Please wait and try again." };
20677
+ return { block: shouldBlock, message: "Quality gate FAILED. Run sonarqube({ action: 'issues' }) to see problems, then fix them before committing." };
20678
20678
  }
20679
20679
  const warningMessage = await sendBlockingMessage(analysisResult.issues, shouldBlock, autoFix);
20680
20680
  return { block: shouldBlock, message: warningMessage };
@@ -20874,8 +20874,55 @@ Git operation completed with changes. Consider running:
20874
20874
  const result = await handleGitOperationCheck(output, "commit");
20875
20875
  safeLog(`[pre-check] commit check result: block=${result.block}, message=${result.message}`);
20876
20876
  if (result.block && args) {
20877
- args.command = `echo "\uD83D\uDEAB BLOCKED BY SONARQUBE: ${result.message || "Quality gate failed"}" && exit 1`;
20878
- safeLog(`[pre-check] Commit BLOCKED - command replaced`);
20877
+ const aiMessage = `echo "
20878
+ ================================================================================
20879
+ \uD83D\uDEAB COMMIT BLOCKED BY SONARQUBE
20880
+ ================================================================================
20881
+
20882
+ WHAT IS SONARQUBE?
20883
+ SonarQube is a code quality tool that analyzes your code for bugs, vulnerabilities,
20884
+ security issues, and code smells. This project has pre-commit blocking enabled,
20885
+ which means commits are blocked if the code quality is not good enough.
20886
+
20887
+ WHY WAS THIS BLOCKED?
20888
+ Your commit was blocked because the SonarQube quality gate FAILED. This means
20889
+ there are code quality issues that need to be fixed before you can commit.
20890
+
20891
+ HOW TO FIX THIS:
20892
+
20893
+ Step 1: See what issues were found
20894
+ Use the sonarqube tool to view the issues:
20895
+ sonarqube({ action: 'issues' })
20896
+
20897
+ Step 2: Understand the issues
20898
+ Each issue shows:
20899
+ - Severity (BLOCKER, CRITICAL, MAJOR, MINOR, INFO)
20900
+ - The file and line number
20901
+ - A description of the problem
20902
+ - Often a suggestion for how to fix it
20903
+
20904
+ Step 3: Fix the issues in your code
20905
+ Edit the files to resolve the issues. Common issues include:
20906
+ - Hardcoded passwords or API keys
20907
+ - SQL injection vulnerabilities
20908
+ - Unused variables
20909
+ - Code duplication
20910
+ - Missing null checks
20911
+
20912
+ Step 4: Try committing again
20913
+ After fixing the issues, try your commit again.
20914
+
20915
+ USEFUL SONARQUBE COMMANDS:
20916
+ - sonarqube({ action: 'issues' }) - See all issues
20917
+ - sonarqube({ action: 'issues', severity: 'critical' }) - See critical+ issues only
20918
+ - sonarqube({ action: 'analyze' }) - Re-run analysis
20919
+ - sonarqube({ action: 'status' }) - Check quality gate status
20920
+
20921
+ IMPORTANT: Do NOT retry the commit without fixing the issues first!
20922
+ ================================================================================
20923
+ " && exit 1`;
20924
+ args.command = aiMessage;
20925
+ safeLog(`[pre-check] Commit BLOCKED - command replaced with AI-friendly message`);
20879
20926
  await showToast("Commit blocked by SonarQube quality gate!", "error");
20880
20927
  }
20881
20928
  }
@@ -20883,8 +20930,42 @@ Git operation completed with changes. Consider running:
20883
20930
  safeLog(`[pre-check] Detected git push, running quality check...`);
20884
20931
  const result = await handleGitOperationCheck(output, "push");
20885
20932
  if (result.block && args) {
20886
- args.command = `echo "\uD83D\uDEAB BLOCKED BY SONARQUBE: ${result.message || "Quality gate failed"}" && exit 1`;
20887
- safeLog(`[pre-check] Push BLOCKED - command replaced`);
20933
+ const aiMessage = `echo "
20934
+ ================================================================================
20935
+ \uD83D\uDEAB PUSH BLOCKED BY SONARQUBE
20936
+ ================================================================================
20937
+
20938
+ WHAT IS SONARQUBE?
20939
+ SonarQube is a code quality tool that analyzes your code for bugs, vulnerabilities,
20940
+ security issues, and code smells. This project has pre-push blocking enabled,
20941
+ which means pushes are blocked if the code quality is not good enough.
20942
+
20943
+ WHY WAS THIS BLOCKED?
20944
+ Your push was blocked because the SonarQube quality gate FAILED. This means
20945
+ there are code quality issues that need to be fixed before you can push.
20946
+
20947
+ HOW TO FIX THIS:
20948
+
20949
+ Step 1: See what issues were found
20950
+ sonarqube({ action: 'issues' })
20951
+
20952
+ Step 2: Fix the issues in your code
20953
+
20954
+ Step 3: Commit your fixes
20955
+ git add . && git commit -m 'fix: resolve code quality issues'
20956
+
20957
+ Step 4: Try pushing again
20958
+
20959
+ USEFUL SONARQUBE COMMANDS:
20960
+ - sonarqube({ action: 'issues' }) - See all issues
20961
+ - sonarqube({ action: 'analyze' }) - Re-run analysis
20962
+ - sonarqube({ action: 'status' }) - Check quality gate status
20963
+
20964
+ IMPORTANT: Do NOT retry the push without fixing the issues first!
20965
+ ================================================================================
20966
+ " && exit 1`;
20967
+ args.command = aiMessage;
20968
+ safeLog(`[pre-check] Push BLOCKED - command replaced with AI-friendly message`);
20888
20969
  await showToast("Push blocked by SonarQube quality gate!", "error");
20889
20970
  }
20890
20971
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sonarqube",
3
- "version": "1.2.31",
3
+ "version": "1.2.32",
4
4
  "description": "OpenCode Plugin for SonarQube integration - Enterprise-level code quality from the start",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",