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

Migrate to Supported Coverage Plugin #224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jamiejackson
Copy link

@jamiejackson jamiejackson commented Apr 1, 2024

Caveat: I have no idea what I'm doing.

Testing done

mvn package (yields a Jenkins version error)

Attempted to migrate from EOL code-coverage-api plugin to coverage-plugin (#219).

Haphazardly bumped/changed some versions in pom.xml and hamfistedly updated a test case.

This is draft because my attempts led to failure:

[ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:3.49:validate-hpi (default-validate-hpi) on project cobertura: Dependency org.jenkins-ci.plugins.workflow:workflow-job:jar:1400.v7fd111b_ec82f requires Jenkins 2.440 or higher. -> [Help 1]

Notes to self:

Tasks

No tasks being tracked yet.

@jamiejackson
Copy link
Author

BTW, I don't know how to fix the task list.

@jamiejackson jamiejackson marked this pull request as ready for review April 1, 2024 18:04
@jamiejackson jamiejackson requested a review from a team as a code owner April 1, 2024 18:04
@captain-caveman2k
Copy link

captain-caveman2k commented Apr 25, 2024

Hi @jamiejackson,

From an outsiders perspective, who is waiting for this plug-in to be updated, I took a look at the build log and can see that the build error is:

[ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:3.49:validate-hpi (default-validate-hpi) on project cobertura: Dependency org.jenkins-ci.plugins:cloudbees-folder:jar:6.901.vb_4c7a_da_75da_3 requires Jenkins 2.440 or higher. -> [Help 1]

I see from your changes that you have updated the pom to require the Jenkins v2.440 bom. However, I see that the version of Jenkins specified in the pom:L21 is still:

<jenkins.version>2.361.4</jenkins.version>

Just a thought but does this need to be updated as well ?

@jamiejackson
Copy link
Author

🤷

I bumped that and a couple of other versions and got:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.410 s
[INFO] Finished at: 2024-05-16T23:40:23-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.4.1:enforce (display-info) on project cobertura: 
[ERROR] Rule 5: org.apache.maven.enforcer.rules.dependency.RequireUpperBoundDeps failed with message:
[ERROR] Failed while enforcing RequireUpperBoundDeps. The error(s) are [
[ERROR] Require upper bound dependencies error for io.jenkins.plugins:data-tables-api:1.13.8-4 paths to dependency are:
[ERROR] +-org.jenkins-ci.plugins:cobertura:1.18-SNAPSHOT
[ERROR]   +-io.jenkins.plugins:coverage:1.13.0
[ERROR]     +-io.jenkins.plugins:data-tables-api:1.13.8-4 (managed) <-- io.jenkins.plugins:data-tables-api:2.0.1-1
[ERROR] and
[ERROR] +-org.jenkins-ci.plugins:cobertura:1.18-SNAPSHOT
[ERROR]   +-io.jenkins.plugins:coverage:1.13.0
[ERROR]     +-io.jenkins.plugins:forensics-api:2.4.0 (managed) <-- io.jenkins.plugins:forensics-api:2.4.0
[ERROR]       +-io.jenkins.plugins:data-tables-api:1.13.8-4 (managed) <-- io.jenkins.plugins:data-tables-api:1.13.8-2
[ERROR] ]
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I'm done with this, though. I already migrated the pipelines that needed coverage to another CI/CD server that supports it.

@captain-caveman2k
Copy link

It seems that the coverage plug-in v1.13, looking at it's pom, requires the data-tables-api v2.0.1-1 and v1.14 requires v2.0.3-1.

What I don't understand, at present, is where the implied data-tables-api v1.13.0-4 is coming from?

Unfortunately, I'm not either a Jenkins plug-in or Java developer. I've been a C and C++ engineer for 30 years, and opensource wise occasionally helping out in curl.

@jamiejackson
Copy link
Author

It's a both a dependency and a transitive dependency of the coverage plugin. You can run the mvn dependency:tree task to see the dependency tree.

I think the build error does a pretty decent job of pinpointing the dependencies and version clash, now that I look at it again:

[ERROR] Failed while enforcing RequireUpperBoundDeps. The error(s) are [
[ERROR] Require upper bound dependencies error for io.jenkins.plugins:data-tables-api:1.13.8-4 paths to dependency are:
[ERROR] +-org.jenkins-ci.plugins:cobertura:1.18-SNAPSHOT
[ERROR]   +-io.jenkins.plugins:coverage:1.13.0
[ERROR]     +-io.jenkins.plugins:data-tables-api:1.13.8-4 (managed) <-- io.jenkins.plugins:data-tables-api:2.0.1-1
[ERROR] and
[ERROR] +-org.jenkins-ci.plugins:cobertura:1.18-SNAPSHOT
[ERROR]   +-io.jenkins.plugins:coverage:1.13.0
[ERROR]     +-io.jenkins.plugins:forensics-api:2.4.0 (managed) <-- io.jenkins.plugins:forensics-api:2.4.0
[ERROR]       +-io.jenkins.plugins:data-tables-api:1.13.8-4 (managed) <-- io.jenkins.plugins:data-tables-api:1.13.8-2
[ERROR] ]

coverage wants v2.0 of data-tables-api, but forensics wants v1.13. I don't know how to solve that problem, though.

@jgournet
Copy link

jgournet commented Jun 5, 2024

I gave a quick try by adding:

    <dependency>
      <groupId>io.jenkins.plugins</groupId>
      <artifactId>data-tables-api</artifactId>
      <version>2.0.3-1</version>
    </dependency>

to force maven to use that version.
Good news: that error is gone
Bad news: we're now missing quite a few more dependencies, like those:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project cobertura: Compilation failure: Compilation failure: 
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/adapter/CoberturaReportAdapter.java:[5,43] package io.jenkins.plugins.coverage.adapter does not exist
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/adapter/CoberturaReportAdapter.java:[6,43] package io.jenkins.plugins.coverage.adapter does not exist
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/adapter/CoberturaReportAdapter.java:[7,48] package io.jenkins.plugins.coverage.adapter.util does not exist
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/adapter/CoberturaReportAdapter.java:[8,44] package io.jenkins.plugins.coverage.detector does not exist
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/adapter/CoberturaReportAdapter.java:[20,51] cannot find symbol
[ERROR]   symbol: class JavaXMLCoverageReportAdapter
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/adapter/CoberturaReportAdapter.java:[46,21] cannot find symbol
[ERROR]   symbol:   class JavaCoverageReportAdapterDescriptor
[ERROR]   location: class hudson.plugins.cobertura.adapter.CoberturaReportAdapter
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/adapter/CoberturaReportAdapter.java:[47,24] cannot find symbol
[ERROR]   symbol:   class Detectable
[ERROR]   location: class hudson.plugins.cobertura.adapter.CoberturaReportAdapter
[ERROR] /mnt/src/main/java/hudson/plugins/cobertura/IOUtils.java:[8,39] package org.apache.commons.codec.binary does not exist

I tried fighting this, but that's where I'll use @jamiejackson caveat:
Caveat: I have no idea what I'm doing.

@jamiejackson
Copy link
Author

Some news: #219 (comment)

@uhafner
Copy link
Member

uhafner commented Jul 6, 2024

This PR does not make sense. The parser for Cobertura is now included in the coverage plugin, making the Cobertura plugin obsolete!

@jonesbusy
Copy link

In my opinion the plugin must be marked as deprecated and the repo archived

Like https://plugins.jenkins.io/opencover/ and https://github.com/jenkinsci/opencover-plugin

@uhafner
Copy link
Member

uhafner commented Jul 7, 2024

In my opinion the plugin must be marked as deprecated and the repo archived

Like https://plugins.jenkins.io/opencover/ and https://github.com/jenkinsci/opencover-plugin

Yes, that would make even more sense, see #226

@uhafner
Copy link
Member

uhafner commented Nov 4, 2024

@MarkEWaite @basil Since you published the latest release of this plugin: do you have access rights to mark the plugin as deprecated? I cannot edit the labels in this repository on my own. See jenkinsci/code-coverage-api-plugin#806

@MarkEWaite
Copy link
Contributor

@MarkEWaite @basil Since you published the latest release of this plugin: do you have access rights to mark the plugin as deprecated? I cannot edit the labels in this repository on my own. See jenkinsci/code-coverage-api-plugin#806

I don't have permissions on the repository. The last commit from a maintainer was by @jeffpearce .

I think that the easiest path is for you to propose yourself as a maintainer of the plugin and then as a maintainer update the documentation to show that the plugin is deprecated and has been replaced by the Warnings plugin.

@jeffpearce to you or other maintainers object to this plugin being deprecated in favor of the actively maintained warnings plugin?

@uhafner
Copy link
Member

uhafner commented Nov 4, 2024

Ok, this looks a little bit complicated to just get the label deprecated set but I will request the permissions...

I already have an answer from Jeff in an Email from May:

Thanks for the email.

I saw the discussion in GitHub last week (I think). I don't have any objection to marking it as deprecated. Nobody is actively maintaining it. I'm not even using Jenkins in my work anymore, so it's hard to justify spending much time on it

And one additional note, it has been replaced by the coverage plugin 😉 and not by the warnings plugin.

I think that the easiest path is for you to propose yourself as a maintainer of the plugin and then as a maintainer update the documentation to show that the plugin is deprecated and has been replaced by the Warnings plugin.

@jeffpearce
Copy link
Contributor

jeffpearce commented Nov 4, 2024 via email

@uhafner
Copy link
Member

uhafner commented Nov 5, 2024

@jeffpearce Can't you simply add the label deprecated to this repository? Then we do not need to transfer any rights.

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

Successfully merging this pull request may close these issues.

7 participants