[FOLIO-918] Enable Sonarqube in CI on select branch builds Created: 31/Oct/17 Updated: 12/Nov/18 Resolved: 06/Nov/17 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Task | Priority: | P3 |
| Reporter: | John Malconian | Assignee: | John Malconian |
| Resolution: | Done | Votes: | 0 |
| Labels: | ci, sprint25, sprint26 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 7 hours | ||
| Original estimate: | Not Specified | ||
| Issue links: |
|
||||||||
| Sprint: | |||||||||
| Description |
|
Currently we run a Sonarqube analysis on PRs and 'master' branch. Extend analysis to select branches. |
| Comments |
| Comment by John Malconian [ 01/Nov/17 ] |
|
I've created a couple of versions of this. Version 1: specify a branch to scan and report on in the project's Jenkinsfile. The report will then be published (and updated) on Sonarcloud with project name + branch. Version 2: scan and publish an html report locally (in Jenkins) on all branches and created a link to the report alongside the project in Jenkins. Version 2 seems preferable. However, there are problems archiving the reports so that they are accessible. Still working this out. |
| Comment by John Malconian [ 06/Nov/17 ] |
|
Ultimately, went with "version 1" since the options in "version 2" have been deprecated by Sonarqube. Maven-based builds now have the option to selectively initiate a Sonarqube scan via Jenkins on branches other than 'master' or pull requests. To specify a branch that you want scanned, add the 'sqBranch' configuration option to the project's top-level Jenkins as an option to 'buildMvn'. The value of 'sqBranch' is a list of branch names that you want scanned. Example Jenkinsfile configuration: buildMvn { sqBranch = ['my-branch', 'my-other-branch'] ... }Scan results will be published to https://sonarcloud.io/organizations/folio-org/projects with the name of the project + branch_name. |
| Comment by Adam Dickmeiss [ 04/Jan/18 ] |
|
I have this branch https://github.com/folio-org/mod-codex-inventory/commits/sq where the Jenkins file has been adjusted. Where can I find the "result"? |
| Comment by John Malconian [ 04/Jan/18 ] |
|
https://sonarcloud.io/dashboard?id=org.folio%3Amod-codex-inventory%3Asq |