-
Notifications
You must be signed in to change notification settings - Fork 1.3k
3di | Making and reviewing a pull request #6892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
keithkirkwood-3di
wants to merge
17
commits into
ros2:rolling
Choose a base branch
from
keithkirkwood-3di:making-reviewing-a-pr
base: rolling
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a79b1e7
OPENR-99: Refactor and create new articles for making and reviewing a PR
keithkirkwood-3di 268cd5f
Merge branch 'ros2:rolling' into making-reviewing-a-pr
keithkirkwood-3di 09fa6f4
Merge branch 'rolling' into making-reviewing-a-pr
kscottz fa246ac
Update source/The-ROS2-Project/Contributing/Contributing-to-code/Maki…
keithkirkwood-3di 800ca08
OPENR-100: Updates from review in PR
keithkirkwood-3di 1aa1138
OPENR-99: Fix linter error of trailing whitespace
keithkirkwood-3di 2ddb485
Update source/The-ROS2-Project/Contributing/Contributing-to-code/Revi…
keithkirkwood-3di ecceb00
Update source/The-ROS2-Project/Contributing/Contributing-to-code/Revi…
keithkirkwood-3di 175a7be
OPENR-100: More review updates to articles from community contributors
keithkirkwood-3di 6c4fb49
Merge branch 'making-reviewing-a-pr' of https://github.com/keithkirkw…
keithkirkwood-3di f980568
Merge branch 'rolling' into making-reviewing-a-pr
kscottz f3435bc
OPENR-100: Add information about types of comments
keithkirkwood-3di 6f0776f
Merge branch 'making-reviewing-a-pr' of https://github.com/keithkirkw…
keithkirkwood-3di 1eb793b
Merge branch 'ros2:rolling' into making-reviewing-a-pr
keithkirkwood-3di 4ab8010
OPENR-100: Updates to Reviewing a PR for clarity/brevity
keithkirkwood-3di 4af098e
OPENR-100: Updates to xrefs and related content
keithkirkwood-3di 76cfaff
OPENR-100: Fix linter error at end of file
keithkirkwood-3di File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
source/The-ROS2-Project/Contributing/Contributing-to-code.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| Contributing to code | ||
| ==================== | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 1 | ||
|
|
||
| Contributing-to-code/Making-a-PR | ||
| Contributing-to-code/Reviewing-a-PR |
103 changes: 103 additions & 0 deletions
103
source/The-ROS2-Project/Contributing/Contributing-to-code/Making-a-PR.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| Making a pull request (PR) — how-to | ||
| =================================== | ||
|
|
||
| Pull requests are used to contribute code and documentation changes to ROS projects. | ||
| This article explains how to prepare and create a pull request from your fork of a ROS repository. | ||
| With this information, you'll be able to submit focused changes in a pull request, ready for review. | ||
|
|
||
| **Area: community | Content-type: how-to | Experience: beginner, intermediate, expert** | ||
|
|
||
| .. contents:: Table of Contents | ||
| :depth: 2 | ||
| :local: | ||
|
|
||
| Summary | ||
| ------- | ||
|
|
||
| Pull requests (PRs) are proposals to merge your changes into a ROS project. | ||
| Making a pull request allows you to collaborate with other ROS contributors, providing a space to discuss and review your code changes before a ROS maintainer merges them. | ||
| Pull requests are welcome for any of `the ROS repositories <https://github.com/ros2>`__. | ||
|
|
||
| For more information about contribution etiquette, see :doc:`Contributing <../../Contributing>`. | ||
|
|
||
| Prerequisites | ||
| ------------- | ||
|
|
||
| #. `Create a fork <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo>`__ of the target ROS repository for your code changes. | ||
| #. Complete your code changes on a development branch, in your fork of the `target ROS repository <https://github.com/ros2>`__. | ||
|
keithkirkwood-3di marked this conversation as resolved.
Outdated
|
||
| #. Make sure your changes comply with ROS guidelines. | ||
|
|
||
| * If your pull request is for a code change: | ||
|
|
||
| * Make sure you've followed the guidance in the :doc:`Developer guide <../Developer-Guide>`. | ||
|
keithkirkwood-3di marked this conversation as resolved.
|
||
| * Check that your code complies with the relevant section of the :doc:`Code style guide </The-ROS2-Project/Contributing/Code-Style-Language-Versions>`. | ||
| * Make sure you've :ref:`run the tests <colcon-run-the-tests>` and the appropriate linter for your code changes. | ||
|
|
||
| * If your pull request is for a documentation change: | ||
|
|
||
| * Make sure you've followed the guidance in :doc:`../Contributing-To-ROS-2-Documentation`. | ||
|
|
||
| Steps | ||
| ----- | ||
|
|
||
| 1 Preparing the pull request | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| Use the following guidelines to prepare your pull request: | ||
|
|
||
| * **Scope and focus** | ||
| * Limit each pull request to a single, well defined change. | ||
| * Submit unrelated changes as separate pull requests. | ||
| * Keep patches small and avoid unnecessary or incidental changes. | ||
| * **Commit history and squashing** | ||
| * Squash changes into a minimum number of clear, semantic commits to preserve a readable project history. | ||
| * Don't squash commits while a pull request is under review, as reviewers may not notice changes which can lead to confusion. | ||
| * You can create new commits while a pull request is under review. | ||
| * **Draft pull requests** | ||
| * Use draft pull requests to request early feedback while work is in progress. | ||
| * Don't expect draft pull requests to be formally reviewed or merged until you have marked them as ready. | ||
| * If you want early feedback from a specific person on a draft pull request, mention them (using @) in the pull request description or in a comment. | ||
| * **Mentions and references** | ||
| * If your changes are based on a design document, mention the package owners who reviewed the design in the pull request description. | ||
| * If your pull request depends on another pull request, clearly reference the dependency in the pull request description. | ||
| * If your changes are planned to be released with a specific version of ROS, include that version of ROS in the pull request description. | ||
| * **Documenting your code changes** | ||
| * If your pull request is for code changes, ensure you propose any required documentation updates (including API documentation, feature documentation, and release notes) in another pull request. | ||
|
keithkirkwood-3di marked this conversation as resolved.
Outdated
|
||
|
|
||
| 2 Submitting the pull request | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
keithkirkwood-3di marked this conversation as resolved.
|
||
|
|
||
| #. Create a pull request from the branch containing your changes in your fork, to the **rolling** branch of the target ROS repository. | ||
| You can create your pull request using the GitHub CLI, GitHub Desktop, or using other methods. | ||
|
|
||
| For more information about creating a pull request from a fork, see `the GitHub documentation <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork>`__. | ||
|
|
||
| For more information about each of the available pull request methods, see `the GitHub documentation <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request>`__. | ||
|
|
||
| #. Populate the pull request by completing the sections shown in the description template, including: | ||
|
|
||
| * **Description**: summarize your code changes and the related GitHub issue, highlighting any key points or areas of concern. | ||
| * **Issue**: include the ID of the GitHub issue fixed by your changes, in the format ``Fixes #(issue)``. | ||
| This ensures that this issue is automatically closed when the pull request is merged. | ||
| * **Generative AI**: if this pull request was generated using Generative AI, specify the model and version (for example, GitHub Copilot v3.2). | ||
| * **Additional information**: provide any context or details you think will be useful for understanding your changes. | ||
|
|
||
| After you've submitted your pull request, other developers and contributors in the ROS community will :doc:`review your changes <Reviewing-a-PR>`, including checking against the relevant guidelines. | ||
|
|
||
| 3 Responding to review comments | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| When another developer or contributor adds a review comment or suggestion to your pull request, you receive a notification from GitHub. | ||
|
|
||
| You can view and discuss `review comments directly in GitHub <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/viewing-a-pull-request-review>`__, and add further commits to your branch to address them when needed. | ||
| You can also directly `accept any suggested changes <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request>`__ in the pull request, which adds a new commit to your branch automatically. | ||
|
|
||
| Discuss and iterate on your changes with this feedback, amending and updating your development branch with new commits as needed. | ||
| Aim to reply back to review comments within one week, so that you and the reviewers do not lose the context of your changes. | ||
|
|
||
| 4 Merging the pull request | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| After you've actioned any feedback, your pull request must be approved by a core maintainer for the target ROS repository before it can be merged. | ||
|
|
||
| When the core maintainer approves your pull request, they merge it to the target branch, and you receive a notification from GitHub. | ||
77 changes: 77 additions & 0 deletions
77
source/The-ROS2-Project/Contributing/Contributing-to-code/Reviewing-a-PR.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| Reviewing a pull request (PR) — how-to | ||
| ====================================== | ||
|
|
||
| All incoming code and documentation to ROS projects must be reviewed in a pull request. | ||
|
keithkirkwood-3di marked this conversation as resolved.
|
||
| This article explains how to prepare for and review a pull request submitted by a contributor. | ||
| After reading this article, you'll be able to ensure changes in a pull request meet the required standards. | ||
|
|
||
| **Area: community | Content-type: how-to | Experience: beginner, intermediate, expert** | ||
|
|
||
| .. contents:: Table of Contents | ||
| :depth: 2 | ||
| :local: | ||
|
|
||
| Summary | ||
| ------- | ||
|
|
||
| Reviewing a pull request (PR) from a contributor allows you to check that their changes meet the appropriate guidelines and standards. | ||
| Any developer is welcome to review and approve a pull request after review, when the changes are ready to merge. | ||
|
keithkirkwood-3di marked this conversation as resolved.
Outdated
|
||
| Only a ROS core maintainer for the target repository can merge a pull request into that repository. | ||
|
|
||
| Prerequisites | ||
| ------------- | ||
|
|
||
| A code or documentation contributor has made a pull request to merge their changes into one of `the ROS repositories <https://github.com/ros2>`__. | ||
|
|
||
| Steps | ||
| ----- | ||
|
|
||
| 1 Preparing for review | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| * :ref:`Any developer <general-principles>` is welcome to review a pull request. | ||
|
|
||
| A pull request generally requires two reviews before it can be merged. | ||
|
|
||
| * Treat reviewing a pull request as a collaborative activity involving the submitter and other developers, rather than a passive or one-way process. | ||
| * As a reviewer: | ||
|
|
||
| * You can make small improvements to code or documentation in-place, such as fixing typos or addressing minor style issues. | ||
| * You should make a best effort attempt to comment on the pull request within one week of submission. | ||
|
christophebedard marked this conversation as resolved.
|
||
|
|
||
| * When you begin `reviewing a pull request <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews>`__, leave a comment to let others know it is under review. | ||
|
|
||
| 2 Reviewing the pull request | ||
|
keithkirkwood-3di marked this conversation as resolved.
|
||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| Use the following guidelines to review the submitted pull request: | ||
|
|
||
| * Confirm the code or documentation changes are appropriate for the repository. | ||
| * Verify the code is correct and complete, and scoped to a single, well defined change. | ||
| * Check that the pull request targets the default branch (usually ``rolling``). | ||
| * If the changes are based on a design document, verify that the changes are consistent with the design. | ||
| * For code changes, ensure that the changes: | ||
|
|
||
| * Follow the :doc:`Developer guide <../Developer-Guide>`. | ||
| * Follow the :doc:`Code style guide <../Code-Style-Language-Versions>`. | ||
| * Include tests for the new feature or bug fix. | ||
|
|
||
| * For documentation changes, ensure the changes follow the :doc:`documentation guidance <../Contributing-To-ROS-2-Documentation>`. | ||
| * Confirm that the Continuous Integration (CI) run for the pull request passes cleanly. | ||
|
|
||
| You can comment on the pull request for the submitter (`see the GitHub documentation for guidance <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request>`__), or suggest changes directly in the pull request. | ||
|
keithkirkwood-3di marked this conversation as resolved.
Outdated
|
||
|
|
||
| 3 Approving and merging the pull request | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| After you have reviewed the pull request and provided feedback, the submitter may continue the discussion or iterate on their changes, adding new commits to the PR. | ||
|
|
||
| When you are satisfied with the changes and they are ready to be merged, approve the pull request (`see the GitHub documentation for guidance <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/approving-a-pull-request-with-required-reviews>`__). | ||
|
|
||
| * :ref:`Any developer <general-principles>` is welcome to approve a pull request when the changes are ready to be merged. | ||
|
keithkirkwood-3di marked this conversation as resolved.
Outdated
|
||
| * A pull request must have at least one approval from a developer (other than the author) before it can be merged to the target branch. | ||
| * Only a ROS core maintainer for the target repository can merge an approved pull request. | ||
|
|
||
| * See the :doc:`current ROS PMC constituents and committers </The-ROS2-Project/Governance>` for the list of people with merge permissions for the target repository. | ||
|
|
||
| * If the pull request has any dependencies, ensure that dependent pull requests are merged in the correct order. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.