Add a check to avoid JENKINS-38664#22
Closed
hogarth-sv wants to merge 1 commit intojenkinsci:masterfrom
Closed
Conversation
wbagdon
reviewed
Oct 14, 2016
| String url; | ||
| try { | ||
| url = DisplayURLProvider.get().getRunURL(build); | ||
| if (url.startsWith("http://unconfigured-jenkins-location/")) { |
There was a problem hiding this comment.
It may be better to test if the domain name is a FQDN
URI testURI = new URI(url);
if (!testURI.getHost().contains(".")) {
throw new IllegalStateException("Jenkins RootURL not a FQDN");
}8a67082 to
6365b2a
Compare
Author
|
Sorry I missed your review before. I agree it's better to check fqdn than to rely on the output of the DisplayURLProvider plugin for an unconfigured jenkins instance. I've rebased against master and adjusted to instead do as you suggest. |
6365b2a to
f47879f
Compare
f47879f to
92d0b37
Compare
Author
|
Rebased against current master to resolve conflicts from recent changes |
Member
|
Will consider after #53 |
Member
|
Superceded by #97 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a check to ensure the Jenkins RootURL is configured and if it is not to skip the status notifier, rather than failing the build.
This mitigates JENKINS-38664 since it no longer causes the build to fail if the admin hasn't explicitly configured the Jenkins root URL.
The log results in this instead of the failure in the issue: