-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
7.9, I think we have most of the plugins installed. -
what are you trying to achieve
I am trying to get SonarQube to work with Azure Devops, but always get weirdness… I must have my confif wrong… -
what have you tried so far to achieve this
Everything! - but here is my config-
task: SonarSource.sonarqube.15B84CA1-B62F-4A2A-A403-89B77A063157.SonarQubePrepare@4
displayName: ‘Prepare analysis on SonarQube Pull Requests’
condition: and (
eq(variables[‘Build.Reason’], ‘PullRequest’),
ne(variables[‘Build.SourceBranch’], ‘refs/heads/dev’)
)
inputs:
SonarQube: SonarQube
projectKey: hram
projectName: hram-upgrade
projectVersion: '(Build.BuildId)' extraProperties: | sonar.sourceEncoding=UTF-8 sonar.tsql.file.suffixes=.tsql,.sql sonar.links.ci=<CI URL> sonar.links.scm=<REPO URL> sonar.links.issues=<ISSUES URL> sonar.scm.provider=git sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml sonar.pullrequest.key=(System.PullRequest.PullRequestNumber)
sonar.pullrequest.base=refs/heads/(System.PullRequest.TargetBranch) sonar.pullrequest.branch=refs/heads/(System.PullRequest.SourceBranch)
sonar.pullrequest.github.repository=
sonar.github.oauth=
sonar.github.repository=(Build.Repository.Name) sonar.github.pullRequest=(System.PullRequest.PullRequestNumber)
sonar.github.endpoint=
sonar.exclusions=/test//,/src/Sources//, -
task: SonarSource.sonarqube.15B84CA1-B62F-4A2A-A403-89B77A063157.SonarQubePrepare@4
displayName: ‘Prepare analysis on SonarQube’
condition: ne(variables[‘Build.Reason’], ‘PullRequest’)
inputs:
SonarQube: SonarQube
projectKey: hram
projectName: hram-upgrade
projectVersion: ‘$(Build.BuildId)’
extraProperties: |
sonar.sourceEncoding=UTF-8
sonar.tsql.file.suffixes=.tsql,.sql
sonar.links.ci=
sonar.links.scm=
sonar.links.issues=
sonar.scm.provider=git
sonar.cs.vscoveragexml.reportsPaths=/*.coveragexml
sonar.exclusions=/test//*,/src/Sources/**/*,
-
Some of the behaviours i see is;
- The PR decoration doesnt work;
- Quite often nothing gets flagged between source and target
- When manually running a branch, it will fail with null exception
Any pointers would be great!