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 more spotbugs checks and fix existing issues #1392

Merged
merged 7 commits into from
Aug 23, 2023

Conversation

aneveux
Copy link
Member

@aneveux aneveux commented Jun 22, 2023

Hello folks 👋

I'm currently following the Improve a Plugin documentation for
Jenkins plugins modernization, and noticed we could add more spotbugs checks for this plugin.

Adding additional Spotbugs checks did raise quite a bunch of warnings which I tried to fix in that PR.
For some of them, I was a bit uncertain about either the expected outcome, or the risk of changing things, so I instead ignored the warning, as it is the current state of the source code.

So here's a PR doing that. I checked that everything is running fine with mvn verify.

Thanks for your review!

Let me know if there is anything you would like me to take care of in that PR. If you believe it is not worth for the project, feel free to close it.

Testing done

Submitter checklist

Preview Give feedback

@aneveux aneveux requested a review from a team as a code owner June 22, 2023 13:35
@aneveux aneveux requested review from jglick and Vlatombe June 22, 2023 13:36
@Vlatombe
Copy link
Member

Looks good though some of the spotbugs check seem overkill.

@Vlatombe
Copy link
Member

Thank you for the PR @aneveux !

@aneveux aneveux requested a review from Vlatombe June 22, 2023 20:21
@Vlatombe
Copy link
Member

Vlatombe commented Jun 23, 2023

Test failures don't look like flakes (at least look at the ones under jdk11, they are independent from a real k8s cluster)

@aneveux
Copy link
Member Author

aneveux commented Jun 23, 2023

Test failures are now fixed. I thought I could put that kc.connect() in a try-with-resource block, but that is actually what is failing the test. I believe the mutation has some effect elsewhere in the code that is necessary for the current behavior.

@aneveux
Copy link
Member Author

aneveux commented Jun 27, 2023

New test failures, I am looking at it.

@aneveux aneveux self-assigned this Jun 27, 2023
@Vlatombe Vlatombe added the bug Bug Fixes label Jul 4, 2023
@aneveux
Copy link
Member Author

aneveux commented Aug 23, 2023

@Vlatombe I finally got some time to fix the remaining issues here and merge with master.

LMK if that PR is fine for you ❤️

@Vlatombe Vlatombe merged commit 6332799 into jenkinsci:master Aug 23, 2023
@@ -87,7 +87,7 @@ public KubernetesLauncher() {
}

@Override
public boolean isLaunchSupported() {
public synchronized boolean isLaunchSupported() {
Copy link
Member

Choose a reason for hiding this comment

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

I found a problem here: if this method is called from another thread used synchronously during launch (JnlpConnectionState.fireAfterChannel) while launch(…) is running, you can get a deadlock.

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

Successfully merging this pull request may close these issues.

3 participants