Current Atlassian position regarding refs/pull-requests/*/from (merge) refs

Freddy May 12, 2020

Hello!

I would like to follow-up on this thread response:
https://community.atlassian.com/t5/Bitbucket-questions/Difference-of-refs-pull-requests-lt-ID-gt-merge-and-refs-pull/qaq-p/772142

Long story short, I wanted to confirm if:
a) are "from" refs considered to be internal as well as "merge"? I`m asking because this guide: https://www.atlassian.com/git/articles/pull-request-proficiency-fetching-abilities-unlocked explicitly mentions usage of refspec on */from ref. Is it safe to use it?
b) has anything changed regarding the */merge refs, by chance (in terms of being officially supported/internal)?
c) as of now, we do have an implementation which is dependant on */from refs. Do you have any plans for implementing the same refs for the Bitbucket Cloud?

Looking forward to hear from you on this topic - please let me know if you`d like any details on the questions above.

3 answers

1 vote
falloutphil November 7, 2021

Is there any reason why the merge refs is not being considered for (re)implementation?  It's an extremely useful feature to test the result of a merge - and it seems many customers have used it in this fashion?

My organization has just rolled-back back 7.17 on discovering the feature had been removed.  I appreciate it was never a documented part of the API, but the reality is not having it is a bit of showstopper for us using BitBucket.

 

Is there an open ticket I can support for merge refs as well as from refs?

1 vote
Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 13, 2020

@Freddy

a) Pull request refs have always been, and still are, considered an internal implementation detail. We document how to use them, but the primary purpose for that is for developers to be able to fetch changes and play around with them locally in an editor or other environment. Pull request refs are not updated in a deterministic fashion, which makes relying on them for builds, for example, dangerous. (This is exacerbated in 7.x; see BSERV-12284 for more details.)

b) 7.x no longer creates "merge" refs, as part of switching from 3-way diffs in pull requests to 2-way diffs, so anything built against them will not be possible on 7.0 or newer. We currently have no plans to ever bring "merge" refs back.

c) The Bitbucket Server team has no direct connection with Bitbucket Cloud. The two systems don't share a single line of code (they're not even written in the same language). BCLOUD-5814 is an open issue about adding pull request refs to Cloud, in case it's useful to you for advocating for the feature or tracking its delivery.

Hope this helps!
Bryan Turner
Atlassian Bitbucket

0 votes
Jgafner October 15, 2020

@Bryan Turner  hi , Is it correct to say that the from branch is created only when user switch to the diff tab in a pull request and not when the pull request is created ? 

John Clarete February 8, 2021

I seem to be experiencing the same thing, just wondering if you found another way to trigger builds on creation of the PR without having to go down the webhooks path. @Bryan Turner are you able to confirm if there's another way?

Jgafner February 8, 2021

@John Clarete  Not sure it is related the build triggering to this pr. 

Maybe you wanted to reply to the main thread of this question but you replied to my comment.
I was referring on the branch created in background by BB when a pr is opening. Was not talking about the build at all. 

Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2021

@John Clarete- I'm not really sure what you're asking here. Bitbucket Server doesn't raise webhooks for pull request ref changes. How you trigger your builds is largely up to you and the CI system you use. I'd assume most people use polling, or use a webhook coupled to the underlying pull request itself (i.e. the "pr:from_ref_updated" webhook; though, please note, that webhook is about when the ref is updated in the database, not in the underlying Git repository).

@Jgafner- Just a quick update for you while I'm here, but BSERV-12284 is now in progress, and a future version will make updating the "from" ref in the repository more deterministic. (It will not bring back "merge" refs, though; we have no plans to do so.)

Best regards,
Bryan Turner
Atlassian Bitbucket

John Clarete February 8, 2021

@Bryan Turner  Sorry for the lack of context. Basically I'm relying on the "from" branch to be created when the PR is created (it just happens that I'm using this for the build process) but as discussed here it does not do that and this is by design. I was hoping there was another way to get the from branch created automatically or if @Jgafner found a way to create the branch in the background until BSERV-12284 is completed.

Bryan Turner
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 8, 2021

There's a third-party plugin that's been created that automatically makes a call to get the pull request effective diff which, with the existing code, will create or update the "from" ref. I can't speak to the quality of it (I've never looked at it), and you'd need to investigate the performance implications of using it in your environment, but it may be a way forward until BSERV-12284 ships.

Best regards,
Bryan Turner
Atlassian Bitbucket

falloutphil November 7, 2021

Hi @Bryan Turner - What's the name of the plugin?  Does it create "merge refs"

Like Joe likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events