Skip to content

Commit c45d3c8

Browse files
MAINTAINERS: define the inactive CODEOWNERS policy
The policy defines inactivity (1 year without review activity), outlines the removal process with notification periods, and provides templates for issue notifications and removal PRs. Also document the `check_inactive_codeowners.py` script usage for identifying inactive members. See #187 for more details. Signed-off-by: Stefano Garzarella <[email protected]>
1 parent 5e21370 commit c45d3c8

File tree

1 file changed

+147
-0
lines changed

1 file changed

+147
-0
lines changed

MAINTAINERS.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,153 @@ that are published to crates.io the release process includes publishing a new
5959
version. Ask one of the maintainers to give you permissions for the crate
6060
on crates.io.
6161

62+
## Inactive CODEOWNERS Policy
63+
64+
To maintain an accurate view of repository health and ensure an efficient PR
65+
review process, we have implemented a policy for managing inactive CODEOWNERS
66+
(see [issue #187](https://github.com/rust-vmm/community/issues/187) for
67+
details).
68+
69+
### Inactivity Definition
70+
71+
A CODEOWNER is considered inactive after **1 year** without any review activity
72+
(comments, approvals, etc.) in a repository.
73+
74+
### Removal Process
75+
76+
1. Regular checks (e.g. monthly) will identify CODEOWNERS who haven't been
77+
active in a year
78+
2. An issue will be opened in the community repository tagging all inactive
79+
CODEOWNERS
80+
3. After a 1-month notification period, inactive members will be gracefully
81+
removed from the `CODEOWNERS` file
82+
4. The required number of approvals per PR should be adjusted to align with
83+
the current number of active maintainers
84+
85+
### Re-adding Removed CODEOWNERS
86+
87+
Being removed from CODEOWNERS doesn't mean someone isn't wanted as a maintainer
88+
anymore. It's simply to keep track of how many active maintainers we have and
89+
monitor project health. Anyone removed can easily be re-added as a maintainer
90+
whenever they wish to become active again by:
91+
- Pinging the current maintainers, or
92+
- Opening a PR against the `CODEOWNERS` file to re-add themselves
93+
94+
**Note:** The gatekeeper inactivity policy has been deferred until the monorepo
95+
migration is complete, at which point gatekeepers will be "codeowners for the
96+
repo root" and can be handled by this policy automatically.
97+
98+
### Checking for Inactive CODEOWNERS
99+
100+
The `scripts/check_inactive_codeowners.py` script can help with the process of
101+
identifying inactive CODEOWNERS by checking their activity (commits, reviews,
102+
PR/issue comments) in a repository.
103+
104+
**Requirements:**
105+
- Python 3 with `requests` library
106+
- GitHub personal access token (optional but recommended, set as `GITHUB_TOKEN` environment variable)
107+
108+
**Basic usage:**
109+
```bash
110+
export GITHUB_TOKEN=your_token_here
111+
python scripts/check_inactive_codeowners.py --repo vhost
112+
```
113+
114+
**Common options:**
115+
- `--fast`: Use faster but less accurate comment detection
116+
- `--verbose` or `-v`: Show detailed API queries for debugging
117+
118+
The script will:
119+
1. Fetch the CODEOWNERS file from the repository
120+
2. Extract individual GitHub usernames (team references are not supported)
121+
3. Check each user's activity over the last year (commits, reviews, PR/issue comments)
122+
4. Report inactive users and provide a summary
123+
124+
**Exit codes:**
125+
- `0`: All CODEOWNERS are active
126+
- `1`: There are inactive CODEOWNERS
127+
- `2`: Errors occurred while querying GitHub
128+
129+
**Notes:**
130+
- By default, the script verifies actual comment timestamps for accuracy, which uses
131+
more API calls. Use `--fast` for quicker checks with slightly less precision.
132+
- Without a GitHub token, the script will work but slower due to lower
133+
[rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api)
134+
(60 requests/hour vs 5000 requests/hour with authentication).
135+
- You can generate a token at https://github.com/settings/tokens
136+
137+
### Notification Issue Template
138+
139+
When inactive CODEOWNERS are identified, an issue should be created in the
140+
community repository using this template:
141+
142+
```markdown
143+
Title: Inactive CODEOWNERS Notification - [Month Year]
144+
145+
# Inactive CODEOWNERS Notification
146+
147+
During our regular audit, we identified CODEOWNERS who haven't had any review
148+
activity (comments, approvals, etc.) in their respective repositories for over
149+
1 year.
150+
151+
The following users are affected:
152+
153+
@username1 @username2 @username3 ...
154+
155+
## Next Steps
156+
157+
According to our [Inactive CODEOWNERS Policy](https://github.com/rust-vmm/community/blob/main/MAINTAINERS.md#inactive-codeowners-policy):
158+
159+
1. We will wait **1 month** from the date of this issue before proceeding with
160+
any removals
161+
2. If you are still interested in maintaining your repository, please comment on
162+
this issue or resume review activity
163+
3. If you are no longer able to maintain the repository, no action is needed -
164+
we will proceed with the removal after the notification period
165+
4. You can be re-added as a CODEOWNER at any time in the future by pinging
166+
current maintainers or opening a PR
167+
168+
Being removed from CODEOWNERS doesn't mean you aren't wanted as a maintainer.
169+
It's simply to help us track active maintainers and adjust approval rules
170+
accordingly.
171+
172+
If you have any questions or concerns, please comment below.
173+
174+
**Removal Date:** [Date 1 month from issue creation]
175+
```
176+
177+
### Removal PR Template
178+
179+
After the notification period expires, a PR should be created to remove
180+
inactive CODEOWNERS using this template:
181+
182+
```markdown
183+
Title: Remove inactive CODEOWNERS - [Month Year]
184+
185+
# Remove Inactive CODEOWNERS
186+
187+
This PR removes CODEOWNERS who have been inactive for over 1 year and were
188+
notified in https://github.com/rust-vmm/community/issues/[issue-number].
189+
190+
## Changes
191+
192+
- Removed inactive CODEOWNERS: @username1 @username2 @username3 ...
193+
- Adjusted PR approval requirements where needed to match the new number of
194+
active maintainers
195+
196+
## Notification
197+
198+
All affected CODEOWNERS were notified on [date] via https://github.com/rust-vmm/community/issues/[issue-number]
199+
and given a 1-month period to respond.
200+
201+
## Policy Reference
202+
203+
This removal follows our [Inactive CODEOWNERS Policy](https://github.com/rust-vmm/community/blob/main/MAINTAINERS.md#inactive-codeowners-policy).
204+
205+
Removed maintainers can be re-added at any time by opening a PR or pinging
206+
current maintainers.
207+
```
208+
62209
## The Gatekeeper Role
63210

64211
The wider organization is managed by a team

0 commit comments

Comments
 (0)