[FOLIO-1818] Sonar analysis "coverage on new code" for PRs of NPM-based repos not happening recently Created: 21/Feb/19 Updated: 03/Jun/20 Resolved: 28/Feb/19 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Bug | Priority: | P3 |
| Reporter: | David Crossley | Assignee: | David Crossley |
| Resolution: | Done | Votes: | 0 |
| Labels: | ci, platform-backlog | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Sprint: | Core: Platform - Sprint 58 |
| Story Points: | 2 |
| Development Team: | Core: Platform |
| Description |
|
Sonar "coverage on new code" is not happening for pull requests, for NPM-based repositories. It is happening okay for Maven-based repsitories. |
| Comments |
| Comment by David Crossley [ 21/Feb/19 ] |
|
For example, https://github.com/folio-org/ui-orders/pull/266/checks Whereas Maven-based ones are okay. |
| Comment by David Crossley [ 21/Feb/19 ] |
|
Not sure yet if related to
Note that we cannot now look back to see when it last worked, as our SonarCloud reports are deleted after about one month. |
| Comment by David Crossley [ 22/Feb/19 ] |
|
It is not related. Investigation ... SonarQube scan for NPM-based projects was added 20180925 and lcov reports being run on all builds. Soon after the jenkins-pipeline-libs was expanded to (among other changes) have separate configuration for master, branch, and PRs. The PR arm of vars/sonarqubeScanNPM.groovy does not have the option: "-Dsonar.javascript.lcov.reportPaths=${lcovPath}/lcov.info"
so no reports, only on branches and master. John Malconian should that change be made to enable Sonar code coverage reports on PRs? |
| Comment by John Malconian [ 25/Feb/19 ] |
|
David Crossley Yes, go ahead and try it on PRs. |
| Comment by David Crossley [ 26/Feb/19 ] |
|
There is a PR here to test this: Aliaksei Chumakou As asked there, would you please add a sensible test portion of new code. |
| Comment by Aliaksei Chumakou [ 26/Feb/19 ] |
|
David Crossley Actually this might be connected with parsing code issue in SonarJS, here is the fix 11 days ago, to use babel parser instead of espree https://github.com/SonarSource/SonarJS/pull/1183/files |
| Comment by David Crossley [ 27/Feb/19 ] |
|
Thanks Aliaksei for adding the test code. Regarding that SonarJS update mentioned above. I reckon that that is a separate issue. I presume that you are referring to the messages that we see in our Jenkins output for the Sonar stage, regarding "espree". Now i am not sure of this (John Malconian please correct) but i gather that we use https://github.com/SonarSource/sonar-scanner-jenkins (which may include that). |
| Comment by David Crossley [ 27/Feb/19 ] |
|
Back to this
There is a new PR that tests this: https://github.com/folio-org/ui-orders/pull/276 The "new code coverage" summary is reported to the PR Checks tab, and the SonarCloud report is as expected for the PR build as well as the branch build. So this
|
| Comment by David Crossley [ 28/Feb/19 ] |
|
Closed. After merging jenkins-pipeline-libs/pull/59 and restoring the Jenkinsfile in the test PR ui-orders/pull/276 now the Sonar new code coverage report is updated on the Checks tab. |
| Comment by Aliaksei Chumakou [ 28/Feb/19 ] |
|
David Crossley Thanks a lot from all ui-modules teams! |