jenkinsci / jenkinsci/github-pr-coverage-status-plugin
Plugin incompatibility with newer Sonar versions
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 97
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
Version report
2.1.1
Jenkins and plugins versions report:
Jenkins: 2.2.49.2
Sonar: 8.4.1
- What Operating System are you using (both controller, and any agents involved in the problem)?
Linux 3.10.0-1127.19.1.el7.x86_64
Reproduction steps
Setup Publish of coverage using plugin
Results
Expected result:
It should be able to find the master coverage from Sonar
Actual result:
The API used to search for projects is /api/projects/index?search= which is no longer supported by sonar. The plugin fails to find the master coverage from sonar.
{
"errors": [
{
"msg": "Unknown url : /api/projects/index"
}
]
}
Jenkins output
00:23:28 [GitHub PR Status] start
00:23:28 [GitHub PR Status] getting master coverage...
00:23:28 take master coverage from sonar by token
00:23:29 Getting coverage for Git Repo URL: <git repo path> by repo name: <git project name>
00:23:29 Failed to get master coverage for <git repo path>
00:23:29 Exception message 'com.github.terma.jenkins.githubprcoveragestatus.SonarMasterCoverageRepository$SonarProjectRetrievalException: failed to search for sonar project <git project name> - Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
00:23:29 at [Source: (org.apache.commons.httpclient.AutoCloseInputStream); line: 1, column: 2]'
00:23:29 com.github.terma.jenkins.githubprcoveragestatus.SonarMasterCoverageRepository$SonarProjectRetrievalException: failed to search for sonar project profile-diagnostics - Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SonarMasterCoverageRepository and trace the project-search request that uses /api/projects/index?search=. Check the Sonar 8.4.1-compatible search behavior and verify that master coverage can be found without the reported API error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100