opencv making a good pull request - atinfinity/lab GitHub Wiki
OpenCVにPull Requestを送るために
OpenCVにPull Requestを送る際に留意しておくとよさそうだと思っている点をツラツラと書いてみました。適宜更新予定です。
How to contribute to OpenCV
OpenCVのコントリビュートに関するお作法が書いてあります。
https://github.com/opencv/opencv/wiki/How_to_contribute
Pull Request作成に関してはこちらを参照ください。
https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
コーディングガイドライン
OpenCVのソースコードを変更、追加する場合、以下のコーディングガイドラインを一読し、準拠しておくとよいです。
https://github.com/opencv/opencv/wiki/Coding_Style_Guide
ターゲットブランチ
Pull Request時のターゲットブランチを決めるために以下のページを読むとよいです。
https://github.com/opencv/opencv/wiki/Branches
https://github.com/opencv/opencv/branches、https://github.com/opencv/opencv_contrib/branchesには以下のブランチがあります。
- 2.4
- 3.4
- master
- next
これらのブランチの位置付けを後述します。
2.4
OpenCV 2.4系を管理するブランチ。
- Only critical bugfixes will be accepted
とあるので、2.4系にも影響するクリティカルなバグ修正以外はこのブランチをターゲットにしてPull Requestを作ることはないです。
3.4
OpenCV 3.4系を管理するブランチ。
- Target this branch in case of these patches:
- bug fixes
- optimizations
- documentation improvements
- sample improvements or adding new samples for existing functionality
- small improvements or new features which don't break compatibility with previous releases
- and other patches which are applicable for the 3.4 branch
上記記載があるので、OpenCV 3.4系に適用できるものは3.4ブランチをターゲットにしてPull Requestを作るのが望ましいと思います。
master
OpenCV 4系を管理するブランチ。
- API compatibility must be preserved
- If your pull request is also applicable to the 3.4 branch, you should - choose that branch as "base"
- If you've already created pull request based on the master branch, but - it is also applicable to 3.4, you will be asked to rebase it to 3.4, see the instruction in the following section.
next
OpenCV 5以降を管理するブランチ。
テスト
パフォーマンスに関わる変更を行う場合、パフォーマンステスト結果が必要になります。以下のページを読んでおくとよいでしょう。
- https://github.com/opencv/opencv/wiki/HowToUsePerfTests
- https://github.com/opencv/opencv/wiki/HowToWritePerfTests
CIコンフィグレーション
変更の影響が明らかな場合はテストを回すCIコンフィグレーションをPull Requestに記載することがあります。
記載例はhttps://github.com/opencv/opencv/pull/20354#issue-683149771です。
ここだと以下のように書かれています。
force_builders=Custom
build_image:Custom=halide:16.04
buildworker:Custom=linux-4,linux-6
指定できるCIコンフィグレーションの説明は以下にあります。CIコンフィグレーションとしてどれを指定するか判断つかない場合は未記入のままでよいです。
https://github.com/opencv/opencv/wiki/CI-configuration
チェックリスト
OpenCVのGitHubリポジトリからPull Request作成するとチェックリストが自動生成されます。
チェックリストは以下の通りです(ここではOpenCV 4.5.3時点のチェックリストを示します)。
https://github.com/opencv/opencv/blob/4.5.3/.github/PULL_REQUEST_TEMPLATE.md
Pull Request作成時にこれらのチェックボックスに対する対応を行い、チェックを埋めておくとよいでしょう。