Checkpoint Lab — SonarQube for IDE Connected Mode and Developer Feedback Loops
Bind a local IDE to a disposable project, prove one synchronized-rule effect, and then prove the independent handoff to scanner, Compute Engine, Quality Gate, credential cleanup, and audit evidence.
Learning objectives
- Complete an end-to-end Connected Mode checkpoint using Community Build and SonarQube for VS Code.
- Predict and verify at least two independent local/server state changes before acting.
- Prove a server rule/profile parameter is synchronized into local IDE feedback without changing source revision.
- Prove the handoff from developer feedback to a fresh scanner/Compute Engine/Quality Gate result.
- Produce an evidence packet separating IDE user credentials, scanner credentials, binding identity, Git revision, local issue state, and server result.
- Disconnect and revoke credentials without deleting unrelated project/profile state.
1. Checkpoint scenario
A development team wants fast local feedback but does not want
developers to treat editor state as a release gate. Your checkpoint
is to bind VS Code to sq-ch20-ide-lab, synchronize one
safe rule parameter, demonstrate a predictable local finding change
at the same Git SHA, and then prove that the final governed result
comes from a separate server analysis.
2. Exact assumptions and preflight
| Assumption | Evidence required |
|---|---|
| Community Build | 26.9.0.129388 system/status |
| SonarQube for VS Code | 5.9.1 baseline or a recorded later compatible version |
| IDE runtime | JRE 17+ requirement; record extension/runtime log where available |
| Scanner | SonarScanner CLI 8.1.0.6389 |
| Project | sq-ch20-ide-lab |
| IDE auth | Disposable user token, personal to the lab developer |
| Scanner auth | Separate project-analysis token |
| Commercial features | None required; server-only analyzer examples remain explanatory/optional |
git branch --show-current
git rev-parse HEAD
git status --short
code --version
code --list-extensions --show-versions | grep -i sonar || true
sonar-scanner --version
curl -fsS "http://localhost:9000/api/system/status"
3. Predictions before changing state
Write at least these predictions in
evidence/predictions.md:
-
Prediction A: binding the workspace to
sq-ch20-ide-labwill replace standalone rule ownership with server-profile-driven settings for locally supported rules. -
Prediction B: changing the disposable server
profile’s
python:S3776threshold while keeping the Git SHA unchanged will change the local issue state after binding synchronization. -
Prediction C: the subsequent server analysis will
produce a new
ceTaskIdand authoritative server result even though the IDE already displayed a local finding. - Prediction D: revoking the IDE user token will break the Connected Mode trust path but will not invalidate the separate scanner project-analysis token until that token is revoked.
4. Capture the standalone baseline
- Open the fixture in VS Code with SonarQube for IDE installed.
-
Confirm there is no active binding to
sq-ch20-ide-lab. -
Record extension version and local issue state for
src/decision.py. -
Record the locally visible configuration of
python:S3776if supported. - Save the extension Output/log excerpt without tokens.
Export a short note as evidence/ide-standalone.md. This
is the control observation.
5. Create the correct connection and binding
Create a disposable SonarQube user token. In the Connected Mode panel, configure:
connection_name = sq-ch20-local
server_url = http://localhost:9000
credential_type = USER TOKEN
binding_project_key = sq-ch20-ide-lab
workspace = <exact local repository root>
Capture the binding success and project identity, but never the token value. If a shared binding configuration is exported, inspect it before committing and confirm it contains only supported project/server identity metadata, not user credentials.
6. Apply and verify one synchronized policy change
-
Create/assign a disposable custom Python quality profile to
sq-ch20-ide-lab. -
Record the parent/profile name and current
python:S3776threshold. - Change only that threshold so the fixed fixture crosses it.
-
Do not edit
src/decision.py; prove the Git SHA is unchanged. - Refresh/update the Connected Mode binding.
- Record the IDE log and local issue state after synchronization.
same Git SHA + same editor source + changed server rule parameter
→ binding refresh → changed local supported-rule result
If the rule is unavailable locally in your installed version, select another locally supported parameterized Python rule and document the substitution. Do not manufacture success by editing source or disabling another rule.
7. Prove the independent governed server handoff
Use the scanner’s separate project-analysis token and analyze the committed revision:
export SONAR_HOST_URL="http://localhost:9000"
export SONAR_PROJECT_KEY="sq-ch20-ide-lab"
read -rsp "Project-analysis token: " SONAR_TOKEN; echo
export SONAR_TOKEN
mkdir -p evidence/server-handoff
git rev-parse HEAD | tee evidence/server-handoff/revision.txt
sonar-scanner -X 2>&1 | tee evidence/server-handoff/scanner.log
cp .scannerwork/report-task.txt evidence/server-handoff/report-task.txt
CE_TASK_ID="$(sed -n 's/^ceTaskId=//p' .scannerwork/report-task.txt)"
printf '%s\n' "$CE_TASK_ID" | tee evidence/server-handoff/ceTaskId.txt
curl -fsS -H "Authorization: Bearer $SONAR_TOKEN" \
"$SONAR_HOST_URL/api/ce/task?id=$CE_TASK_ID" \
| tee evidence/server-handoff/ce-task.json
After Compute Engine reaches a terminal successful state, capture the server issue result and Quality Gate. Your checkpoint is incomplete if it ends at “the IDE showed a squiggle.”
8. Diagnose one deliberate credential fault
Temporarily attempt to configure Connected Mode with the project-analysis token rather than the user token. Preserve the redacted failure/error. Then restore the user token.
This deliberate failure proves that authentication is purpose-specific: scanner success with a project-analysis token does not imply Connected Mode can authenticate with it.
9. Verification checklist
- ☐ Extension/IDE/server/scanner versions recorded.
- ☐ Exact Git branch/SHA and working-tree state recorded before and after synchronization.
- ☐ Standalone local issue/rule state preserved.
- ☐ Connection URL and bound project key independently verified.
- ☐ IDE credential identified as a user token; CI/scanner credential identified separately.
- ☐ Server quality profile and exact synchronized rule/parameter recorded.
- ☐ Same-SHA local issue change verified after synchronization.
- ☐ Fresh scanner run produced a new
ceTaskId. - ☐ Compute Engine terminal state and server Quality Gate recorded independently.
- ☐ Wrong-token-type failure preserved and repaired without weakening security.
10. Required evidence packet
-
assumptions.md— server/IDE/scanner/JRE/edition assumptions and limitations. revision.txtplus working-tree state.-
ide-standalone.md— extension version and local rule/issue state. -
binding.md— server URL, connection name, project key, credential type/owner (never token value). -
profile-before-after.md— profile, rule key, parameter before/after, owner/rationale. -
ide-connected.md— synchronization log/result and local issue state. -
server-handoff/report-task.txt,ceTaskId.txt, Compute Engine status, issue/gate evidence. -
credential-fault.md— redacted wrong-token-type failure and repair. -
limitations.md— IDE-clean ≠ gate pass; server-only analyzer and PR-sync limits.
11. Cleanup and rollback
- Preserve/export the packet before mutation.
- Remove the IDE project binding and disposable connection.
- Revoke the IDE user token and verify it no longer authenticates.
- Revoke the scanner project-analysis token and verify cleanup.
- Restore/delete only the disposable custom profile/project created for this lab.
- Do not alter unrelated global profiles, user accounts, CI secrets, databases, or server settings.
12. What this adds to the production operating model
Chapter 20 adds a fast, user-owned developer feedback loop to the governed platform without weakening the central analysis contract. Project identity and quality-profile policy can be synchronized into supported local analysis, while credentials remain separate by purpose and release decisions remain tied to server/CI evidence.
Chapter 21 moves from developer feedback into Users, Groups, Permissions, Tokens, Authentication, and Authorization, where the identity/permission model behind these user and analysis tokens becomes the primary subject.
Knowledge check
What proves the synchronized rule effect rather than a code change?
The Git SHA/source remain unchanged while the recorded server rule parameter changes, the binding refreshes, and the local supported-rule result changes.
Why does the checkpoint require a fresh server scan after IDE verification?
Because the authoritative shared result comes from scanner/report/Compute Engine/server gate evidence, not the IDE execution.
What does the deliberate wrong-token failure teach?
Authentication credentials are purpose-specific: a project-analysis token can run scans but Connected Mode requires a user token.
If a server-only issue appears after CI but not locally, is the checkpoint inconsistent?
No. That is an expected analyzer-boundary possibility and must be documented, not suppressed.
What must cleanup never remove?
Unrelated users, global profiles, projects, CI secrets, databases, or other shared server state. Cleanup is guarded to lab-owned resources.
What is the bridge to Chapter 21?
The separate user-token and analysis-token trust paths now need a deeper model of users, groups, permissions, token ownership, authentication, and authorization.
Official references and version notes
- SonarQube Server — Connected Mode — product role, supported IDE families, notifications, Open in IDE, and compatibility policy.
- SonarQube for VS Code — Connected Mode — binding, branch awareness, synchronization behavior, PR-analysis synchronization limitation, and connected-mode concepts.
- SonarQube for VS Code — Connected Mode setup — server URL, user-token authentication, project binding, and shareable binding configuration.
- SonarQube for VS Code — Rules and languages — server quality-profile synchronization, local/connected rule behavior, MQR/Standard Experience, and unsupported local rule classes.
- SonarQube for VS Code — Requirements — JRE 17+, embedded-runtime platforms, language-specific requirements.
- SonarQube — Managing tokens — user-token requirement for Connected Mode and analysis-token distinctions.
- SonarQube for VS Code 5.9.1 release — IDE extension baseline used in this chapter.
- SonarQube downloads — current Community Build and Server release streams.
Rechecked 2026-09-08. Mandatory examples target SonarQube Community Build 26.9.0.129388, SonarScanner CLI 8.1.0.6389, and SonarQube for VS Code 5.9.1 (published 2026-08-31). VS Code Connected Mode currently requires a user token; project/global analysis tokens do not function correctly for binding. Connected Mode applies the bound server quality profile/settings to supported local analysis, but architecture/injection and some advanced bug rules can remain server-only. Current VS Code Connected Mode has branch awareness but does not synchronize pull-request analysis. SonarQube for IDE compatibility follows active server/LTA support policy; recheck the IDE/server compatibility matrix, extension release, token rules, and locally supported analyzers before reproducing on a later release.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this
address.