Skip to content

Conversation

cyrille-leclerc
Copy link
Contributor

@cyrille-leclerc cyrille-leclerc commented Jun 6, 2019

support warnings-ng plugin, and remove deprecated findbugs and tasks plugins support

See JENKINS-57427

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@aheritier aheritier added the wip label Aug 8, 2020
@aheritier aheritier marked this pull request as draft August 8, 2020 13:19
@aheritier aheritier self-assigned this Aug 8, 2020
@aheritier aheritier removed their assignment Aug 30, 2020
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also delete the findbugs plugin dep.

CC @bguerin @uhafner

@bguerin
Copy link
Contributor

bguerin commented Sep 12, 2022

This should also delete the findbugs plugin dep.

Hello @jglick Yes I know. I also really want to do this integration and to remove deprecated dependencies. It is on my top level TODO list. For now, I only do bug fixing to discover the plugin internals, and next then I will work on this

@bguerin bguerin changed the title WIP JENKINS-57427 support warnings-ng plugin feature : support warnings-ng plugin [JENKINS-57427] Aug 11, 2025
@bguerin bguerin self-assigned this Aug 11, 2025
@bguerin bguerin force-pushed the JENKINS-57427-2 branch 2 times, most recently from e8c7d56 to 22de135 Compare August 20, 2025 20:30
@bguerin bguerin force-pushed the JENKINS-57427-2 branch 6 times, most recently from c3fa2a1 to 7421bc5 Compare August 24, 2025 12:26
@bguerin bguerin force-pushed the JENKINS-57427-2 branch 3 times, most recently from 33a4c2b to 1cf7485 Compare August 24, 2025 21:03
@bguerin bguerin marked this pull request as ready for review August 28, 2025 08:18
@bguerin bguerin requested a review from a team as a code owner August 28, 2025 08:18
@bguerin
Copy link
Contributor

bguerin commented Aug 28, 2025

@jglick @olamy (and others) I would love a review if you have some time. Thanks !

@jglick
Copy link
Member

jglick commented Sep 2, 2025

Sorry, I do not have much capacity for reviews.

private String globalMavenSettingsFilePath = "";
private String maven;
private String mavenOpts = "";
private String mavenOpts =
Copy link
Member

@olamy olamy Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do I understand correctly every build will now use this per default?
looks like some breaking changes. If used per default this will override pom properties from users

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I did that because without, the maven build will fail at first problem, the integration won't run and you will not have the reports in Jenkins, and the build as unstable but failed without knowing why, only the logs will help

But you are right, it is too intrusive, it is usefull at most if you rely on automatic integrations, will change that.

and good catch for pom properties, will take care of that too

Thanks !

@olamy
Copy link
Member

olamy commented Sep 3, 2025

@bguerin no much time for a very detailed review. I added a question about what looks to be the new default mavenOpts value, which seems to be a bit intrusive to me, especially the -Dmaven.test.failure.ignore

Copy link
Member

@jtnord jtnord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code will not work correct if the warnings plugin is not installed.

Additionally this breaks existing installations by remove support without providing a time to migrate.

private final Control skipDownstreamTriggers = control("skipDownstreamTriggers");
private final Control ignoreUpstreamTriggers = control("ignoreUpstreamTriggers");

