Skip to content

Commit 86aa0c3

Browse files
authored
feat: add code owners documentation (#546)
Signed-off-by: M. Fatih Cırıt <mfc@leodrive.ai>
1 parent ab35100 commit 86aa0c3

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
nav:
22
- index.md
33
- ci-checks.md
4+
- code-owners.md
45
- commit-guidelines.md
56
- review-guidelines.md
67
- review-tips.md
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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.

docs/contributing/pull-request-guidelines/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Use this workflow as a reference when you contribute to Autoware.
2828
- The reviewers will review your code following the [review guidelines](review-guidelines.md).
2929
- Not only the reviewers, but also the author is encouraged to understand the review guidelines.
3030
- If [CI checks](ci-checks.md) have failed, fix the errors.
31+
- Learn about code ownership from the [code owners](code-owners.md) guidelines.
32+
- Check the [code owners FAQ section](code-owners.md#faq) if your pull request is not being reviewed.
3133
7. Address the review comments pointed out by the reviewers.
3234
- If you don't understand the meaning of a review comment, ask the reviewers until you understand it.
3335
- Fixing without understanding the reason is not recommended because the author should be responsible for the final content of their own pull request.

0 commit comments

Comments
 (0)