Improve support for Maven projects and fix build-info URL#618
Improve support for Maven projects and fix build-info URL#618yahavi merged 2 commits intojfrog:masterfrom
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.
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.
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.
Wouldn't it be better to throw an exception here?
There was a problem hiding this comment.
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:
createBuildInfoUrlwill try to guess the platform URL from Artifactory URL.?project=<project-key>query param instead of?buildRepo=<project-key>-build-infoparam.