Checkpoint Lab — Projects, Tokens, Scanners, Analysis Parameters, and First Analysis
Complete one end-to-end local analysis with a scoped token, record effective inputs and task/gate evidence, revoke the credential, and prove cleanup without erasing durable analysis state.
Learning objectives
- Execute one complete Community Build analysis of the synthetic fixture.
- Predict and verify source/indexing/task/policy/credential state transitions.
- Preserve a sanitized evidence packet that can reconstruct the run.
- Demonstrate token revocation while keeping completed analysis history.
- State exactly what the checkpoint proves and what remains outside scope.
1. Checkpoint charter
Analyze sonar-p06-lab against local Community Build
26.9.0.129388 using Scanner CLI
8.1.0.6389, project key
academy-sonarqube-p06, and a newly generated project
analysis token. Follow the analysis into the exact CE task and gate,
then revoke the token.
2. Exact assumptions
| Item | Assumption | Evidence |
|---|---|---|
| SonarQube | Community Build 26.9.0.129388, local/private | server version/system info |
| Scanner | CLI 8.1.0.6389 | sonar-scanner --version |
| Scanner JRE | auto-provisioned/current unless deliberately disabled | scanner runtime evidence |
| Source | synthetic Python fixture | Git hash + clean status |
| Credential | new project analysis token | type/project/owner/expiry/revocation metadata; never value |
| Database/plugins | disposable prior-chapter server; no third-party plugin required | record actual DB/server info or “none required” |
| CI/IDE/provider | not used | explicitly state not used |
| Commercial features | not used | Community Build path |
3. Predictions before the run
src/app.pyis the intended indexed source.-
Successful upload creates fresh
report-task.txtand a newceTaskId. - After CE SUCCESS, the existing project receives a new analysis and gate evaluation.
- Revoking the token blocks future use but leaves that analysis durable.
4. Preflight
cd sonar-p06-lab
git status --short
REVISION=$(git rev-parse HEAD)
printf 'revision=%s
' "$REVISION"
cat sonar-project.properties
sonar-scanner --version
curl --fail --silent http://127.0.0.1:9000/api/server/version
Verify the project key/name in the UI. If missing, recreate the disposable project with the exact key; do not silently alter repository identity to match an accidental project.
5. Create the checkpoint token
Generate a new project analysis token. Record only its label, type, associated project, issuer, expiry/lifetime choice, generation time, and later revocation time. Never place the raw value in the evidence packet.
6. Execute and preserve client evidence
export SONAR_HOST_URL='http://127.0.0.1:9000'
read -rsp 'Disposable project token: ' SONAR_TOKEN; echo
export SONAR_TOKEN
sonar-scanner -Dsonar.host.url="$SONAR_HOST_URL" | tee scanner-run.log
cp .scannerwork/report-task.txt report-task.checkpoint.txt
cat report-task.checkpoint.txt
Before storing/sharing logs, search for token material and environment dumps. Do not enable debug unless normal evidence is insufficient and explicit redaction controls are in place.
7. Follow the exact server task
CE_TASK_ID=$(awk -F= '$1=="ceTaskId"{print $2}' report-task.checkpoint.txt)
curl --fail --silent -H "Authorization: Bearer $SONAR_TOKEN" "$SONAR_HOST_URL/api/ce/task?id=$CE_TASK_ID" > ce-task.json
If PENDING/IN_PROGRESS, query again after a short interval. If FAILED, stop the success checklist, preserve the terminal response, and apply Lesson 4 before rerun.
8. Verify measures/issues/gate after CE success
- Confirm project identity and newest analysis context.
- Record Issues and Measures without asserting a fixed count.
- Record gate name and status.
- Use an API response only if the current token has documented permission; otherwise use UI evidence or a separate governed read token.
curl --fail --silent -H "Authorization: Bearer $SONAR_TOKEN" "$SONAR_HOST_URL/api/qualitygates/project_status?projectKey=academy-sonarqube-p06" > quality-gate.json
9. Revoke and prove final credential state
- Revoke the checkpoint token in My Account → Security.
- Record the revocation timestamp.
-
Clear
SONAR_TOKENfrom the process environment. - Do not retrieve the raw token from logs/history merely to test it; the UI revocation record is valid evidence.
- Refresh the project and verify the completed analysis remains.
Desired final state: analysis durable; credential invalid.
10. Required evidence packet
manifest.txt — server/scanner/JRE assumptions, project
key/name, Git revisionsonar-project.properties —
sanitized project-local analysis configscanner-run.log
— sanitized first-run logreport-task.checkpoint.txt
— task bridge / CE task IDce-task.json — terminal
CE statusquality-gate.json or UI note — final
policy resulttoken-record.txt —
scope/owner/expiry/revocation metadata, never token valuelimitations.md
— what this run does and does not establish
11. Claims and limitations
This proves: the recorded synthetic revision and effective inputs were accepted by the chosen scanner/server path; the report was processed; the recorded project/gate result existed; and the disposable token was revoked.
It does not prove: every language/build is configured correctly, branch/PR analysis or provider decoration works, security analysis is exhaustive, CI policy is correct, or production HA/backup/upgrade operations are ready. Those need later chapter evidence.
12. Guarded cleanup
- Ensure token revocation and environment cleanup.
-
Keep the disposable project if later lessons will reuse it;
otherwise delete only
academy-sonarqube-p06using supported project controls after verifying the key. - Remove the local synthetic repository only after preserving the sanitized evidence packet.
- Never delete SonarQube database/search volumes or global server state as project-level cleanup.
Knowledge check
What final state should exist after checkpoint cleanup?
Completed analysis remains durable; the disposable project token is revoked/unusable.
Which artifact ties upload to CE processing?
report-task.txt and its ceTaskId.
Why include the Git revision?
It ties evidence to the exact source state that was analyzed.
CE is SUCCESS but gate is ERROR. What failed?
Quality policy, not scanner/CE processing.
Why is deleting database volumes invalid cleanup?
Those volumes contain broader durable server state unrelated to a project-scoped lab.
What if a future API endpoint differs?
Use the API docs embedded in the exact instance and account for the gradual Web API V2 migration.
Official references and version notes
- SonarQube downloads — current Community Build and Server release identities.
- Managing your tokens — user, project-analysis, and global-analysis token semantics.
- Analysis-parameter configuration overview — precedence and persistence.
- Managing JRE auto-provisioning and scanner environment requirements.
- SonarScanner CLI 8.1.0.6389 and official scanner metadata.
- Web API — bearer authentication and the gradual Web API V2 transition.
- CI integration overview — asynchronous processing and quality-gate waiting.
Rechecked on 2026-09-07. Mandatory examples target local/private Community Build 26.9.0.129388 and standalone SonarScanner CLI 8.1.0.6389. JRE auto-provisioning is supported by current Scanner CLI and is enabled by default unless deliberately disabled; when disabled, use the current documented scanner Java requirement rather than legacy guidance. No commercial edition, branch/PR analysis, third-party plugin, IDE connected mode, CI provider, managed database, or cloud account is required.
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.