pull-request-notifier-for-bitbucket icon indicating copy to clipboard operation
pull-request-notifier-for-bitbucket copied to clipboard

Provide a variable for pull request branch plan build key (Bamboo)

Open ggrierson opened this issue 8 years ago • 2 comments

plugin version 3.6 Bitbucket Server v5.1.0

There is a plugin variable ${PULL_REQUEST_FROM_BRANCH} which gives the source branch name. To get Bamboo to build this branch, I first have to resolve the branch build key and project key which cannot be done within the plugin. I cannot call a GET URL in Bamboo for injection of response values, because that requires basic authentication, which I believe is not supported by the injection URL, only the final URL.

Can we add a variable called ${PULL_REQUEST_FROM_BRANCH_BUILD_KEY}, so that this can be used to trigger the branch plan when a corresponding PR is created?

Best solution I found so far is provided by Vitalii Buriak on this Atlassian Community page. But implementing this is giving me problems with current plugin.

Thanks!

ggrierson avatar Aug 02 '17 07:08 ggrierson

I now believe the injection URL does use the basic auth params given. It still requires some bash magic to get the response, parse the XML, find the plan key after fuzzy search matching the ${PULL_REQUEST_FROM_BRANCH} attribute, then call the Bamboo POST URL to start that branch build. Some more help from the plugin would be really great in this case.

ggrierson avatar Aug 06 '17 04:08 ggrierson

+1 Trying to figure this out right now. I can't get an exact match because our branches are "feature/XXX" and Bamboo renames them to "feature-XXX", so using ${PULL_REQUEST_FROM_BRANCH} doesn't match. Another option would be to allow some modification on the variables.

mwootendev avatar May 21 '18 20:05 mwootendev