feat(sonarqube): SonarQube MCP quality gate integration#81
Merged
Conversation
Phase 1-2 implementation: - SonarqubeConfig in config.rs with server_url, token, project_key, org, timeouts - src/sonarqube.rs: async quality gate client with polling and failed condition reporting - scripts/sonarqube_gate.py: standalone CLI poller for use in CI and pre-PR hooks - docs/sonarqube-mcp.md: 3-phase integration guide (MCP config -> CI gate -> Cartograph signals) - config.example.toml: [sonarqube] section with all fields documented The MCP integration path (Phase 1) requires only adding the sonarqube-mcp Docker container to Sparks' MCP config -- no code changes needed for basic agent access. Phase 2 wires the quality gate into the CI pipeline before PR creation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erry-pick merge The cherry-pick from feat/memory-dedup-decay auto-merged config.rs and main.rs in ways that lost the SonarqubeConfig struct, Serialize import, sonarqube field in Config, and mod sonarqube declaration. This commit restores all of them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SonarQube and SonarCloud authenticate via HTTP Basic with the token as the username and an empty password (base64(token:)). The previous bearer_auth call sent Authorization: Bearer <token>, which returns 401 on every request. The Python poller (sonarqube_gate.py) already used the correct Basic scheme; this aligns the Rust client with it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1f52ea0 to
99e5e2e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Integrates SonarQube into Sparks as a 3-phase quality gate loop:
Phase 1 (zero code change): Add the `sonarqube-mcp` Docker container to Sparks' MCP config — agents can call it for quality verification immediately.
Phase 2 (this PR): `src/sonarqube.rs` async client + `scripts/sonarqube_gate.py` CLI poller — mandatory gate before PRs open.
Phase 3 (future): Feed historical data into Cartograph's Dynamics layer as quality signals.
The workflow loop: write code → SonarQube MCP check → fix → repeat until clean → open PR.
Changes
Type of Change
Pre-PR Checklist