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

Add spotbugs exclusions #235

Merged
merged 14 commits into from
Sep 27, 2022
Merged

Conversation

dheerajodha
Copy link
Contributor

This PR simply updates the parent POM of this plugin from 4.31 to 4.33.

  • 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

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.

Diff is much longer than it needs to be, but if the formatting changes were reverted I think this would be good.

@jglick
Copy link
Member

jglick commented Feb 18, 2022

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.

Thanks!

@dheerajodha
Copy link
Contributor Author

https://github.com/jenkinsci/parameterized-trigger-plugin/pull/235/checks?check_run_id=5243312168 smells like a too-aggressive timeout?

I tried to see what the error was:

Condition with lambda expression in hudson.plugins.parameterizedtrigger.test.BuildTriggerTest that uses hudson.model.FreeStyleProject was not fulfilled within 10 seconds.

But now it is resolved, and all I did was undo the autoformatting done by IDE. I'm confused about what went wrong and how it got resolved...

@jglick
Copy link
Member

jglick commented Feb 18, 2022

Probably just some flaky test unrelated to your PR.

This is an attempt to see if the tests still pass with this variable being deleted.
@jglick jglick requested a review from olamy February 22, 2022 18:00
@olamy olamy added the dependencies Pull requests that update a dependency file label Feb 23, 2022
olamy
olamy previously requested changes Feb 23, 2022
pom.xml Outdated
@@ -217,7 +220,7 @@
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/parameterized-trigger-plugin</gitHubRepo>
<java.level>8</java.level>
<jenkins.version>2.270</jenkins.version>
<jenkins.version>2.289.1</jenkins.version>
Copy link
Member

@olamy olamy Feb 23, 2022

Choose a reason for hiding this comment

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

as recommended here https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/
can you change to later releases within an LTS line? 2.289.3
thanks

Copy link
Member

Choose a reason for hiding this comment

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

The current PR matches the currently documented advice, but FWIW there is no real consensus here. See jenkins-infra/jenkins.io#4876

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your comments!
Lmk if we mutually decide to change jenkins.version be 2.289.3. I'm keeping it as 2.289.1 for now, unless Olivier has something to add.

@@ -20,6 +22,7 @@

import static org.apache.commons.lang.StringUtils.isEmpty;

@SuppressFBWarnings(value="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS", justification="Part of public API, reviewed all uses of Plugin are fully quantified in this class")
public class Plugin extends hudson.Plugin {
Copy link
Member

Choose a reason for hiding this comment

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

Note that extending Plugin is deprecated.

Stapler.CONVERT_UTILS.register(new EnumConverter(),
ResultCondition.class);
could be made into an @Initializer, though it could probably simply be a static initializer in ResultCondition.java.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understood that extending Plugin is deprecated.
Can you please help me in understanding what is our concern with Stapler.CONVERT_UTILS.register and how would that be addressed by making it into an @Initializer?

I read about CONVERT_UTILS from its javadocs and since ResultCondition is an enum, maybe we are trying to register it so that it becomes easier for Stapler to bind the enum constants...?

Copy link
Member

Choose a reason for hiding this comment

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

I suppose so. I would have expected any enum to be handled automatically by Stapler without a special call; maybe it is, and this call is just obsolete. Not sure offhand if it works to just move this to a static block in ResultCondition; I am guessing the key is whether ResultCondition would already have been loaded for some other reason by the time someone saves a configure page involving a value of this enum in some field and Jenkins starts processing a doSubmitConfigXml method with a JSON payload. An @Initializer is the more direct replacement and conservative fix, though it always runs whether or not you are even using this plugin. Whether this has any effective test coverage is another question (typically something calling configRoundtrip).

Copy link
Member

Choose a reason for hiding this comment

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

(To be clear, this is just an aside about an existing deprecated API, certainly not something that needs to be changed in this PR.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the detailed info! This makes things little bit more clear to me now.

@jglick jglick requested a review from olamy August 31, 2022 18:41
@MarkEWaite MarkEWaite changed the title Update Parent POM to 4.33 Add spotbugs exclusions Aug 31, 2022
@MarkEWaite MarkEWaite dismissed olamy’s stale review September 27, 2022 00:32

Minimum Jenkins version has been updated in other pull requests. Thanks for raising the concern. It has been resolved.

@MarkEWaite MarkEWaite merged commit fb05de4 into jenkinsci:master Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants