opencode-sonarqube 1.2.31 → 1.2.33

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 +76 -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,43 @@ 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 - CODE QUALITY ISSUES DETECTED
20880
+ ================================================================================
20881
+
20882
+ Your commit was BLOCKED because the code quality check failed.
20883
+
20884
+ ⚠️ DO NOT try to bypass this by:
20885
+ - Deleting opencode.json
20886
+ - Removing the sonarqube plugin
20887
+ - Retrying the same commit repeatedly
20888
+
20889
+ This blocking is INTENTIONAL to maintain code quality!
20890
+
20891
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20892
+
20893
+ TO FIX THIS, follow these steps:
20894
+
20895
+ 1️⃣ FIRST: Check what issues exist
20896
+ Run: sonarqube({ action: 'issues' })
20897
+
20898
+ 2️⃣ THEN: Fix the reported issues in your code
20899
+ Common issues: hardcoded secrets, SQL injection, unused variables, etc.
20900
+
20901
+ 3️⃣ FINALLY: Try committing again AFTER fixing the issues
20902
+
20903
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20904
+
20905
+ AVAILABLE COMMANDS:
20906
+ sonarqube({ action: 'issues' }) → See all code quality issues
20907
+ sonarqube({ action: 'status' }) → Check quality gate status
20908
+ sonarqube({ action: 'analyze' }) → Re-run full analysis
20909
+
20910
+ ================================================================================
20911
+ " && exit 1`;
20912
+ args.command = aiMessage;
20913
+ safeLog(`[pre-check] Commit BLOCKED - command replaced with AI-friendly message`);
20879
20914
  await showToast("Commit blocked by SonarQube quality gate!", "error");
20880
20915
  }
20881
20916
  }
@@ -20883,8 +20918,44 @@ Git operation completed with changes. Consider running:
20883
20918
  safeLog(`[pre-check] Detected git push, running quality check...`);
20884
20919
  const result = await handleGitOperationCheck(output, "push");
20885
20920
  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`);
20921
+ const aiMessage = `echo "
20922
+ ================================================================================
20923
+ \uD83D\uDEAB PUSH BLOCKED BY SONARQUBE - CODE QUALITY ISSUES DETECTED
20924
+ ================================================================================
20925
+
20926
+ Your push was BLOCKED because the code quality check failed.
20927
+
20928
+ ⚠️ DO NOT try to bypass this by:
20929
+ - Deleting opencode.json
20930
+ - Removing the sonarqube plugin
20931
+ - Retrying the same push repeatedly
20932
+
20933
+ This blocking is INTENTIONAL to maintain code quality!
20934
+
20935
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20936
+
20937
+ TO FIX THIS, follow these steps:
20938
+
20939
+ 1️⃣ FIRST: Check what issues exist
20940
+ Run: sonarqube({ action: 'issues' })
20941
+
20942
+ 2️⃣ THEN: Fix the reported issues in your code
20943
+
20944
+ 3️⃣ Commit your fixes
20945
+
20946
+ 4️⃣ FINALLY: Try pushing again AFTER fixing the issues
20947
+
20948
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
20949
+
20950
+ AVAILABLE COMMANDS:
20951
+ sonarqube({ action: 'issues' }) → See all code quality issues
20952
+ sonarqube({ action: 'status' }) → Check quality gate status
20953
+ sonarqube({ action: 'analyze' }) → Re-run full analysis
20954
+
20955
+ ================================================================================
20956
+ " && exit 1`;
20957
+ args.command = aiMessage;
20958
+ safeLog(`[pre-check] Push BLOCKED - command replaced with AI-friendly message`);
20888
20959
  await showToast("Push blocked by SonarQube quality gate!", "error");
20889
20960
  }
20890
20961
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-sonarqube",
3
- "version": "1.2.31",
3
+ "version": "1.2.33",
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",