SonarQube PR Scanning Integration (Multibranch Pipeline)
Objective
Enable SonarQube Pull Request and Branch scanning using the Jenkins Shared Library (sonarqube-lib) and multibranch pipeline setup.
Required Steps
1. Create GitHub Label (if not exists)
Create the following label in the repository:
- Name:
SonarQube
- Description: SonarQube
- Color:
#D4C5F9
This label will be used for:
- Auto-created issues from SonarQube failures
- Manual tracking of SonarQube-related work
2. Setup GitHub Webhook
Configure webhook to trigger Jenkins:
Events:



3. Add sonar-project.properties
# Format is $GHE_ORG_ID-$GHE_REPO_ID
sonar.projectKey=1459110-989134054
# Format is $GHE_ORG_NAME/$GHE_ORG_REPO
sonar.projectName=IBM/aiu-trace-analyzer
# Files / Folders to exclude. Note, this doesn't work unless entered in command-line
sonar.exclusions=""
# SonarQube Host URL
sonar.host.url=https://sonarqube-prod.apps.wdc-sonarqube-prod.core.cirrus.ibm.com
4. Add Jenkinsfile (Shared Library) Jenkinsfile.sonarqube
Note: This file will also be in the root directory of this repo (same location as the sonar-project.properties)
@Library('sonarqube-lib') _
multiBranchSonarQubeScan()
Expected Outcome
SonarQube scan runs on:
- Pull Requests
- Branch pushes
GitHub integration:
- Commit status updates
- PR comments (bugs, coverage, etc.)
- Issue creation on Quality Gate failure (tagged with
SonarQube label)
Notes
- Quality Gate is non-blocking
- Pipeline should not fail due to SonarQube issues
- Ensure Jenkins Multibranch Pipeline is configured
Acceptance Criteria
SonarQube PR Scanning Integration (Multibranch Pipeline)
Objective
Enable SonarQube Pull Request and Branch scanning using the Jenkins Shared Library (
sonarqube-lib) and multibranch pipeline setup.Required Steps
1. Create GitHub Label (if not exists)
Create the following label in the repository:
SonarQube#D4C5F9This label will be used for:
2. Setup GitHub Webhook
Configure webhook to trigger Jenkins:
application/jsonEvents:
3. Add
sonar-project.properties4. Add Jenkinsfile (Shared Library)
Jenkinsfile.sonarqubeExpected Outcome
SonarQube scan runs on:
GitHub integration:
SonarQubelabel)Notes
Acceptance Criteria
SonarQubelabel exists in repositorysonar-project.propertiesadded and validatedSonarQubelabel)