Part 1
요약·해설
작고 self-contained한 PR, RFC가 필요한 큰 변경, commit별 build와 CI·test·문서 요건, review workflow, 지연된 PR과 기술 이견의 상향 절차, reviewer의 행동과 우선순위를 설명합니다.
Small · Incremental
Build · Test · Docs
Escalation · Respect
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
41F636EF8170E98C6A124D0384DB3A0D7B2B97D35389E23E179ED98171CA48E9
.. _contributor-expectations:
Contributor Expectations
########################
The Zephyr project encourages :ref:`contributors <contributor>` to submit
changes as smaller pull requests. Smaller pull requests (PRs) have the following
benefits:
- Reviewed more quickly and reviewed more thoroughly. It's easier for reviewers
to set aside a few minutes to review smaller changes several times than it is
to allocate large blocks of time to review a large PR.
- Less wasted work if reviewers or maintainers reject the direction of the
change.
- Easier to rebase and merge. Smaller PRs are less likely to conflict with other
changes in the tree.
- Easier to revert if the PR breaks functionality.
.. note::
This page does not apply to draft PRs which can have any size, any number of
commits and any combination of smaller PRs for testing and preview purposes.
Draft PRs have no review expectation and PRs created as drafts from the start
do not notify anyone by default.
Defining Smaller PRs
********************
- Smaller PRs should encompass one self-contained logical change.
- When adding a new large feature or API, the PR should address only one part of
the feature. In this case create an :ref:`RFC proposal <rfcs>` to describe the
additional parts of the feature for reviewers.
- PRs should include tests or samples under the following conditions:
- Adding new features or functionality.
- Modifying a feature, especially for API behavior contract changes.
- Fixing a hardware agnostic bug. The test should fail without the bug fixed
and pass with the fix applied.
- PRs must update any documentation affected by a functional code change.
- If introducing a new API, the PR must include an example usage of the API.
This provides context to the reviewer and prevents submitting PRs with unused
APIs.
Multiple Commits on a Single PR
*******************************
Contributors are further encouraged to break up PRs into multiple commits. Keep
in mind each commit in the PR must still build cleanly and pass all the CI
tests.
For example, when introducing an extension to an API, contributors can break up
the PR into multiple commits targeting these specific changes:
#. Introduce the new APIs, including shared devicetree bindings
#. Update driver implementation X, with driver specific devicetree bindings
#. Update driver implementation Y
#. Add tests for the new API
#. Add a sample using the API
#. Update the documentation
Large Changes
*************
Large changes to the Zephyr project must submit an :ref:`RFC proposal <rfcs>`
describing the full scope of change and future work. The RFC proposal provides
the required context to reviewers, but allows for smaller, incremental, PRs to
get reviewed and merged into the project. The RFC should also define the minimum
viable implementation.
Changes which require an RFC proposal include:
- Submitting a new feature.
- Submitting a new API.
- :ref:`treewide-changes`.
- Other large changes that can benefit from the RFC proposal process.
Maintainers have the discretion to request that contributors create an RFC for
PRs that are too large or complicated.
PR Requirements
***************
- Each commit in the PR must provide a commit message following the
:ref:`commit-guidelines`.
- The PR description must include a summary of the changes and their rationales.
- All files in the PR must comply with :ref:`Licensing
Requirements<licensing_requirements>`.
- Follow the Zephyr :ref:`coding_style` and :ref:`coding_guidelines`.
- PRs must pass all CI checks. This is a requirement to merge the PR.
Contributors may mark a PR as draft and explicitly request reviewers to
provide early feedback, even with failing CI checks.
- When breaking a PR into multiple commits, each commit must build cleanly. The
CI system does not enforce this policy, so it is the PR author's
responsibility to verify.
- When major new functionality is added, tests for the new functionality shall
be added to the automated test suite. All API functions should have test cases
and there should be tests for the behavior contracts of the API. Maintainers
and reviewers have the discretion to determine if the provided tests are
sufficient. The examples below demonstrate best practices on how to test APIs
effectively.
- :zephyr_file:`Kernel timer tests <tests/kernel/timer/timer_behavior>`
provide around 85% test coverage for the
:zephyr_file:`kernel timer <kernel/timer.c>`, measured by lines of code.
- Emulators for off-chip peripherals are an effective way to test driver
APIs. The :zephyr_file:`fuel gauge tests <tests/drivers/fuel_gauge/sbs_gauge>`
use the :zephyr_file:`smart battery emulator <drivers/fuel_gauge/sbs_gauge/emul_sbs_gauge.c>`,
providing test coverage for the
:zephyr_file:`fuel gauge API <include/zephyr/drivers/fuel_gauge.h>`
and the :zephyr_file:`smart battery driver <drivers/fuel_gauge/sbs_gauge/sbs_gauge.c>`.
- Code coverage reports for the Zephyr project are available on `Codecov`_.
- Incompatible changes to APIs must also update the release notes for the
next release detailing the change. APIs marked as experimental are excluded
from this requirement.
- Changes to APIs must increment the API version number according to the API
version rules.
- PRs must also satisfy all :ref:`merge_criteria` before a member of the release
engineering team merges the PR into the zephyr tree.
Maintainers may request that contributors break up a PR into smaller PRs and may
request that they create an :ref:`RFC proposal <rfcs>`.
.. _`Codecov`: https://app.codecov.io/gh/zephyrproject-rtos/zephyr
Workflow Suggestions That Help Reviewers
========================================
- Unless they applied the reviewer's recommendation exactly, authors must not
resolve and hide comments, they must let the initial reviewer do it. The
Zephyr project does not require all comments to be resolved before merge.
Leaving some completed discussions open can sometimes be useful to understand
the greater picture.
- Respond to comments using the "Start Review" and "Add Review" green buttons in
the "Files changed" view. This allows responding to multiple comments and
publishing the responses in bulk. This reduces the number of emails sent to
reviewers.
- As GitHub does not implement |git range-diff|_, try to minimize rebases in the
middle of a review. If a rebase is required, push this as a separate update
with no other changes since the last push of the PR. When pushing a rebase
only, add a comment to the PR indicating which commit is the rebase.
.. |git range-diff| replace:: ``git range-diff``
.. _`git range-diff`: https://git-scm.com/docs/git-range-diff
PR Review Escalation
====================
The Zephyr community is a diverse group of individuals, with different levels of
commitment and priorities. As such, reviewers and maintainers may not get to a
PR right away.
The `Zephyr Dev Meeting`_ performs a triage of PRs missing reviewer approval,
following this process:
#. Identify and update PRs missing an Assignee.
#. Identify PRs without any comments or reviews, ping the PR Assignee to start a
review or assign to a different maintainer.
#. For PRs that have otherwise stalled, the Zephyr Dev Meeting pings the
Assignee and any reviewers that have left comments on the PR.
Contributors may escalate PRs outside of the Zephyr Dev Meeting triage process
as follows:
- After 1 week of inactivity, ping the Assignee or reviewers on the PR by adding
a comment to the PR.
- After 2 weeks of inactivity, post a message on the `#pr-help`_ channel on
Discord linking to the PR.
- After 2 weeks of inactivity, add the `dev-review`_ label to the PR. This
explicitly adds the PR to the agenda for the next `Zephyr Dev Meeting`_
independent of the triage process. Not all contributors have the required
privileges to add labels to PRs, in this case the contributor should request
help on Discord or send an email to the `Zephyr devel mailing list`_.
Note that for new PRs, contributors should generally wait for at least one
Zephyr Dev Meeting before escalating the PR themselves.
.. _Zephyr devel mailing list: https://lists.zephyrproject.org/g/devel
.. _pr_technical_escalation:
PR Technical Escalation
=======================
In cases where a contributor objects to change requests from reviewers, Zephyr
defines the following escalation process for resolving technical disagreements.
Before escalation of technical disagreements, follow the steps below:
- Resolve in the PR among assignee, maintainers and reviewer.
- Assignee to act as moderator if applicable.
- Optionally resolve in the next `Zephyr Dev Meeting`_ meeting with more
Maintainers and project stakeholders.
- The involved parties and the Assignee to be present when the issue is
discussed.
- If no progress is made, the assignee (maintainer) has the right to dismiss
stale, unrelated or irrelevant change requests by reviewers giving the
reviewers a minimum of 1 business day to respond and revisit their initial
change requests or start the escalation process.
The assignee has the responsibility to document the reasoning for dismissing
any reviews in the PR and should notify the reviewer about their review being
dismissed.
To give the reviewers time to respond and escalate, the assignee is
expected to block the PR from being merged either by not
approving the PR or by setting the *DNM* label.
Escalation can be triggered by any party participating in the review
process (assignee, reviewers or the original author of the change) following
the steps below:
- Escalate to the `Architecture Working Group`_ by adding the `Architecture
Review` label on the PR. Beside the weekly meeting where such escalations are
processed, the `Architecture Working Group`_ shall facilitate an offline
review of the escalation if requested, especially if any of the parties can't
attend the meeting.
- If all avenues of resolution and escalation have failed, assignees can escalate
to the TSC and get a binding resolution in the TSC by adding the *TSC* label
on the PR.
- The Assignee is expected to ensure the resolution of the escalation and the
outcome is documented in the related pull request or issues on Github.
.. _#pr-help: https://discord.com/channels/720317445772017664/997527108844798012
.. _dev-review: https://github.com/zephyrproject-rtos/zephyr/labels/dev-review
.. _Zephyr Dev Meeting: https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-dev-meeting
.. _Architecture Project: https://github.com/zephyrproject-rtos/zephyr/projects/18
.. _Architecture Working Group: https://github.com/zephyrproject-rtos/zephyr/wiki/Architecture-Working-Group
.. _reviewer-expectations:
Reviewer Expectations
*********************
- Be respectful when commenting on PRs. Refer to the Zephyr `Code of Conduct`_
for more details.
- The Zephyr Project recognizes that reviewers and maintainers have limited
bandwidth. As a reviewer, prioritize review requests in the following order:
#. PRs related to items in the `Zephyr Release Plan`_ or those targeting
the next release during the stabilization period (after RC1).
#. PRs where the reviewer has requested blocking changes.
#. PRs assigned to the reviewer as the area maintainer.
#. All other PRs.
- Reviewers shall strive to advance the PR to a mergeable state with their
feedback and engagement with the PR author.
- Try to provide feedback on the entire PR in one shot. This provides the
contributor an opportunity to address all comments in the next PR update.
- Partial reviews are permitted, but the reviewer must add a comment indicating
what portion of the PR they reviewed. Examples of useful partial reviews
include:
- Domain specific reviews (e.g. Devicetree).
- Code style changes that impact the readability of the PR.
- Reviewing commits separately when the requested changes cascade into the
later commits.
- Avoid increasing scope of the PR by requesting new features, especially when
there is a corresponding :ref:`RFC <rfcs>` associated with the PR. Instead,
reviewers should add suggestions as a comment to the :ref:`RFC <rfcs>`. This
also encourages more collaboration as it is easier for multiple contributors
to work on a feature once the minimum implementation has merged.
- When using the "Request Changes" option, mark trivial, non-functional,
requests as "Non-blocking" in the comment. Reviewers should approve PRs once
only non-blocking changes remain. The PR author has discretion as to whether
they address all non-blocking comments. PR authors should acknowledge every
review comment in some way, even if it's just with an emoticon.
- Reviewers shall be *clear* and *concise* what changes they are requesting when the
"Request Changes" option is used. Requested changes shall be in the scope of
the PR in question and following the contribution and style guidelines of the
project.
- Reviewers shall not close a PR due to technical or structural disagreement.
If requested changes cannot be resolved within the review process, the
:ref:`pr_technical_escalation` path shall be used for any potential resolution
path, which may include closing the PR.
.. _Code of Conduct: https://github.com/zephyrproject-rtos/zephyr/blob/main/CODE_OF_CONDUCT.md
.. _Zephyr Release Plan: https://github.com/orgs/zephyrproject-rtos/projects/13
Part 3
한국어 전문 번역
Contributor Expectations
Zephyr project는 contributor가 변경 사항을 더 작은 Pull Request(PR)로 제출하도록 권장합니다. 작은 PR에는 다음 장점이 있습니다.
- 더 빠르고 꼼꼼하게 review할 수 있습니다. Reviewer는 큰 PR 하나를 위해 긴 시간을 비우기보다 작은 변경을 여러 번 검토할 몇 분을 마련하기가 쉽습니다.
- Reviewer나 maintainer가 변경 방향을 거부할 때 낭비되는 작업이 줄어듭니다.
- Rebase와 merge가 쉽습니다. 작은 PR은 tree의 다른 변경과 충돌할 가능성이 낮습니다.
- PR 때문에 기능이 깨졌을 때 revert하기 쉽습니다.
이 페이지는 draft PR에는 적용하지 않습니다. Draft PR은 test와 preview 목적으로 크기, commit 수, 작은 PR의 조합에 제한이 없습니다. Review을 기대하지 않으며 처음부터 draft로 만든 PR은 기본적으로 누구에게도 알림을 보내지 않습니다.
더 작은 PR 정의
- 작은 PR은 스스로 완결된 논리적 변경 하나를 포함해야 합니다.
- 큰 새 기능이나 API를 추가할 때 PR은 기능의 한 부분만 다뤄야 합니다. 나머지 부분은 reviewer에게 설명할 RFC proposal을 만듭니다.
- 다음 조건에서는 PR에 test 또는 sample을 포함해야 합니다.
- 새 기능이나 동작을 추가할 때
- 기능을 수정할 때, 특히 API 동작 contract를 바꿀 때
- Hardware와 무관한 bug를 고칠 때. Test는 수정 전에는 실패하고 수정 적용 후에는 통과해야 합니다.
- 기능적 code 변경의 영향을 받는 모든 문서를 PR에서 갱신해야 합니다.
- 새 API를 도입하면 PR에 API 사용 예제를 포함해야 합니다. Reviewer가 맥락을 파악할 수 있고 아무도 사용하지 않는 API를 제출하는 일을 막습니다.
한 PR의 여러 commit
Contributor는 PR을 여러 commit으로 나누는 것도 권장됩니다. PR 안의 각 commit은 그 자체로 깨끗하게 build되고 모든 CI test를 통과해야 합니다.
예를 들어 API 확장을 도입하는 PR은 다음과 같이 구체적인 변경별 commit으로 나눌 수 있습니다.
- 공유 devicetree binding을 포함해 새 API를 도입합니다.
- Driver 전용 devicetree binding과 함께 driver 구현 X를 갱신합니다.
- Driver 구현 Y를 갱신합니다.
- 새 API test를 추가합니다.
- API를 사용하는 sample을 추가합니다.
- 문서를 갱신합니다.
큰 변경
Zephyr project의 큰 변경은 변경 전체 범위와 향후 작업을 설명하는 RFC proposal을 제출해야 합니다. RFC는 reviewer에게 필요한 맥락을 제공하면서도 작고 점진적인 PR을 review하고 project에 merge할 수 있게 합니다. RFC는 minimum viable implementation도 정의해야 합니다.
다음 변경에는 RFC proposal이 필요합니다.
- 새 기능 제출
- 새 API 제출
- Tree-wide changes
- RFC 절차가 도움이 되는 그 밖의 큰 변경
Maintainer는 지나치게 크거나 복잡한 PR에 대해 contributor에게 RFC 작성을 요청할 재량이 있습니다.
PR 요구 사항
- PR의 각 commit에는 commit guideline을 따르는 commit message가 있어야 합니다.
- PR description에는 변경 요약과 그 근거를 포함해야 합니다.
- PR의 모든 file은 Licensing Requirements을 준수해야 합니다.
- Zephyr coding style과 coding guidelines을 따릅니다.
- PR은 모든 CI check를 통과해야 하며 이는 merge 필수 조건입니다. CI가 실패하더라도 PR을 draft로 표시하고 reviewer에게 초기 feedback을 명시적으로 요청할 수 있습니다.
- PR을 여러 commit으로 나눌 때 각 commit은 깨끗하게 build되어야 합니다. CI system은 이 정책을 강제하지 않으므로 PR 작성자가 직접 확인해야 합니다.
- 중요한 새 기능을 추가하면 automated test suite에 test를 추가해야 합니다. 모든 API 함수에 test case가 있어야 하고 API 동작 contract도 검사해야 합니다. Test가 충분한지는 maintainer와 reviewer가 판단합니다. 다음은 API를 효과적으로 시험하는 모범 사례입니다.
tests/kernel/timer/timer_behavior의 kernel timer test는 line 기준으로kernel/timer.c의 약 85% test coverage를 제공합니다.- Off-chip peripheral emulator는 driver API를 효과적으로 시험합니다.
tests/drivers/fuel_gauge/sbs_gauge는drivers/fuel_gauge/sbs_gauge/emul_sbs_gauge.c의 smart battery emulator를 사용해include/zephyr/drivers/fuel_gauge.hfuel gauge API와drivers/fuel_gauge/sbs_gauge/sbs_gauge.csmart battery driver를 검사합니다. - Zephyr project의 code coverage report는 Codecov에서 볼 수 있습니다.
- 호환되지 않는 API 변경은 다음 release의 release note도 갱신해 변경 내용을 자세히 기록해야 합니다. Experimental로 표시된 API는 이 요구 사항에서 제외됩니다.
- API 변경은 API version rule에 따라 API version number를 올려야 합니다.
- Release engineering team 구성원이 PR을 Zephyr tree에 merge하기 전에 PR은 모든 merge criteria를 충족해야 합니다.
Maintainer는 contributor에게 PR을 더 작은 PR로 나누거나 RFC proposal을 만들도록 요청할 수 있습니다.
Reviewer에게 도움이 되는 workflow 제안
- 작성자가 reviewer의 권고를 정확히 적용한 경우가 아니라면 comment를 resolve해 숨기면 안 되며 최초 reviewer가 처리하도록 두어야 합니다. Zephyr project는 merge 전에 모든 comment를 resolve하도록 요구하지 않습니다. 완료된 discussion 일부를 열어 두면 전체 맥락을 이해하는 데 도움이 될 수 있습니다.
Files changedview의 녹색Start Review와Add Reviewbutton으로 comment에 답합니다. 여러 답변을 한꺼번에 publish할 수 있어 reviewer에게 가는 email 수를 줄입니다.- GitHub는 git range-diff를 구현하지 않으므로 review 중간의 rebase를 최소화합니다. Rebase가 필요하면 직전 PR push 이후 다른 변경 없이 별도 update로 push합니다. Rebase만 push할 때는 어느 commit이 rebase인지 PR comment로 알립니다.
PR review 상향 요청
Zephyr community는 참여 수준과 우선순위가 서로 다른 다양한 사람으로 구성되므로 reviewer와 maintainer가 PR을 즉시 처리하지 못할 수 있습니다.
Zephyr Dev Meeting은 reviewer 승인이 없는 PR을 다음 절차로 triage합니다.
- Assignee가 없는 PR을 찾아 갱신합니다.
- Comment나 review가 전혀 없는 PR을 찾아 PR Assignee에게 review 시작을 요청하거나 다른 maintainer에게 assign합니다.
- 그 밖의 이유로 멈춘 PR은 Assignee와 PR에 comment를 남긴 reviewer에게 알립니다.
Contributor는 Dev Meeting triage 절차 밖에서 다음과 같이 PR을 상향 요청할 수 있습니다.
- 1주 동안 활동이 없으면 PR에 comment를 추가해 Assignee나 reviewer를 호출합니다.
- 2주 동안 활동이 없으면 Discord #pr-help channel에 PR link와 함께 message를 올립니다.
- 2주 동안 활동이 없으면 PR에 dev-review label을 붙입니다. Triage와 무관하게 다음 Zephyr Dev Meeting agenda에 PR을 명시적으로 추가합니다. Label 권한이 없다면 Discord에서 도움을 요청하거나 Zephyr devel mailing list로 email을 보냅니다.
새 PR은 contributor가 직접 상향 요청하기 전에 일반적으로 Zephyr Dev Meeting을 적어도 한 번 기다려야 합니다.
PR 기술 이견 상향 절차
Contributor가 reviewer의 변경 요청에 이의를 제기할 때 Zephyr는 기술적 의견 차이를 해결하기 위한 다음 절차를 정의합니다.
기술 이견을 상향하기 전에 다음 단계를 따릅니다.
- Assignee, maintainer, reviewer가 PR 안에서 해결합니다.
- 필요한 경우 Assignee가 조정자 역할을 합니다.
- 선택적으로 다음 Zephyr Dev Meeting에서 더 많은 maintainer와 project stakeholder가 함께 해결합니다.
- 문제를 논의할 때 관련 당사자와 Assignee가 참석해야 합니다.
- 진전이 없으면 assignee(maintainer)는 오래됐거나 무관하거나 관련 없는 reviewer 변경 요청을 dismiss할 수 있습니다. Reviewer가 최초 요청을 다시 검토하거나 상향 절차를 시작하도록 최소 1영업일을 줘야 합니다. Assignee는 dismiss 근거를 PR에 문서화하고 reviewer에게 알려야 합니다. 응답과 상향 시간을 보장하기 위해 PR을 승인하지 않거나 DNM label을 설정해 merge를 막아야 합니다.
Assignee, reviewer, 원 변경 작성자 등 review 절차의 모든 참여자가 다음 단계로 상향 요청을 시작할 수 있습니다.
- Architecture Working Group에 상향하려면 PR에
Architecture Reviewlabel을 붙입니다. 정기 meeting 외에도 요청이 있으면, 특히 당사자가 meeting에 참석하지 못할 때 Working Group이 offline review를 지원해야 합니다. - 모든 해결·상향 경로가 실패하면 assignee는 PR에
TSClabel을 붙여 TSC의 구속력 있는 결정을 요청할 수 있습니다. - Assignee는 상향 절차가 해결되도록 확인하고 결과를 관련 Pull Request나 GitHub issue에 문서화해야 합니다.
원문에는 과거 Architecture project board도 참조되어 있습니다: Architecture Project.
Reviewer Expectations
- PR에 comment할 때 존중하는 태도를 유지합니다. 자세한 내용은 Zephyr Code of Conduct를 따릅니다.
- Zephyr Project는 reviewer와 maintainer가 쓸 수 있는 시간이 제한적임을 인정합니다. Review 요청은 다음 순서로 우선 처리합니다.
- Zephyr Release Plan 항목과 관련된 PR, 또는 안정화 기간(RC1 이후)에 다음 release를 목표로 하는 PR
- Reviewer가 merge를 막는 변경을 요청한 PR
- 영역 maintainer 자격으로 reviewer에게 assign된 PR
- 그 밖의 모든 PR
- Reviewer는 feedback과 PR 작성자와의 협력을 통해 PR이 merge 가능한 상태로 나아가도록 노력해야 합니다.
- 가능하면 전체 PR에 대한 feedback을 한 번에 제공합니다. Contributor가 다음 PR update에서 모든 comment를 처리할 기회를 줍니다.
- 부분 review도 허용되지만 reviewer는 어느 부분을 검토했는지 comment로 밝혀야 합니다. 유용한 부분 review의 예는 다음과 같습니다.
- Devicetree 같은 domain 전용 review
- PR 가독성에 영향을 주는 code style 변경 review
- 요청 변경이 뒤 commit에 연쇄 영향을 줄 때 commit별 review
- 새 기능을 요구해 PR 범위를 늘리지 않습니다. 특히 관련 RFC가 있으면 제안을 PR이 아니라 RFC comment로 추가합니다. Minimum implementation이 merge된 뒤 여러 contributor가 기능을 함께 개발하기도 쉬워집니다.
Request Changes를 사용할 때 사소하고 기능과 무관한 요청은 comment에서Non-blocking으로 표시합니다. Non-blocking 변경만 남으면 reviewer는 PR을 승인해야 합니다. 처리 여부는 PR 작성자가 결정하지만 emoticon만 사용하더라도 모든 review comment에 반응해야 합니다.Request Changes를 사용할 때 어떤 변경을 요청하는지 명확하고 간결하게 써야 합니다. 요청은 해당 PR 범위 안에 있고 project의 contribution·style guideline을 따라야 합니다.- Reviewer는 기술적 또는 구조적 의견 차이만으로 PR을 닫으면 안 됩니다. Review 과정에서 해결할 수 없다면 가능한 해결 또는 PR 종료 결정을 위해 PR 기술 이견 상향 절차를 사용해야 합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.