Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-12284

Eagerly update refs/pull-requests/*/from when a pull request's source branch changes

    • Icon: Suggestion Suggestion
    • Resolution: Done
    • 7.12.0
    • Pull Requests
    • None
    • 3,096
    • 4
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Issue Summary

      On creating a pull request in the Bitbucket UI, the stash-refs/pull-requests/<#> does not immediately get generated. This eventually prevent webhook from triggering the related changes. The stash-refs/pull-requests/<#> only can be seen after clicking on other tabs(Diff or Commits) or page.

      Steps to Reproduce

      1. Create a pull request on Bitbucket Server UI.
      2. Once the pull request is generated it will automatically redirect to the /projects/PRO02/repos/repo04/pull-requests/2/overview page.
      3. Back to the local repository in the client machine, run the following command:
        git ls-remote
        

      Expected Results

      It is expected that stash-refs/pull-requests/<#> is generated after the redirect from creating a pull request, and that git ls-remote shows those refs without having to refresh or direct to different tab/page in pull request UI.

      The same works fine on Bitbucket Server ver6.10.1, the following was capture in the atlassian-bitbucket.log:

      BBSv6.10.1
      2020-04-02 13:36:21,561 DEBUG [AtlassianEvent::thread-4] admin @1LEP0HUx816x174x0 1wsgekc 0:0:0:0:0:0:0:1 "POST /projects/PRO02/repos/repo04/pull-requests HTTP/1.1" c.a.s.i.j.i.e.RemoteEventPublisher Publishing remote event: com.atlassian.devstatus.vcs.JiraPullRequestEvent@b5a8ef9[type=CREATE,initiator=com.atlassian.devstatus.EventInitiator@6efd4da9[emails=[admin@admin.com],username=admin,displayName=admin,resource=http://localhost:7990/users/admin,avatar=http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028.jpg?s=128&d=mm],issueKeys=[BFJ-2],entity=com.atlassian.devstatus.EventEntity@4458397f[id=<null>,displayId=#2,resource=http://localhost:7990/projects/PRO02/repos/repo04/pull-requests/2],sourceId=<null>,sourceUrl=<null>]
      2020-04-02 13:36:21,579 DEBUG [AtlassianEvent::thread-2] admin @1LEP0HUx816x174x0 1wsgekc 0:0:0:0:0:0:0:1 "POST /projects/PRO02/repos/repo04/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventListener Queueing RemoteEvent com.atlassian.devstatus.vcs.JiraPullRequestEvent@b5a8ef9[type=CREATE,initiator=com.atlassian.devstatus.EventInitiator@6efd4da9[emails=[admin@admin.com],username=admin,displayName=admin,resource=http://localhost:7990/users/admin,avatar=http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028.jpg?s=128&d=mm],issueKeys=[BFJ-2],entity=com.atlassian.devstatus.EventEntity@4458397f[id=<null>,displayId=#2,resource=http://localhost:7990/projects/PRO02/repos/repo04/pull-requests/2],sourceId=<null>,sourceUrl=<null>]
      2020-04-02 13:36:21,579 DEBUG [AtlassianEvent::thread-2] admin @1LEP0HUx816x174x0 1wsgekc 0:0:0:0:0:0:0:1 "POST /projects/PRO02/repos/repo04/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventDispatcher RemoteEvent com.atlassian.devstatus.vcs.JiraPullRequestEvent@b5a8ef9[type=CREATE,initiator=com.atlassian.devstatus.EventInitiator@6efd4da9[emails=[admin@admin.com],username=admin,displayName=admin,resource=http://localhost:7990/users/admin,avatar=http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028.jpg?s=128&d=mm],issueKeys=[BFJ-2],entity=com.atlassian.devstatus.EventEntity@4458397f[id=<null>,displayId=#2,resource=http://localhost:7990/projects/PRO02/repos/repo04/pull-requests/2],sourceId=<null>,sourceUrl=<null>] consumable by []
      2020-04-02 13:36:21,580 DEBUG [AtlassianEvent::thread-2] admin @1LEP0HUx816x174x0 1wsgekc 0:0:0:0:0:0:0:1 "POST /projects/PRO02/repos/repo04/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventListener Batch size not exceeded for com.atlassian.devstatus.vcs.JiraPullRequestEvent@b5a8ef9[type=CREATE,initiator=com.atlassian.devstatus.EventInitiator@6efd4da9[emails=[admin@admin.com],username=admin,displayName=admin,resource=http://localhost:7990/users/admin,avatar=http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028.jpg?s=128&d=mm],issueKeys=[BFJ-2],entity=com.atlassian.devstatus.EventEntity@4458397f[id=<null>,displayId=#2,resource=http://localhost:7990/projects/PRO02/repos/repo04/pull-requests/2],sourceId=<null>,sourceUrl=<null>]
      2020-04-02 13:36:21,749 DEBUG [http-nio-7990-exec-1] admin @1LEP0HUx816x176x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /projects/PRO02/repos/repo04/pull-requests/2/overview HTTP/1.1" c.a.s.i.p.w.f.RequestCacheClientPageDataHandler Context bitbucket.pull-request.related-entities was required already. Ignoring.
      2020-04-02 13:36:21,749 DEBUG [http-nio-7990-exec-1] admin @1LEP0HUx816x176x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /projects/PRO02/repos/repo04/pull-requests/2/overview HTTP/1.1" c.a.s.i.p.w.f.RequestCacheClientPageDataHandler Context bitbucket.pull-request.links was required already. Ignoring.
      2020-04-02 13:36:21,749 DEBUG [http-nio-7990-exec-1] admin @1LEP0HUx816x176x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /projects/PRO02/repos/repo04/pull-requests/2/overview HTTP/1.1" c.a.s.i.p.w.f.RequestCacheClientPageDataHandler Context bitbucket.pull-request.overview.sections was required already. Ignoring.
      2020-04-02 13:36:21,751 DEBUG [http-nio-7990-exec-1] admin @1LEP0HUx816x176x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /projects/PRO02/repos/repo04/pull-requests/2/overview HTTP/1.1" c.a.s.i.p.w.f.RequestCacheClientPageDataHandler Context bitbucket.web.repository.clone.dialog.options was required already. Ignoring.
      2020-04-02 13:36:22,534 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 4: Could not resolve stash-refs/pull-requests/2/to directly or from packed-refs
      2020-04-02 13:36:22,537 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 4: Could not resolve refs/pull-requests/2/from directly or from packed-refs
      2020-04-02 13:36:22,540 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 4: Could not resolve refs/pull-requests/2/merge directly or from packed-refs
      2020-04-02 13:36:22,543 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.i.s.g.p.ShinyGitPorcelain 4: Initializing work tree in /home/lucifer/atlassian/application-data/bitbucket-home/6.10.1/tmp/git/repo04-work5654377337427207574
      2020-04-02 13:36:22,559 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git init --quiet /home/lucifer/atlassian/application-data/bitbucket-home/6.10.1/tmp/git/repo04-work5654377337427207574
      2020-04-02 13:36:22,568 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.i.s.g.p.ShinyGitPorcelain 4: Resetting /home/lucifer/atlassian/application-data/bitbucket-home/6.10.1/tmp/git/repo04-work5654377337427207574 to clean the index
      2020-04-02 13:36:22,581 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git reset --quiet a6965612196f15e9c21f70f3a0cb6e53e12d5629 --
      2020-04-02 13:36:22,583 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.i.scm.git.merge.MergeCommand PRO02/repo04[4]: Merging PRO02/repo04 refs/heads/development -> refs/heads/master in /home/lucifer/atlassian/application-data/bitbucket-home/6.10.1/tmp/git/repo04-work5654377337427207574
      2020-04-02 13:36:22,591 DEBUG [http-nio-7990-exec-2] admin @1LEP0HUx816x180x1 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/activities HTTP/1.1" c.a.s.i.p.c.d.DriftCommentUpdateProcessor 4:2@0: No rescopes are pending drift
      2020-04-02 13:36:22,603 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git merge -m Automatic merge --no-ff --no-log --allow-unrelated-histories 14b47550df92cc831036119b753e9b39b2466fda
      2020-04-02 13:36:22,606 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.i.scm.git.merge.MergeCommand PRO02/repo04[4]: Fetching successful merge to stash-refs/pull-requests/2/merge from /home/lucifer/atlassian/application-data/bitbucket-home/6.10.1/tmp/git/repo04-work5654377337427207574
      2020-04-02 13:36:22,607 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.i.s.g.f.ObjectFetchStrategy com.atlassian.stash.internal.scm.git.fetch.FetchRequest@43063d1c: Fetching single-repository merge by copying new objects
      2020-04-02 13:36:22,624 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git update-ref stash-refs/pull-requests/2/merge b3008999882cf0185513bc7e201c32fe4b5d1dde
      2020-04-02 13:36:22,630 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.i.s.g.p.ShinyGitPullRequestPorcelain PRO02/repo04[4]: Pull request 2@0 automatically merged in stash-refs/pull-requests/2/merge as commit b3008999882cf0185513bc7e201c32fe4b5d1dde
      2020-04-02 13:36:22,640 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.i.s.g.p.DefaultPullRequestRefHelper PRO02/repo04[4]:2@0: Resolved effective diff from a6965612196f15e9c21f70f3a0cb6e53e12d5629 to b3008999882cf0185513bc7e201c32fe4b5d1dde (CLEAN)
      2020-04-02 13:36:22,642 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 4: Could not resolve stash-refs/pull-requests/2/from directly or from packed-refs
      2020-04-02 13:36:22,645 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 4: Could not resolve stash-refs/pull-requests/2/from directly or from packed-refs
      2020-04-02 13:36:22,659 DEBUG [http-nio-7990-exec-4] admin @1LEP0HUx816x177x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO02/repos/repo04/pull-requests/2/merge HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git update-ref stash-refs/pull-requests/2/from 14b47550df92cc831036119b753e9b39b2466fda
      2020-04-02 13:36:22,779 DEBUG [http-nio-7990-exec-8] admin @1LEP0HUx816x182x0 1wsgekc 0:0:0:0:0:0:0:1 "GET /rest/jira/latest/projects/PRO02/repos/repo04/pull-requests/2/issues HTTP/1.1" c.a.bitbucket.scm.BaseCommand Executed /usr/bin/git rev-list --format=%H%x02%P%x02%aN%x02%aE%x02%at%x02%cN%x02%cE%x02%ct --topo-order 14b47550df92cc831036119b753e9b39b2466fda ^a6965612196f15e9c21f70f3a0cb6e53e12d5629 --
      

      Actual Results

      After a pull request is created, the merge check still runs but does not create any pull request refs.

      BBSv7.0.1
      2020-04-02 13:27:23,195 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx807x409x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /projects/PRO1/repos/repo02/pull-requests/4/overview HTTP/1.1" c.a.s.i.p.w.f.RequestCacheClientPageDataHandler Context bitbucket.web.repository.clone.dialog.options was required already. Ignoring.
      2020-04-02 13:27:23,828 DEBUG [http-nio-7990-exec-9] admin @UXZSPNx807x413x2 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/client-plugins/1.0/client-plugins/items HTTP/1.1" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key  and locales [en_US, en]
      2020-04-02 13:27:23,846 DEBUG [http-nio-7990-exec-6] admin @UXZSPNx807x414x1 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/client-plugins/1.0/client-plugins/items HTTP/1.1" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key  and locales [en_US, en]
      2020-04-02 13:27:23,851 DEBUG [http-nio-7990-exec-6] admin @UXZSPNx807x414x1 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/client-plugins/1.0/client-plugins/items HTTP/1.1" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key  and locales [en_US, en]
      2020-04-02 13:27:23,871 DEBUG [http-nio-7990-exec-1] admin @UXZSPNx807x416x3 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/activities HTTP/1.1" c.a.s.i.p.c.d.DriftCommentUpdateProcessor 1:4@0: No rescopes are pending drift
      2020-04-02 13:27:23,873 DEBUG [http-nio-7990-exec-7] admin @UXZSPNx807x411x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/merge HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 1: Could not resolve stash-refs/pull-requests/4/to directly or from packed-refs
      2020-04-02 13:27:23,877 DEBUG [http-nio-7990-exec-7] admin @UXZSPNx807x411x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/merge HTTP/1.1" c.a.s.i.s.g.p.ShinyGitPorcelain 1: Initializing work tree in /home/lucifer/atlassian/application-data/bitbucket-home/7.0.1/tmp/git/repo02-work838738412132698775
      2020-04-02 13:27:23,891 DEBUG [http-nio-7990-exec-7] admin @UXZSPNx807x411x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/merge HTTP/1.1" c.a.s.i.s.g.p.ShinyGitPorcelain 1: Resetting /home/lucifer/atlassian/application-data/bitbucket-home/7.0.1/tmp/git/repo02-work838738412132698775 to clean the index
      2020-04-02 13:27:23,898 DEBUG [http-nio-7990-exec-7] admin @UXZSPNx807x411x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/merge HTTP/1.1" c.a.s.i.scm.git.merge.MergeCommand PRO1/repo02[1]: Merging PRO1/repo02 refs/heads/feature/tron-1.1.0 -> refs/heads/master in /home/lucifer/atlassian/application-data/bitbucket-home/7.0.1/tmp/git/repo02-work838738412132698775
      2020-04-02 13:27:23,910 DEBUG [http-nio-7990-exec-7] admin @UXZSPNx807x411x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/merge HTTP/1.1" c.a.s.i.scm.git.merge.MergeCommand PRO1/repo02[1]: Successfully merged PRO1/repo02 refs/heads/feature/tron-1.1.0 -> refs/heads/master. The merge will be discarded as no FetchStrategy was supplied
      2020-04-02 13:27:23,913 DEBUG [http-nio-7990-exec-7] admin @UXZSPNx807x411x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/merge HTTP/1.1" c.a.s.i.s.g.p.ShinyGitPullRequestPorcelain PRO1/repo02[1]: Pull request 4@0 merged automatically without conflicts
      2020-04-02 13:27:23,937 DEBUG [http-nio-7990-exec-3] admin @UXZSPNx807x417x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/inbox/pull-requests/count HTTP/1.1" c.a.s.i.rest.inbox.InboxResource Retrieving pull request count for user admin
      2020-04-02 13:27:24,238 DEBUG [http-nio-7990-exec-9] admin @UXZSPNx807x421x1 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/jira/latest/projects/PRO1/repos/repo02/pull-requests/4/issues HTTP/1.1" c.a.b.i.i.j.DefaultJiraIssueService Bitbucket has not been linked to Jira
      2020-04-02 13:28:20,762 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx808x424x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/changes HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 1: Could not resolve refs/pull-requests/4/from directly or from packed-refs
      2020-04-02 13:28:20,763 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx808x424x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/changes HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 1: Could not resolve refs/pull-requests/4/merge directly or from packed-refs
      2020-04-02 13:28:20,764 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx808x424x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/changes HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 1: Could not resolve stash-refs/pull-requests/4/from directly or from packed-refs
      2020-04-02 13:28:20,770 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx808x424x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/changes HTTP/1.1" c.a.s.i.s.g.p.ShinyGitPullRequestPorcelain PRO1/repo02[1]: Resolved merge-base 9d696badb6d87b325d4c7dbf4ff286f89acbe8df for pull request 4@0
      2020-04-02 13:28:20,773 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx808x424x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/changes HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 1: Could not resolve stash-refs/pull-requests/4/from directly or from packed-refs
      2020-04-02 13:28:20,774 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx808x424x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/changes HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 1: Could not resolve stash-refs/pull-requests/4/from directly or from packed-refs
      2020-04-02 13:28:20,784 DEBUG [http-nio-7990-exec-8] admin @UXZSPNx808x424x0 2p0ibe 0:0:0:0:0:0:0:1 "GET /rest/api/latest/projects/PRO1/repos/repo02/pull-requests/4/changes HTTP/1.1" c.a.s.internal.scm.git.RawGitAgent 1: Could not resolve refs/pull-requests/4/merge directly or from packed-refs
      

      Workaround

      Retrieve the pull request's diff, either using REST or the PullRequestService. This will trigger the refs to be updated. Apps which have workarounds to call PullRequestService.canMerge, ScmPullRequestCommandFactory.tryMerge or make a GET request to $BASE_URL/projects/KEY/repos/slug/pull-requests/ID/merge need to be updated to access the diff instead.

            [BSERV-12284] Eagerly update refs/pull-requests/*/from when a pull request's source branch changes

            2433cf33d5d3,

            I addressed that specifically in my comment from early February:

            These changes will not restore 3-way diffs, and merge refs will still not be created.

            I understand there are a variety of reasons why people are hoping the merge ref will be re-added, and I will add that I've had some discussions internally about options for doing so. It's not a simple change, though. 3-way diffs, and the merge that supported them, were removed for a reason. For many reasons. And if we bring the merge ref back it's almost certain people will want it to be eager, like from now is, and that would essentially undo all of the performance benefits of removing 3-way diffs in the first place.

            For the moment, in the spirit of openness, I would encourage everyone to plan around the idea that the merge ref will never be re-added.

            Best regards,
            Bryan Turner
            Atlassian Bitbucket

            Bryan Turner (Inactive) added a comment - 2433cf33d5d3 , I addressed that specifically in my comment from early February: These changes will not restore 3-way diffs, and merge refs will still not be created. I understand there are a variety of reasons why people are hoping the merge ref will be re-added, and I will add that I've had some discussions internally about options for doing so. It's not a simple change, though. 3-way diffs, and the merge that supported them, were removed for a reason. For many reasons. And if we bring the merge ref back it's almost certain people will want it to be eager, like from now is, and that would essentially undo all of the performance benefits of removing 3-way diffs in the first place. For the moment, in the spirit of openness, I would encourage everyone to plan around the idea that the merge ref will never be re-added. Best regards, Bryan Turner Atlassian Bitbucket

            Jan Sramek added a comment - - edited

            Hello Bryan,

            With recent fix on pull requests refs, could you please also comment on refs/pull-requests/*/merge. 

            In your previous comment https://jira.atlassian.com/browse/BSERV-12284?focusedCommentId=2389584&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2389584 

            refs/pull-requests/*/merge has been fully removed in 7.0 and will never be created/updated by the system again. 

            Is it still true that refs/pull-requests/*/merge will not be created by the system again?

            Thanks

            Jan

            Jan Sramek added a comment - - edited Hello Bryan, With recent fix on pull requests refs, could you please also comment on refs/pull-requests/*/merge.  In your previous comment  https://jira.atlassian.com/browse/BSERV-12284?focusedCommentId=2389584&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-2389584   refs/pull-requests/*/merge has been fully removed in 7.0 and will never be created/updated by the system again.  Is it still true that refs/pull-requests/*/merge will not be created by the system again? Thanks Jan

            Updates to make pull request ref creation deterministic have been merged internally and deployed to our dogfooding and production instances to soak.

            The changes were merged too late to be included in Bitbucket Data Center/Server 7.11.0. We've already encountered issues in dogfooding with the new eager processing, so we view soaking as very important for both the scalability and stability of this change. The changes are currently planned for Bitbucket Data Center/Server 7.12.0, which will likely happen in its normal cadence after 7.11.0, which means it should be well-soaked both internally and externally by the time the next LTS is released. (7.12 will not be an LTS.) My apologies for the delay on releasing this, but we want to ensure these eager updates don't cause unexpected issues or excessive load.

            Lastly, just to reiterate what I posted previously, we will not backport these changes. 7.12.0 will be the first version to apply deterministic updates and previous releases (like the 7.6 LTS) will not be updated.

            Best regards,
            Bryan Turner
            Atlassian Bitbucket

            Bryan Turner (Inactive) added a comment - Updates to make pull request ref creation deterministic have been merged internally and deployed to our dogfooding and production instances to soak. The changes were merged too late to be included in Bitbucket Data Center/Server 7.11.0. We've already encountered issues in dogfooding with the new eager processing, so we view soaking as very important for both the scalability and stability of this change. The changes are currently planned for Bitbucket Data Center/Server 7.12.0, which will likely happen in its normal cadence after 7.11.0, which means it should be well-soaked both internally and externally by the time the next LTS is released. (7.12 will not be an LTS.) My apologies for the delay on releasing this, but we want to ensure these eager updates don't cause unexpected issues or excessive load. Lastly, just to reiterate what I posted previously, we will not backport these changes. 7.12.0 will be the first version to apply deterministic updates and previous releases (like the 7.6 LTS) will not be updated. Best regards, Bryan Turner Atlassian Bitbucket

            An update for those seeking more deterministic updates for pull request from refs: I've expanded the scope of another issue we're working on "nearby" in the code to include changes that will make from refs update more consistently and more quickly after new changes are made. It's not yet clear exactly what release the changes will ship in, but I wanted to let everyone know they're actively under development and will ship when they're ready/tested.

            Along with that update, and in the spirit of open communication and clarity, I want to note a couple things explicitly:

            • These changes will not be backported. The existing behavior is intentional, not a bug, and so work related to it is not eligible for backport.
            • These changes will not restore 3-way diffs, and merge refs will still not be created. At this time we have no plans to return to 3-way diffs for pull requests. We also have no plans to make diff behavior configurable, which represents a worst-of-all-worlds option for maintenance and future features.

            I'll keep this issue updated as our work progresses, and will note the ship version here when it's confirmed.

            Best regards,
            Bryan Turner
            Atlassian Bitbucket

            Bryan Turner (Inactive) added a comment - An update for those seeking more deterministic updates for pull request from refs: I've expanded the scope of another issue we're working on "nearby" in the code to include changes that will make from refs update more consistently and more quickly after new changes are made. It's not yet clear exactly what release the changes will ship in, but I wanted to let everyone know they're actively under development and will ship when they're ready/tested. Along with that update, and in the spirit of open communication and clarity, I want to note a couple things explicitly: These changes will not be backported . The existing behavior is intentional, not a bug, and so work related to it is not eligible for backport. These changes will not restore 3-way diffs, and merge refs will still not be created. At this time we have no plans to return to 3-way diffs for pull requests. We also have no plans to make diff behavior configurable, which represents a worst-of-all-worlds option for maintenance and future features. I'll keep this issue updated as our work progresses, and will note the ship version here when it's confirmed. Best regards, Bryan Turner Atlassian Bitbucket

            How quickly can we get this fixed?  It's breaking all our pull-request builds.  This is very disruptive for all our development teams.

            markdemich added a comment - How quickly can we get this fixed?  It's breaking all our pull-request builds.  This is very disruptive for all our development teams.

            We are delaying upgrade to BB 7 until this is available again since most of our customers use this feature. Either add this back in or alternatively support forward looking merges to verify outcomes of merges prior merges being done. for more complex and distributed and parallel repositories, this is a must be to sustain consistent and green builds of main branches.

            Lubos Housa added a comment - We are delaying upgrade to BB 7 until this is available again since most of our customers use this feature. Either add this back in or alternatively support forward looking merges to verify outcomes of merges prior merges being done. for more complex and distributed and parallel repositories, this is a must be to sustain consistent and green builds of main branches.

            Please work on this

            Not creating the refs (like refs/pull-requests/4/from) is breaking all our multi-branch pipeline jobs since upgrading to Bitbucket 7

             

            As commented above, plugin https://github.com/Cyanoth/Bitbucket-EagerPR-Updates works around this (verified on a VM with Bitbucket server) but our organisation doesn't allow installation of that plugin.

            Ferry Huberts added a comment - Please work on this Not creating the refs (like refs/pull-requests/4/from) is breaking all our multi-branch pipeline jobs since upgrading to Bitbucket 7   As commented above, plugin https://github.com/Cyanoth/Bitbucket-EagerPR-Updates works around this (verified on a VM with Bitbucket server) but our organisation doesn't allow installation of that plugin.

            Please work on the issue:

            Since the PR generation take s long time, most of the first Jenkins builds of new Pull Requests fail immediately with the following error:

            "stderr: fatal: Couldn't find remote ref refs/pull-requests/<#PR>/from"

            Basavaraj Naragund added a comment - Please work on the issue: Since the PR generation take s long time, most of the first Jenkins builds of new Pull Requests fail immediately with the following error: "stderr: fatal: Couldn't find remote ref refs/pull-requests/<#PR>/from"

            @Hamzah I used this plugin to resolve the issue pending an official fix by Atlassian, https://github.com/Cyanoth/Bitbucket-EagerPR-Updates

            Matt Winfield added a comment - @Hamzah I used this plugin to resolve the issue pending an official fix by Atlassian,  https://github.com/Cyanoth/Bitbucket-EagerPR-Updates

            @Dani It didn't fix it for me unfortunately. Thanks for the suggestion.

            Hamzah Mohamed added a comment - @Dani It didn't fix it for me unfortunately. Thanks for the suggestion.

              bturner Bryan Turner (Inactive)
              bannamalai Baskar Annamalai (Inactive)
              Votes:
              122 Vote for this issue
              Watchers:
              127 Start watching this issue

                Created:
                Updated:
                Resolved: