- Developer Edition Version 8.2 (build 32929)
*Azure Devops Server : Version Dev17.M153.5
Trying enable the PullRequest Code Analysis in Azure Devops. So that every PullRequest should trigger the sonarqube code analysis and report quality gate status back into PullRequest in Azure DevOps(TFS)
what we have configured so far: Attached the screen shot.
(upload://4TkF0lc6oP7v6Qu9ayERpoISFC0.png) ISFC0.png)
When we ran the job we are getting the below Error
2020-04-09T15:10:48.2179674Z ##[error]ERROR: Error during SonarQube Scanner execution
ERROR: A pull request analysis cannot have the branch analysis parameter 'sonar.branch.name'
When we ran the pipeline job with the Below Additional Parameter the job runs but not updating “SonarQube” PullRequest
sonar.pullrequest.key=BUILD_PULLREQUEST_ID
sonar.pullrequest.branch=BUILD_PULLREQUEST_SOURCEBRANCHNAME
sonar.pullrequest.base=BUILD_PULLREQUEST_TARGETBRANCHNAME
The Analysis job runs for the when look at the log it’s taking the target branch in this case :Develop
Not the PR/Feature branch for code analysis Is there any reason ???
Attached screen shot of logs for your reference. (Removed Project key from logs for security purpose)
2020-04-09T11:18:04.3212168Z INFO: Load plugins index
2020-04-09T11:18:04.3655496Z INFO: Load plugins index (done) | time=44ms
2020-04-09T11:18:04.4810073Z INFO: Load/download plugins (done) | time=159ms
2020-04-09T11:18:04.7009266Z INFO: Loaded core extensions: developer-scanner
2020-04-09T11:18:05.1926904Z INFO: Process project properties
2020-04-09T11:18:05.2035531Z INFO: Process project properties (done) | time=11ms
2020-04-09T11:18:05.2036972Z INFO: Execute project builders
2020-04-09T11:18:05.2080571Z INFO: Execute project builders (done) | time=4ms
2020-04-09T11:18:05.2129446Z INFO: Project key:
2020-04-09T11:18:05.2129904Z INFO: Base dir:
2020-04-09T11:18:05.2129972Z INFO: Working dir: E:\Agents\EnterpriseFoundations\_work\r81\a\.scannerwork
2020-04-09T11:18:05.2796700Z INFO: Load project settings for component key: '
2020-04-09T11:18:05.3034706Z INFO: Load project settings for component key: '
' (done) | time=24ms
2020-04-09T11:18:05.3596698Z INFO: Load project branches
2020-04-09T11:18:05.3762524Z INFO: Load project branches (done) | time=16ms
2020-04-09T11:18:05.3769324Z INFO: Load project pull requests
2020-04-09T11:18:05.3903086Z INFO: Load project pull requests (done) | time=13ms
2020-04-09T11:18:05.3906230Z INFO: Load branch configuration
2020-04-09T11:18:05.3924564Z INFO: Load branch configuration (done) | time=2ms
2020-04-09T11:18:05.4204821Z INFO: Load quality profiles
2020-04-09T11:18:05.4702956Z INFO: Load quality profiles (done) | time=50ms
2020-04-09T11:18:05.4742516Z INFO: Detected Azure DevOps
2020-04-09T11:18:05.4765295Z INFO: Load active rules
2020-04-09T11:18:06.3390298Z INFO: Load active rules (done) | time=863ms
2020-04-09T11:18:06.3507736Z INFO: Branch name: develop
And Sonarqube Portal the “PullRequest” Tab was showing no entry in it.