Bitbucket Server/Data Center Auto Unapprove plugin does not remove approvals even after new commits are pushed to the source 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 は除く

要約

Bitbucket Server/Data Center Auto Unapprove plugin does not remove approvals from Pull Request even after new commits are pushed to the Source Branch.

環境

すべて

診断

  • The Auto Unapprove Plugin does not remove approvals even after new commits are pushed to a pull request Source Branch.
  • The logs will show that both before and after diff patch ids are same after the Pull Request rescoping is completed. (Since the diff patch ids are same, it means that there was no change to the diffs between the source and the target branch even after the new commits were pushed)

    2023-01-25 08:25:53,358 DEBUG [pull-request-rescoping:thread-1]  c.a.s.i.p.r.PullRequestRescopeBucketProcessor MYP/repo1[1]: Rescoping completed (0 errors, 0 skipped)
    2023-01-25 08:25:53,378 DEBUG [threadpool:thread-2]  c.a.b.i.unapprove.GitRescopeAnalyzer Old patch ID(s): [f9591347a8c1cfcd1e87b38d17653d4ed2e91492]; new patch ID(s): [f9591347a8c1cfcd1e87b38d17653d4ed2e91492]
  • You can also verify if the diff patch ids are same before and after the new commit were pushed using below command on your local copy of the repository. 

    git diff <<target_branch>>...<<source_branch_old_commitid>> | git patch-id --stable 
    
    git diff <<target_branch>>...<<source_branch_new_commitid>> | git patch-id --stable 





原因

  • This is due to a feature of Auto Unapprove plugin where it will only trigger if there is an actual material change in diffs between the two branches. Actions like Clean sync-merges, amending commit messages, rebases, etc, that do not change the diff will not trigger the unapprove.
  • This is also better explained with examples here : auto-unapprove issue 15. This is an additional check that was incorporated to eliminate spurious unapproves.

ソリューション

  • As mentioned in the README of the plugin this "default" behaviour can be disabled at a global level by setting "plugin.bitbucket-pr-auto-unapprove.gitrescopeanalyzer.patchid.enabled" to false in the Bitbucket properties file.

  • Additionally Patch ID can be expensive to compute. By default, it will timeout after 20 seconds and reset the approvals, but this behaviour can also be configured globally by setting "plugin.bitbucket-pr-auto-unapprove.gitrescopeanalyzer.patchid.timeout.seconds".


最終更新日: 2023 年 1 月 25 日

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

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.