Skip to content

Fix issue with Jenkins 2.141 and changes for JENKINS-52818 #149

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public void onCompleted(Run run, TaskListener listener) {
return;
}
Result result = run.getResult();
JenkinsLocationConfiguration globalConfig = new JenkinsLocationConfiguration();
String rootUrl = globalConfig.getUrl();
JenkinsLocationConfiguration globalConfig = JenkinsLocationConfiguration.get();
String rootUrl = globalConfig == null ? null : globalConfig.getUrl();

Choose a reason for hiding this comment

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

JenkinsLocationConfiguration.get() is @Nonnull, so why check it for null?

Copy link
Author

Choose a reason for hiding this comment

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

See comment in description of this pull request. The build fails findbugs validation without the null check. Did not spend much time understanding why findbugs does not follow the @nonnull annotation.

Copy link

@jakub-bochenski jakub-bochenski Dec 11, 2018

Choose a reason for hiding this comment

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

Sorry, I missed that part in PR description.

I was going to say that jenkinsci#26 has a passing build without the null check, but I've noticed it has no build configured

String buildUrl = "";
if (rootUrl == null) {
buildUrl = " PLEASE SET JENKINS ROOT URL FROM GLOBAL CONFIGURATION " + run.getUrl();
Expand Down