Find old or outdated open pull requests
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
For large or Data Center instances you should suspect there are alot of open pull requests that have not been updated in a while and are still open. In a large Bitbucket Data Center environment this can add up to be a large number. Each time the repository is updated, each open pull request needs to be evaluated to see if it needs to be updated. This can add to the background load. Closing out old open pull request can improve Bitbucket Data Center performance.
Having a small set of open pull request on a repository is normal. It is not abnormal to have 50 to 100 open pull requests for a repository.
診断
This SQL will show you all of the pull request that have had 1000+ rescopes and the last time the pull request was updated. This can indicate the age of the pull request. You can change the value to 500 or 100 to see how extensive the problem is on Bitbucket by changing the value: pr.entity_version > 1000 ← Here.
SELECT p.project_key,
r.slug,
pr.scoped_id,
pr.entity_version,
pr.updated_timestamp
FROM sta_pull_request pr
JOIN repository r
ON pr.to_repository_id = r.id
JOIN project p
ON r.project_id = p.id
WHERE pr.pr_state = 0
AND pr.entity_version > 1000
ORDER BY pr.entity_version desc;
This SQL will groups the pull request by project so you can isolate a particularly problematic project.
SELECT p.project_key,
Count(1)
FROM sta_pull_request pr
JOIN repository r
ON pr.to_repository_id = r.id
JOIN project p
ON r.project_id = p.id
WHERE pr.pr_state = 0
AND pr.entity_version > 1000
GROUP BY p.project_key
ORDER BY 2 desc;
原因
Sometimes pull request do take an extended period of time to evaluate if they need to be merged. But sometimes pull request get lost in the shuffle. Remember open pull request might be needed. Except for only the most obvious of cases, Only a developer of the code can know if the pull request should be closed.
ソリューション
Request that the owners of the repository close some of the older pull requests.
We are gathering impact for this Feature Request: