-
Notifications
You must be signed in to change notification settings - Fork 354
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
[JENKINS-64418] Fix duplicate base URL in request to Bitbucket Server #959
[JENKINS-64418] Fix duplicate base URL in request to Bitbucket Server #959
Conversation
Commit e4d32d5 (for JENKINS-64418) introduced a bug that duplicates the base URL in some HTTP requests to Bitbucket Server, causing an error like this: java.io.FileNotFoundException: URL: https://bitbucket.examplehttps://bitbucket.example/rest/api/1.0/projects/DEMO/repos/demo/branches?filterText=master&start=0&limit=200 at com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi.doRequest java.io.IOException: Communication error for url: GET https://bitbucket.examplehttps://bitbucket.example/rest/api/1.0/projects/DEMOrepos/demo/branches?filterText=master&start=0&limit=200 HTTP/1.1 at com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi.doRequest at com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi.getRequest at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getResource at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getSingleBranch at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getBranch at com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource.retrieve at jenkins.scm.api.SCMSource.fetch The problem is that getSingleBranch prepends this.baseURL to the URI template and calls getResource, which expands the template and prepends this.baseURL to the resulting URL again. getResource is called only by getSingleTag and getSingleBranch, and both of them include the base URL in the template. Thus, getResource should not prepend it again.
The latest release 933.2.0 was made before the bug was introduced. |
@nfalco79 should I file a separate issue for this even though the bug has not been released yet? Or will the fix go in as part of the JENKINS-64418 implementation? |
No needed, you can refer the same jenkins issue. I normally release after 1/2 weeks it works in our production |
The commit title format |
Does matter I will change the title and comment on merge |
Tested that building a branch works OK with commit 539c964. Didn't test building a tag yet. |
Commit e4d32d5 (#927 for JENKINS-64418) introduced a bug that duplicates the base URL in some HTTP requests to Bitbucket Server, causing an error like this:
The problem is that
getSingleBranch
prependsthis.baseURL
to the URI template and callsgetResource
, which expands the template and prependsthis.baseURL
to the resulting URL again.getResource
is called only bygetSingleTag
andgetSingleBranch
, and both of them include the base URL in the template. Thus,getResource
should not prepend it again.Your checklist for this pull request