Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency to deprecated / EOL code-coverage-api #219

Closed
offa opened this issue Jan 8, 2024 · 10 comments
Closed

Dependency to deprecated / EOL code-coverage-api #219

offa opened this issue Jan 8, 2024 · 10 comments

Comments

@offa
Copy link
Contributor

offa commented Jan 8, 2024

Jenkins and plugins versions report

any

What Operating System are you using (both controller, and any agents involved in the problem)?

any

Reproduction steps

a. See Jenkins UI warning
b. See code-coverage-api project (eg. https://github.com/jenkinsci/code-coverage-api-plugin)

Expected Results

Migration to Coverage Plugin (as suggested in the docs)

Actual Results

Deprecated / EOL dependency is used

Anything else?

The new Coverage plugin seems not to be a drop in replacement and code changes are likely needed.

Are you interested in contributing a fix?

No response

@jamiejackson
Copy link

jamiejackson commented May 17, 2024

Maybe you'd have better luck on the Jira tracker. I'm not sure which tracker gets more attention.

It might also be useful to try to get some attention from the coverage plugin side. While it has a GitHub repo, its maintainers are clear that Jira is its only issue tracker (versus cobertura, which lists both Jira and GitHub trackers).

I have a PR for this (#224). While I think I made some progress, I did hit a roadblock with a dependency version conflict.

@jgournet
Copy link

jgournet commented Jun 5, 2024

Someone created a ticket: https://issues.jenkins.io/browse/JENKINS-73238 (thank you !).
Their answer was: functionality from cobertura plugin should be included in "coverage" ... so we can just remove it

@jamiejackson
Copy link

Thanks, @jgournet . Let us know what happens if and when you try it out.

@offa
Copy link
Contributor Author

offa commented Jun 5, 2024

Indeed, Coverage is a better choice. Let's close here then.

@captain-caveman2k
Copy link

Their answer was: functionality from cobertura plugin should be included in "coverage" ... so we can just remove it

Apologies for my ignorance here but how do we remove it when the Cobertura plug-in depends on it?

image

@offa
Copy link
Contributor Author

offa commented Jul 3, 2024

There's a new Coverage plugin, not to confuse with the Code Coverage Plugin.

@captain-caveman2k
Copy link

There's a new Coverage plugin, not to confuse with the Code Coverage Plugin.

Yep, I understand that and I have that installed in my Jenkins installation:

image

Unfortunately I cannot uninstall or disable Code Coverage v4.99 as Cobertura v1.17 has a dependency on it - unless there is another way of performing that. If so could you please enlighten me?

@offa
Copy link
Contributor Author

offa commented Jul 4, 2024

With the new Coverage plugin you should be able to replace the Cobertura and (old) Coverage plugin.

@captain-caveman2k
Copy link

captain-caveman2k commented Jul 8, 2024

With the new Coverage plugin you should be able to replace the Cobertura and (old) Coverage plugin.

Thanks - Like others I thought the new Coverage plug-in was a replacement for the old Code Coverage plug-in rather than a replacement for both.

I have now updated my Jenkinsfile to use recordCoverage instead and uninstalled both the Cobertura plug-in and the old Code Coverage plug-in.

@ddalcino
Copy link

ddalcino commented Jul 8, 2024

I have now updated my Jenkinsfile to use recordCoverage instead and uninstalled both the Cobertura plug-in and the old Code Coverage plug-in.

Thank you; I have done the same.

Just in case anyone is unclear on what changes are required to make Coverage work properly, I will share what I did here. I used the pipeline snippet generator for recordCoverage (go to 'Pipeline Syntax > Snippet Generator') to generate the necessary code. After modifying my Jenkinsfile accordingly, everything is working properly. Here's the diff for my Jenkinsfile:

- cobertura(coberturaReportFile: 'coverage/coverage.xml', onlyStable: false)
+ recordCoverage(tools: [[parser: 'COBERTURA', pattern: 'coverage/coverage.xml']])

The onlyStable: false k-v pair is unnecessary for Coverage; it is automatically recording coverage for both stable and unstable builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants