|
| 1 | +# Code owners |
| 2 | + |
| 3 | +The Autoware project uses multiple `CODEOWNERS` files to specify owners throughout the repository. For a detailed understanding of code owners, visit the [GitHub documentation on code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners). |
| 4 | + |
| 5 | +## Purpose and function of the `CODEOWNERS` file |
| 6 | + |
| 7 | +The `CODEOWNERS` file plays a vital role in managing pull requests (PRs) by: |
| 8 | + |
| 9 | +- **Automating Review Requests**: Automatically assigns PRs to responsible individuals or teams. |
| 10 | +- **Enforcing Merge Approval**: Prevents PR merging without approvals from designated code owners or repository maintainers, ensuring thorough review. |
| 11 | +- **Maintaining Quality Control**: Helps sustain code quality and consistency by requiring review from knowledgeable individuals or teams. |
| 12 | + |
| 13 | +## Locating `CODEOWNERS` files |
| 14 | + |
| 15 | +`CODEOWNERS` files are found in the `.github` directory across multiple repositories of the Autoware project. The [`autoware.repos` file](https://github.com/autowarefoundation/autoware/blob/main/autoware.repos) lists these repositories and their directories. |
| 16 | + |
| 17 | +## Maintenance of `CODEOWNERS` |
| 18 | + |
| 19 | +Generally, repository maintainers handle the updates to `CODEOWNERS` files. To propose changes, submit a PR to modify the file. |
| 20 | + |
| 21 | +### Special case for the Autoware Universe repository |
| 22 | + |
| 23 | +In the [autoware.universe](https://github.com/autowarefoundation/autoware.universe) repository, maintenance of the `CODEOWNERS` file is automated by the CI. |
| 24 | + |
| 25 | +[This workflow](https://github.com/autowarefoundation/autoware.universe/actions/workflows/update-codeowners-from-packages.yaml) updates the `CODEOWNERS` file based on the `maintainer` information in the `package.xml` files of the packages in the repository. |
| 26 | + |
| 27 | +In order to change the code owners for a package in the `autoware.universe` repository: |
| 28 | + |
| 29 | +1. Modify the `maintainer` information in the `package.xml` file via a PR. |
| 30 | +2. Once merged, the CI workflow runs at midnight UTC (or can be triggered manually by a maintainer) to update the `CODEOWNERS` file and create a PR. |
| 31 | +3. A maintainer then needs to merge the CI-generated PR to finalize the update. |
| 32 | + - **Example Automated PR:** [chore: update CODEOWNERS #6866](https://github.com/autowarefoundation/autoware.universe/pull/6866) |
| 33 | + |
| 34 | +## Responsibilities of code owners |
| 35 | + |
| 36 | +Code owners should review assigned PRs promptly. |
| 37 | +If a PR remains unreviewed for **over a week**, maintainers may intervene to review and possibly merge it. |
| 38 | + |
| 39 | +## FAQ |
| 40 | + |
| 41 | +### Unreviewed pull requests |
| 42 | + |
| 43 | +If your PR hasn't been reviewed: |
| 44 | + |
| 45 | +- 🏹 **Directly Address Code Owners**: Comment on the PR to alert the owners. |
| 46 | +- ⏳ **Follow Up After a Week**: If unreviewed after a week, add a comment under the PR and tag the `@autoware-maintainers`. |
| 47 | +- 📢 **Escalate if Necessary**: If your requests continue to go unanswered, you may escalate the issue by posting a message in the [Autoware Discord channel](../../support/support-guidelines.md#discord) 🚨. Remember, maintainers often juggle numerous responsibilities, so patience is appreciated🙇. |
| 48 | + |
| 49 | +### PR author is the only code owner |
| 50 | + |
| 51 | +If you, as the only code owner, authored a PR: |
| 52 | + |
| 53 | +- Request a review by tagging `@autoware-maintainers`. |
| 54 | +- The maintainers will consider appointing additional maintainers to avoid such conflicts. |
| 55 | + |
| 56 | +### Non-code owners reviewing PRs |
| 57 | + |
| 58 | +Anyone can review a PR: |
| 59 | + |
| 60 | +- You can review any pull request and provide your feedback. |
| 61 | +- Your review might not be enough to merge the pull request, but it will help the code owners and maintainers to make a decision. |
| 62 | +- If you think the pull request is ready to merge, you can mention the code owners and maintainers in a comment on the pull request. |
0 commit comments