CLI-499 skip sqaa during global integration#312
CLI-499 skip sqaa during global integration#312sophio-japharidze-sonarsource wants to merge 1 commit into
Conversation
9a3d012 to
74ba72a
Compare
87c9bd8 to
b56884b
Compare
SummaryWhat changed: This PR prevents SQAA (SonarQube Agentic Analysis) from being installed during global integration, even when the organization is entitled to it. SQAA is project-scoped functionality that must only be installed on a per-project basis. Changes made:
Why it matters: Prevents a scope violation where project-level state/hooks were being installed globally, which would cause issues with per-project SQAA setup later. What reviewers should knowStart here: Look at the core logic changes in both Key decisions:
What reviewers should verify:
|
30974b8 to
9dc48b6
Compare
b56884b to
8815a8f
Compare
8815a8f to
91af181
Compare
|
There was a problem hiding this comment.
Clean, well-scoped fix. The installSqaa = !isGlobal && sqaaEntitled guard is applied consistently across all three call sites (runMigrations, installSqaaHook, updateStateAfterConfiguration), and the runHealthCheckAndRepair refactor faithfully preserves the original repair logic. One logic duplication worth tidying up.
| if (sqaaEntitled) { | ||
| warn( | ||
| 'SonarQube Agentic Analysis is project-scoped and is not enabled by this global install. Run `sonar integrate claude --project <key>` from a project directory to enable it for that project.', |
There was a problem hiding this comment.
Logic duplication: This warning message is functionally identical to the one in src/cli/commands/integrate/copilot/index.ts:108-110 — same first sentence, same structure, only the command name differs. Any future wording change (e.g. renaming "SonarQube Agentic Analysis" or adjusting the hint syntax) requires two edits in non-obvious locations.
Extract a shared helper parameterised on the integration name (e.g. in integrate/_common/):
export function warnSqaaSkippedOnGlobalInstall(integration: 'claude' | 'copilot'): void {
warn(
`SonarQube Agentic Analysis is project-scoped and is not enabled by this global install. ` +
`Run \`sonar integrate ${integration} --project <key>\` from a project directory to enable it for that project.`,
);
}Then call it from both reportHookInstallationOutcome and reportInstallationOutcome.



No description provided.