Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,251
Community Members
 
Community Events
165
Community Groups

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

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

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?

@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 ? 

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?

@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 Feb 08, 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

@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 Feb 08, 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

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

0 votes
Bryan Turner Atlassian Team 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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,239 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you