Pull Requests in Bitbucket Server are not updated after pushes to source or target branch

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

問題

  • Pull requests are not updated when changes are pushed to their branches (i.e. target or source branch). Browsing commits on the pull request branches (i.e. select Commits and then the appropriate branch) shows the commits as expected.
  • Branch permissions are not being applied when users push commits.

原因

There are multiple possible causes of this problem.

  1. Bitbucket Server relies on hook scripts that are installed in each repository (and managed by the system) to provide change information that, in turn, allows it to update pull requests and check branch permissions. If the hooks are not installed correctly, or are damaged, these required callbacks do not happen and the functionality associated with them fails.
  2. When using Bitbucket Data Center, a cluster-wide lock is preventing pull requests from being updated

ソリューション

Depending on the cause of the problem, the following resolutions are available:

  1. Follow the steps in Git hook scripts are not executing after upgrading to Bitbucket Data Center 8.x to identify and fix problems with the git hooks. Make sure that this installation is not affected by the RejectedExecutionException issue.
  2. Peform a full cluster restart by stopping all nodes and starting them again one by one. A rolling restart (i.e. stopping and restarting one node at a time) will not resolve this problem as cluster locks are passed on to another available node when one is shut down.


Confirming the fix

The hooks triggering the rescope of the pull request will not work retroactively after installing them properly, so if the pull request in your repository was previously in a 'bad' (out-of-date) state and there were no new commits to the source branch of the pull request, the pull request will remain in an outdated state. To test whether the hooks are working after installation:

  • Declining and reopening all the affected pull requests is the simplest approach. This can be automated by using the following two REST API calls:
    • /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline
    • /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen
  • A new commit must be made to the source branch - this should now automatically update the pull request in Bitbucket Server with all missing commits
  • Alternatively, a merge from source branch to the target branch may be performed locally and pushed to Bitbucket Server, which should result in closing the pull request as 'Merged' automatically
最終更新日 2021 年 8 月 25 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する

このセクションの項目

Powered by Confluence and Scroll Viewport.