Chapter 02Lesson 02~125 minutes

SonarQube Product Model, Editions, Components, and Architecture: Guided Hands-On Workflow

Run one disposable Community Build analysis and prove every transition from Git revision through scanner/report, Compute Engine task, durable result, and gate evidence.

Community BuildScannerceTaskIdEvidenceWeb API

Learning objectives

  • Create a synthetic, local-only analysis fixture.
  • Record source, product, scanner/runtime, endpoint, project, and token-scope assumptions before execution.
  • Preserve report/task metadata and correlate it to server-side processing.
  • Inspect durable project/policy state after Compute Engine completion.
  • Map the workflow to commercial Server, DCE, Cloud, and IDE boundaries without requiring paid features.

1. Safe lab contract

Reuse the disposable Community Build pattern from Chapter 01. The target must be loopback or private lab infrastructure; source must be synthetic; credentials must be fake/rotatable and injected at runtime. Record the exact Community Build version/image/package and current scanner/runtime rather than assuming them from memory.

Abort: stop if the endpoint is production/shared, the source tree is proprietary, or the token scope/project ownership is unclear.
export SONAR_HOST_URL="http://127.0.0.1:9000"
export SONAR_PROJECT_KEY="sq-arch-lab"
# Keep SONAR_TOKEN in an interactive/temporary secret source.
# Never commit or echo it.

2. Create a revision you can prove

mkdir sq-arch-lab && cd sq-arch-lab
git init
printf 'def ratio(total, count):
    return total / count
' > app.py
git add app.py
git commit -m "lab: architecture baseline"
git rev-parse HEAD
git status --short

Record the SHA and clean/dirty status. Revision identity is part of analysis evidence, not decorative Git metadata.

3. Inventory before mutation

Evidence Example Owner Purpose
Product Community Build 26.9.0.129388 Server Pins product/edition behavior
Endpoint http://127.0.0.1:9000 Network Proves trust boundary
Project key sq-arch-lab SonarQube project Correlates task/result
Revision Git SHA SCM Identifies source
Scanner/runtime actual command output Scanner process Pins client compatibility
Plugins/integrations recorded inventory Server/external Explains analyzer/provider behavior

Use supported UI/API/system-information surfaces. Do not query or edit internal database/search state directly.

4. Run the smallest analysis

Use the current scanner documented for the sample. Record its version and JRE/runtime behavior because JRE auto-provisioning and scanner packaging evolve. Keep configuration minimal and explicit.

sonar.projectKey=sq-arch-lab
sonar.sources=.
sonar.sourceEncoding=UTF-8

Run with the token injected securely. Preserve the scanner log with secrets redacted. Capture indexed-file/report-upload evidence and the metadata written to the scanner work directory. A line that resembles “execution success” proves only the client phase.

Prediction A: the scanner can upload a report before the final quality-gate state exists. Verify that the server task is a separate state.

5. Correlate to Compute Engine

Preserve the task identifier emitted in the scanner/report metadata—commonly ceTaskId in current workflows. Use the supported background-task UI or API to observe queued/in-progress/success/failed/canceled state. If the Web API endpoint changes or migrates to V2, follow the current docs and record the endpoint/version choice.

# Verify the current endpoint before automation.
curl -sS -u "$SONAR_TOKEN:"   "$SONAR_HOST_URL/api/ce/task?id=$CE_TASK_ID"
Prediction B: a successful CE task changes server project state but does not alter your Git SHA. Verify both independently.

6. Inspect the durable result and policy

After CE success, record analysis revision/timestamp, issue/measure summary, active quality profile, New Code definition, and quality-gate result. The evidence chain should read:

Git SHA → scanner/runtime → effective parameters → report/upload → ceTaskId → CE status → project analysis → profile/New Code/gate → UI/API/provider consumer

Do not rank developers by counts and do not infer that a green gate proves runtime correctness or complete security.

7. Map the workflow to other product choices

Environment Same concept Changed ownership/capability
Community Build scanner → task → project result free feature/language set
Developer/Enterprise Server same evidence chain commercial capabilities/licensing
Data Center same task/project semantics clustered application/search topology
SonarQube Cloud scanner → hosted result Sonar operates service infrastructure
SonarQube for IDE rule-driven feedback local IDE context; no server CE task by itself

8. Challenge: name the owner before the fix

  1. Upload succeeds, project never updates: inspect the CE task.
  2. Project analysis exists, PR has no decoration: inspect provider/integration state.
  3. IDE and server findings differ: compare revision/scope/connected policy.
  4. Expected commercial language is absent: verify current edition/language matrix.
  5. Search/UI is unhealthy: preserve supported health/log/resource evidence; do not delete search data blindly.

9. Verification and cleanup

  • Verify SHA, task ID, and project result correlate.
  • Verify no token appears in Git/log artifacts.
  • Preserve redacted first-failure evidence before cleanup.
  • Delete only the disposable project through supported UI/API if needed.
  • Stop/remove only lab containers/volumes and synthetic files you created.

Knowledge check

What proves that server-side processing finished?

Why record the Git SHA before scanning?

The scanner says success but CE failed. Did analysis complete?

Should a learner edit the SonarQube database to prove persistence?

What is the mandatory free fallback for Data Center capabilities?

Next lesson

Turn observations into architecture choices

Lesson 3 compares products, editions, topologies, and feedback planes.

Official references and version notes

Version and edition note

Rechecked 2026-09-07. The mandatory lab path uses Community Build 26.9.0.129388. SonarQube Server Developer, Enterprise, and Data Center editions are on 2026 Release 4.1, while 2026.1.5 is the active LTA patch line. Scanner/JRE provisioning, language support, APIs, plugins, and edition capabilities evolve independently; re-check current primary documentation before applying this snapshot.

Version and compatibility note

SonarQube product names, editions, release trains, scanner runtimes, APIs, authentication options, and platform prerequisites can change independently. Re-check the linked SonarSource primary documentation for the exact target release before applying version-sensitive commands or operational guidance outside the disposable course environment.

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.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.