private Control sourceCodeEncoding = control("sourceCodeEncoding");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have this page should be generic for all publishers and specific publisher functionality / options should be in a sepearate page area for that Publisher. (e.g. see Credentials -> https://github.com/jenkinsci/acceptance-test-harness/blob/master/src/main/java/org/jenkinsci/test/acceptance/plugins/credentials/StringCredentials.java)


assertThat(snippetGenerator.generateScript())
.isEqualTo("""
withMaven(options: [warningsPublisher()], traceability: true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would appear incorrect.
you have used the defaults but with a specific publisher and yet traceability: true is present. if this is a default it should not have been generated by the snippet generator.


<st:include page="maven-publisher" class="${descriptor.clazz}"/>

<f:section title="${%cource_code}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don;t break existing setups for no reason without time to migrate.

@uhafner
Copy link
Member

uhafner commented Sep 3, 2025

I have some general concerns with this PR.

One the one hand, it would make more sense to remove all those deprecated publisher totally (maybe in a separate PR). It makes no sense to report some logger warnings that users need to update now. Those steps are deprecated for years now, and most of the referenced plugins even do not exist anymore. It would simplify your development when you delete this code.

One the other hand, I am not convinced that the overall approach makes sense. You are remodeling the options of the warnings and coverage plugins. This seems to be redundant. And very fragile when one of those plugins change. I wonder why you do not simply publish the corresponding reports with the default values without any user configuration (just enable/disable). And if users need additional options, they still can use the correct warnings and coverage steps of the corresponding plugins.

BTW: you are also using a lot of code of the warnings and coverage plugins that are not meant to be used as API. This might break in the future as well...

@jtnord
Copy link
Member

jtnord commented Sep 3, 2025

One the other hand, I am not convinced that the overall approach makes sense. You are remodeling the options of the warnings and coverage plugins. This seems to be redundant. And very fragile when one of those plugins change. I wonder why you do not simply publish the corresponding reports with the default values without any user configuration (just enable/disable). And if users need additional options, they still can use the correct warnings and coverage steps of the corresponding plugins.

What I like about not having to configure the (old publishers) is that the configuration was correctly obtained and specific to a build without human intervention or mundane maintainance.

For example if is have a multi-project maven setup but have some modules that are not part of the build I would not want any of their TODOs to show up. Obtaining the source paths from maven means this is handled and I can then reuse common pipelines across many different projects. (e.g. **/src/main/java would pick up things that are not part of the build etc). The new code does not appear to do this which makes it less useful for me.

If I have to use warnings-ng to do this then I can not have a generic pipeline for my jobs. So there is a use case here - and I think it is an important one.

As for using the internals of warnings-ng that could change and break, perhaps the integration should move the warnings-ng plugin so that any changes/refactoring can happen in a single repository (although that also has some downsides for split maintenance) and that would be something that Ulli would need to be OK with.

@bguerin
Copy link
Contributor

bguerin commented Sep 3, 2025

Many many thanks @jtnord for your review, will handle all your points

the code will not work correct if the warnings plugin is not installed.

Why ? It should by the way ...

Additionally this breaks existing installations by remove support without providing a time to migrate.

Agree, I saw https://issues.jenkins.io/browse/JENKINS-76003 and https://issues.jenkins.io/browse/JENKINS-76032

I think about reverting to @Extension instead of OptionalExtension to avoid some problems. Is that enough (I saw your comment about jelly configs) ?

@bguerin
Copy link
Contributor

bguerin commented Sep 3, 2025

One the other hand, I am not convinced that the overall approach makes sense. You are remodeling the options of the warnings and coverage plugins. This seems to be redundant. And very fragile when one of those plugins change. I wonder why you do not simply publish the corresponding reports with the default values without any user configuration (just enable/disable). And if users need additional options, they still can use the correct warnings and coverage steps of the corresponding plugins.

What I like about not having to configure the (old publishers) is that the configuration was correctly obtained and specific to a build without human intervention or mundane maintainance.

For example if is have a multi-project maven setup but have some modules that are not part of the build I would not want any of their TODOs to show up. Obtaining the source paths from maven means this is handled and I can then reuse common pipelines across many different projects. (e.g. **/src/main/java would pick up things that are not part of the build etc). The new code does not appear to do this which makes it less useful for me.

If I have to use warnings-ng to do this then I can not have a generic pipeline for my jobs. So there is a use case here - and I think it is an important one.

I have the same opinion than James, I am trying to follow Maven philosophy : convention about configuration.
I put some configuration to avoid hard coded values in the code, and tries to have the less of them. If you think it is too much, maybe some can be removed.

As for using the internals of warnings-ng that could change and break, perhaps the integration should move the warnings-ng plugin so that any changes/refactoring can happen in a single repository (although that also has some downsides for split maintenance) and that would be something that Ulli would need to be OK with.

I think this is not the job of warnings-ng to have this integration. It would need warnings-ng to know Maven world ... this is the job of this plugin.
I know the code use warnings-ng internal and it could break anytime, maybe it miss more unit tests, and more robustness to ensure compatibility even if warnings-ng evolve somehow.

@jtnord
Copy link
Member

jtnord commented Sep 4, 2025

As for using the internals of warnings-ng that could change and break, perhaps the integration should move the warnings-ng plugin so that any changes/refactoring can happen in a single repository (although that also has some downsides for split maintenance) and that would be something that Ulli would need to be OK with.

I think this is not the job of warnings-ng to have this integration. It would need warnings-ng to know Maven world ... this is the job of this plugin. I know the code use warnings-ng internal and it could break anytime, maybe it miss more unit tests, and more robustness to ensure compatibility even if warnings-ng evolve somehow.

Does not have to be the warninings-ng plugin but another plugin in the same repo that adds the support. (aka a bridge plugin).

@jtnord
Copy link
Member

jtnord commented Sep 4, 2025

Many many thanks @jtnord for your review, will handle all your points

the code will not work correct if the warnings plugin is not installed.

Why ? It should by the way ...

for clarity -> #221 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants