-
Notifications
You must be signed in to change notification settings - Fork 157
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
Improve support for Maven projects and fix build-info URL #618
Conversation
} else { | ||
url = createBuildInfoUrl(client.getUrl(), build.getName(), build.getNumber(), true); | ||
log.debug("Couldn't create the build-info URL from Artifactory URL: " + client.getUrl()); | ||
log.info("Build-info successfully deployed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we throw an exception in this case? Why are we good with the fact we couldn't create the build-info URL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. createBuildInfoUrl may fail to resolve the build info URL in the following specific scenario:
The input URL is Artifactory's URL (not platform) + there is a project + the Artifactory URL does not end with /artifactory
.
In that case, the build info was published successfully, but it is impossible to guess what is the build-info URL.
buildNumber, timeStamp, project, encode); | ||
} | ||
// If Artifactory's URL doesn't end with "/artifactory", it is impossible to create the URL. | ||
return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to throw an exception here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. This is part of a perfectly legal flow. The build info URL can't be determined in this very specific case. In that case, we may prefer to not display it.
Also, this function is in use in many places and I think we may not like to add a try-catch mechanism for each one of them.
Fix jfrog/jenkins-artifactory-plugin#576
Fix jfrog/jenkins-artifactory-plugin#611
To support using build projects in Maven UI jobs in Jenkins Artifactory plugin, this PR does the following:
createBuildInfoUrl
will try to guess the platform URL from Artifactory URL.?project=<project-key>
query param instead of?buildRepo=<project-key>-build-info
param.