[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz updated an issue Jenkins / JENKINS-50742 Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder Change By: Karl Shultz Component/s: bitbucket-branch-source-plugin Component/s: blueocean-plugin Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz updated an issue Jenkins / JENKINS-50742 Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder Change By: Karl Shultz Environment: Jenkins:Running release/1.5 via hpi:run, but this can be recreated otherwise. bitbucket-branch-source 2.2.9 SCM:Bitbucket server only. GitHub is not affected by this.Client:Fedora Workstation 27, Chrome 65.0.3325.181 Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz edited a comment on JENKINS-50742 Re: Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder Here's what I've found.I bounced out to the Classic UI and clicked this link. It goes to the same, incorrect, PR builder.:!screenshot-1.png|thumbnail!So, we know this isn't really a Blue Ocean bug, because it's broken in classic as well. Now determined to find where this was coming from, I started grep'ing around in my Jenkins.In {{jobs/the-bitbucket-multibranch-job/branches/master/config.xml}}, there's an {{}} section. That looks like this:{code:xml} icon-bitbucket-branchhttps://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409/compare/commits?sourceBranch=refs%2Fheads%2Fmasterhttps://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409/compare/commits?sourceBranch=refs%2Fheads%2Fmaster{code}Those are the URLs which the links are taking me to, and they're wrong.So what's generating them? I wonder if it's this line in {{[BitbucketSCMSource.java|https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java#L1062]}}. It looks like this:{code:java}template = UriTemplate.fromTemplate(getServerUrl() + SERVER_REPO_TEMPLATE + "/compare/commits{?sourceBranch}"){code}Let's construct that by hand:1. {{getServerUrl()}} presumably returns {{[https://bitbucket.beescloud.com|https://bitbucket.beescloud.com/]}}, since that's the server I set up. 2. {{[SERVER_REPO_TEMPLATE|https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java#L136]}} is {{"/projects\{/owner}/repos\{/repo}"}}, and that will resolve to {{projects/FEB/repos/jenkins-49409 }} 3. {{/compare/commits}}4. {{\{?sourceBranch}}} is likely to resolve to {{refs/heads/master}}, just going on what I see in the console output for the checkout: {code:none}git fetch --no-tags --progress https://github.beescloud.com/dev1/another-blank-repo.git +refs/heads/master:refs/remotes/origin/master{code}4. This gives us {code:none}https://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409 /compare/commits?sourceBranch=refs/heads/master{code}And that sure looks like the URL in {{config.xml}} to me. Add Comment
[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz edited a comment on JENKINS-50742 Re: Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder Here's what I've found.I bounced out to the Classic UI and clicked this link. It goes to the same, incorrect, PR builder.:!screenshot-1.png|thumbnail!So, we know this isn't really a Blue Ocean bug, because it's broken in classic as well. Now determined to find where this was coming from, I started grep'ing around in my Jenkins.In {{jobs/the-bitbucket-multibranch-job/branches/master/config.xml}}, there's an {{}} section. That looks like this:{code:xml} icon-bitbucket-branchhttps://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409/compare/commits?sourceBranch=refs%2Fheads%2Fmasterhttps://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409/compare/commits?sourceBranch=refs%2Fheads%2Fmaster{code}Those are the URLs which the links are taking me to, and they're wrong.So what's generating them? I wonder if it's this line in {{[BitbucketSCMSource.java|https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java#L1062]}}. It looks like this:{code:java}template = UriTemplate.fromTemplate(getServerUrl() + SERVER_REPO_TEMPLATE + "/compare/commits{?sourceBranch}"){code}Let's construct that by hand:1. {{getServerUrl()}} presumably returns {{[https://bitbucket.beescloud.com|https://bitbucket.beescloud.com/]}}, since that's the server I set up. 2. {{[SERVER_REPO_TEMPLATE|https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java#L136]}} is {{"/projects\{/owner}/repos\{/repo}"}}, and that will resolve to {{projects/FEB/repos/jenkins-49409 3. {{/compare/commits}}4. {{\{?sourceBranch}}} is likely to resolve to {{refs/heads/master}}, just going on what I see in the console output for the checkout: {code:none}git fetch --no-tags --progress https://github.beescloud.com/dev1/another-blank-repo.git +refs/heads/master:refs/remotes/origin/master{code}4. This gives us {code:none}https://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409 /compare/commits?sourceBranch=refs/heads/master{code} And that sure looks like the URL in {{config.xml}} to me. Add Comment
[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz commented on JENKINS-50742 Re: Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder Here's what I've found. I bounced out to the Classic UI and clicked this link. It goes to the same, incorrect, PR builder.: So, we know this isn't really a Blue Ocean bug, because it's broken in classic as well. Now determined to find where this was coming from, I started grep'ing around in my Jenkins. In jobs/the-bitbucket-multibranch-job/branches/master/config.xml, there's an section. That looks like this: "cloudbees-bitbucket-branch-source@2.2.9"> icon-bitbucket-branch https://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409/compare/commits?sourceBranch=refs%2Fheads%2Fmaster "scm-api@2.2.2"> https://bitbucket.beescloud.com/projects/FEB/repos/jenkins-49409/compare/commits?sourceBranch=refs%2Fheads%2Fmaster "scm-api@2.2.2"/> Those are the URLs which the links are taking me to, and they're wrong. So what's generating them? I wonder if it's this line in BitbucketSCMSource.java. It looks like this: template = UriTemplate .fromTemplate(getServerUrl() + SERVER_REPO_TEMPLATE + "/compare/commits{?sourceBranch}") Let's construct that by hand: 1. getServerUrl() presumably returns https://bitbucket.beescloud.com, since that's the server I set up. 2. SERVER_REPO_TEMPLATE is "/projects{/owner}/repos{/repo}", and that will resolve to {{projects/FEB/repos/jenkins-49409 3. /compare/commits 4. {?sourceBranch} is likely to resolve to refs/heads/master, just going on what I see in the console output for the checkout: git fetch --no-tags --progress https://github.beescloud.com/dev1/another-blank-repo.git +refs/heads/master:refs/remotes/origin/master 4. This gives us https://bitbucket.beescloud.com/ projects/FEB/repos/jenkins-49409 /compare/commits ?sourceBranch=refs/heads/master
[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz updated an issue Jenkins / JENKINS-50742 Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder Change By: Karl Shultz Attachment: screenshot-1.png Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz commented on JENKINS-50742 Re: Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder I have a strong suspicion that this is a Bitbucket Branch Source issue, not a Blue Ocean issue. Investigating. Add Comment This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-50742) Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder
Title: Message Title Karl Shultz created an issue Jenkins / JENKINS-50742 Detail view for pipelines on Bitbucket: "Opens branch in a new window" incorrectly goes to BB pull request builder Issue Type: Bug Assignee: Unassigned Attachments: image-2018-04-11-11-48-53-829.png, image-2018-04-11-11-50-07-421.png, image-2018-04-11-11-55-50-314.png, image-2018-04-11-11-59-29-142.png Components: blueocean-plugin Created: 2018-04-11 16:02 Environment: Jenkins: Running release/1.5 via hpi:run, but this can be recreated otherwise. SCM: Bitbucket server only. GitHub is not affected by this. Client: Fedora Workstation 27, Chrome 65.0.3325.181 Priority: Minor Reporter: Karl Shultz Summary Given a working Pipeline on Bitbucket Server, clicking on a successful run of any branch produces the details page as expected. Clicking the button next to the Branch name in the top left corner of the page takes the user to a Bitbucket pull request builder page, instead of simply going to Bitbucket with that branch preselected. Frequency 100% Steps to recreate 1. Connect to a Bitbucket repo with a functioning Jenkinsfile via Blue Ocean, and run that pipeline if you haven't already. 2. Click a successful run of master (or any branch really, it doesn't matter which) to produce the details view, which looks like this: 3. Click the button next to the branch name, up near the top left corner of the page. The tooltip says "Opens branch in a new window:" 4. That new window will take you to what I call the pull request builder on your Bitbucket server. The URL that button is pointing to is