Checkpoint Lab — GitHub, GitLab, Azure DevOps, and Bitbucket Integration
Produce a least-privilege four-provider integration design and one safe end-to-end simulated decoration flow with permission, evidence, revocation, and cleanup proof.
Learning objectives
- Produce a four-provider least-privilege integration design with explicit identities, scopes, endpoints, storage, and revocation.
- Execute a real Community Build analysis and one safe simulated provider-decoration flow.
- Predict and verify at least two independent state changes before execution.
- Diagnose one deliberate provider-permission defect without changing source, gate, profile, or project key.
- Package revision, task, gate, permission, simulated provider, and cleanup evidence.
- Bridge provider trust design into Chapter 19’s CI-runner integration.
1. Checkpoint scenario
You are designing SonarQube integration for four teams that use GitHub, GitLab, Azure DevOps, and Bitbucket Cloud. Production credentials do not exist yet. Your deliverable must contain:
- a least-privilege provider-integration design for all four platforms;
-
one real local SonarQube analysis using
sq-ch18-provider-lab; - one local GitHub-style decoration simulation driven by the real Quality Gate;
- one deliberate provider-scope failure and repair;
- an optional Developer+ sandbox procedure, or an explicit unexecuted limitation;
- credential/revocation and cleanup evidence.
2. Exact version/edition assumptions
| Component | Checkpoint assumption |
|---|---|
| Community Build | 26.9.0.129388 |
| Commercial reference | Server 2026 Release 4.1; 2026.1.5 LTA |
| Scanner | SonarScanner CLI 8.1.0.6389 |
| Java/JRE | Record scanner-reported runtime; modern scanner JRE auto-provisioning may apply |
| Database/plugins | No change required |
| CI/provider | No paid CI/provider sandbox required for mandatory path |
| Native PR decoration | Developer+ only; simulated in mandatory path |
| Identity | Fake provider org/repo names; real disposable SonarQube project token only |
3. Provider integration design dossier
Create provider-design.md with one row per provider:
| Provider | Identity | Minimum integration scope | Secret storage | Revocation |
|---|---|---|---|---|
| GitHub | Dedicated GitHub App | Checks RW, PR RW, Metadata R, private Contents R; optional permissions only when feature requires them | SonarQube sensitive GitHub configuration | Rotate/revoke App key/secret or uninstall from repository/org |
| GitLab | Dedicated Reporter account PAT or Group Access Token |
api for global integration/decoration on
required repositories; narrower import flow where documented
|
SonarQube sensitive GitLab configuration | Revoke token / disable technical identity |
| Azure DevOps | Dedicated technical account PAT | Code read/write for decoration; extension/service endpoint separately owned | SonarQube Azure configuration / Azure service connection secrets | Revoke PAT; create/test replacement before expiry |
| Bitbucket Cloud | OAuth Client + import API token |
Client credentials + Pull requests Read; import token
read:repository:bitbucket
|
SonarQube sensitive Bitbucket configuration | Rotate OAuth secret / revoke API token |
Also record Server base URL/callback expectations and whether provider webhooks are actually required. Do not invent a webhook merely because the provider supports them.
4. Predictions before execution
-
Prediction A: the real Community Build scanner
run will create a
ceTaskId; after CE success, the project will have a queryable Quality Gate state. -
Prediction B: changing only simulated provider
checkspermission fromread_writetoreadwill not change SonarQube analysis/gate evidence, but the provider simulator will fail. - Prediction C: restoring the permission contract will produce a local simulated provider check whose conclusion maps to the real gate.
- Prediction D: no native PR decoration will exist on Community Build; the packet must say so explicitly.
5. Execute the analysis and preserve the asynchronous chain
export SONAR_HOST_URL="http://localhost:9000"
export SONAR_PROJECT_KEY="sq-ch18-provider-lab"
mkdir -p evidence/checkpoint/sonar evidence/checkpoint/provider
git rev-parse HEAD | tee evidence/checkpoint/sonar/revision.txt
sonar-scanner -X 2>&1 | tee evidence/checkpoint/sonar/scanner.log
cp .scannerwork/report-task.txt evidence/checkpoint/sonar/report-task.txt
CE_TASK_ID="$(sed -n 's/^ceTaskId=//p' .scannerwork/report-task.txt)"
echo "$CE_TASK_ID" | tee evidence/checkpoint/sonar/ce-task-id.txt
curl -fsS -H "Authorization: Bearer $SONAR_TOKEN" \
"$SONAR_HOST_URL/api/ce/task?id=$CE_TASK_ID" \
| tee evidence/checkpoint/sonar/ce-task.json
curl -fsS -H "Authorization: Bearer $SONAR_TOKEN" \
"$SONAR_HOST_URL/api/qualitygates/project_status?projectKey=$SONAR_PROJECT_KEY" \
| tee evidence/checkpoint/sonar/gate.json
Do not continue until CE is terminal. Scanner exit, upload, CE, analysis completion, gate, CI job, and provider decoration remain separate states.
6. Simulated binding, failure, and repair
Reuse Lesson 2’s binding.json and
provider_sim.py, but copy them into
evidence/checkpoint/provider/. Run three steps:
- Good contract: Checks RW + Pull Requests RW → provider check generated.
-
Broken contract: Checks Read only → preserve
SIMULATED_PROVIDER_403. - Repair: restore only Checks RW → regenerate provider check.
Hash the relevant evidence to prove the SonarQube gate did not change during provider-only failure/repair:
sha256sum evidence/checkpoint/sonar/revision.txt \
evidence/checkpoint/sonar/report-task.txt \
evidence/checkpoint/sonar/gate.json \
| tee evidence/checkpoint/sonar/evidence.sha256
7. Optional real Developer+ sandbox flow
If an authorized sandbox exists, choose one provider—not all four. Create the minimum provider identity, bind/import the disposable repository, run a PR/MR analysis in supported CI, and preserve:
- provider organization/repository ID;
- app/token identity and scopes with values redacted;
- SonarQube binding/configuration name;
- commit SHA, PR/MR key and target;
ceTaskIdand CE status;- Quality Gate;
- provider check/comment/status ID and timestamp;
- credential revocation/uninstall audit evidence.
native_provider_decoration=NOT_EXECUTED_EDITION_OR_SANDBOX_UNAVAILABLE. Do not substitute a production repository.
8. Required evidence packet
-
assumptions.md: versions, edition, local URL, scanner/runtime, no production providers. -
provider-design.md: all four provider identities/scopes/storage/revocation paths. -
revision, scanner log, report-task,
ceTaskId, CE response, and Quality Gate response. - fake provider binding manifest and good simulated check.
- broken permission manifest/log and repaired check.
- provider-vs-SonarQube credential ownership note.
- optional native sandbox provider evidence or explicit unexecuted limitation.
- credential revocation/cleanup checklist.
9. Verification checklist
- ☐ Exact source SHA is recorded.
-
☐ Scanner/server versions and
ceTaskIdare recorded. - ☐ Gate was queried only after Compute Engine success.
- ☐ Provider identities/scopes differ appropriately across GitHub/GitLab/Azure/Bitbucket.
- ☐ No provider credential value exists in the packet.
- ☐ Deliberate provider failure leaves SonarQube analysis/gate evidence unchanged.
- ☐ Repair changes only the required provider permission contract.
- ☐ Native decoration is labeled Developer+ and not attributed to Community Build.
- ☐ Bitbucket’s current OAuth Client/API-token transition is documented.
- ☐ SonarQube project token is revoked and revocation verified.
10. Cleanup and rollback
- Revoke the disposable SonarQube project-analysis token and verify a read requiring that token fails.
- Delete the disposable local SonarQube project only after exporting the packet and only if you created it solely for this checkpoint.
- The mandatory provider path created no real provider credentials; record that explicitly.
- If the optional sandbox path was executed, revoke/uninstall its app/token/client after evidence capture.
- Do not delete shared provider apps, organization integrations, global SonarQube configurations, unrelated CI service endpoints, or source repositories.
11. What Chapter 18 adds to the operating model
Chapter 18 adds provider trust governance: each provider result can now be traced from repository/PR identity through a dedicated integration credential and SonarQube binding to a specific analysis task, Quality Gate, provider check, audit record, and revocation path. “The integration works” is no longer sufficient; the identity and permission boundary are evidence.
Chapter 19 continues into CI Integration with GitHub Actions, GitLab CI, Jenkins, and Other Runners, where checkout depth, runner caches, secret injection, scanner invocation, gate enforcement, and job-status behavior become the primary operational focus.
Knowledge check
What two credentials must never be conflated in the checkpoint?
The SonarQube analysis token and the provider App/PAT/OAuth credential used for repository integration/decoration.
What does the unchanged gate hash during simulated provider failure prove?
The failure belongs to the provider authorization/delivery layer rather than to source analysis or gate calculation.
Which real provider should be used for the optional sandbox path?
Any one authorized disposable provider sandbox is sufficient; there is no need to create credentials in all four providers.
What must the packet say when only Community Build is available?
Native branch/PR decoration was not executed; the provider-delivery evidence is a faithful local simulation driven by a real Community Build gate.
Why is cleanup incomplete if you only unset environment variables?
Unsetting local variables does not revoke server/provider credentials. The credential must be invalidated at its owning system and revocation verified.
What is the Chapter 19 bridge?
Provider trust is now established; Chapter 19 focuses on runner/CI execution, checkout, caching, secret injection, scanner steps, and CI enforcement semantics.
Official references and version notes
- SonarQube downloads / edition matrix — current Community Build and Server editions; branch/PR analysis and provider decoration begin in Developer Edition.
- GitHub App integration — dedicated App, Checks/Pull Requests permissions, private repository Contents read, optional permissions, and webhook guidance.
- GitHub project integration — bound project and pull-request Quality Gate/check behavior.
- GitLab global integration — dedicated Reporter account or Group Access Token with API scope and stored/revocable token.
-
GitLab repository import
— import token
read_apiflow and repository binding. - Azure DevOps integration — global configuration, technical PAT, extension/pipeline model, Quality Gate reporting and PR feedback.
- Azure repository import — project import PAT and bound-project behavior.
- Bitbucket Cloud global integration — SonarQube’s global OAuth configuration and pull-request permission model.
-
Bitbucket Cloud repository import
— API token with
read:repository:bitbucket; App passwords deprecated. - Sonar staff clarification on Bitbucket Cloud OAuth Client terminology (Aug–Sep 2026) — current UI uses OAuth Client / Client ID / Secret, client credentials, Pull requests Read; older maintained Sonar lines needed specific patched releases after a Bitbucket OAuth field change.
- SonarQube Web API — bearer authentication and API guidance used for local evidence queries.
- SonarScanner CLI 8.1.0.6389 — scanner baseline used by the mandatory lab.
Rechecked 2026-09-08. Mandatory examples target
Community Build 26.9.0.129388 and SonarScanner
CLI 8.1.0.6389; current commercial reference
points are SonarQube Server 2026 Release 4.1 and
2026.1.5 LTA. Native feature/maintenance branch
and pull/merge-request analysis plus provider decoration start in
Developer Edition. GitHub integration uses a
GitHub App with explicit repository permissions; GitLab global
integration uses a dedicated Reporter-capable personal/group token
with api scope; Azure DevOps uses a dedicated
technical PAT and Azure DevOps Extension/service endpoint;
Bitbucket Cloud is currently transitioning
terminology/credentials, with API tokens replacing App passwords
for import and current provider UI using OAuth Clients even where
some Sonar documentation still says OAuth Consumer. Multiple
configurations/instances and several monorepo/enterprise
integration capabilities begin in Enterprise. Recheck provider UI,
token deprecations, patch notes, callback/base URL requirements,
and exact permissions before production rollout.
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.