Skip to content

Commit b0c7da8

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 <sgarzare@redhat.com>
1 parent 72dab8f commit b0c7da8

File tree

1 file changed

+155
-0
lines changed

1 file changed

+155
-0
lines changed

MAINTAINERS.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,161 @@ 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 [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci/) repository contains
101+
the `codeowners/check_inactive_codeowners.py` script. It can help with the
102+
process of identifying inactive CODEOWNERS by checking their activity
103+
(PR reviews, PR/issue comments, and optionally commits) in one or more repositories.
104+
105+
**Requirements:**
106+
- Python 3 with dependencies from `codeowners/requirements.txt` (install with `pip install -r codeowners/requirements.txt`)
107+
- GitHub personal access token (optional but recommended, set as `GITHUB_TOKEN` environment variable)
108+
109+
**Basic usage:**
110+
```bash
111+
export GITHUB_TOKEN=your_token_here
112+
python codeowners/check_inactive_codeowners.py
113+
```
114+
115+
**Common options:**
116+
- `--repos`: Comma-separated repository name(s) to check (if not specified, checks all repos in the organization)
117+
- `--org`: GitHub organization (default: rust-vmm)
118+
- `--days`: Number of days to check for activity (default: 365)
119+
- `--until`: End date for activity check in YYYY-MM-DD format (default: today)
120+
- `--verbose` or `-v`: Enable detailed debug output including API queries and individual activity found
121+
- `--include-commits`: Include commit count in activity check (default: only reviews and comments)
122+
123+
The script will:
124+
1. Fetch all repositories from the organization (if `--repos` is not specified)
125+
2. Skip archived repositories
126+
3. Fetch the CODEOWNERS file from each repository (trying common locations)
127+
4. Skip repositories with no CODEOWNERS file or empty CODEOWNERS
128+
5. Extract individual GitHub usernames (team references are not supported)
129+
6. Check if users exist on GitHub
130+
7. Check each user's activity over the specified period (PR reviews, PR/issue comments, and optionally commits)
131+
8. Report inactive and non-existent users with a summary
132+
133+
**Exit codes:**
134+
- `0`: All CODEOWNERS are active
135+
- `1`: There are inactive CODEOWNERS
136+
- `2`: Errors occurred while querying GitHub
137+
138+
**Notes:**
139+
- The script uses PyGithub to efficiently batch GitHub API queries for checking activity.
140+
- Without a GitHub token, the script will work but slower due to lower
141+
[rate limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api)
142+
(60 requests/hour vs 5000 requests/hour with authentication).
143+
- You can generate a token at https://github.com/settings/tokens
144+
145+
### Notification Issue Template
146+
147+
When inactive CODEOWNERS are identified, an issue should be created in the
148+
community repository using this template:
149+
150+
```markdown
151+
Title: Inactive CODEOWNERS Notification - [Month Year]
152+
153+
# Inactive CODEOWNERS Notification
154+
155+
During our regular audit, we identified CODEOWNERS who haven't had any review
156+
activity (comments, approvals, etc.) in their respective repositories for over
157+
1 year.
158+
159+
The following users are affected:
160+
161+
@username1 @username2 @username3 ...
162+
163+
## Next Steps
164+
165+
According to our [Inactive CODEOWNERS Policy](https://github.com/rust-vmm/community/blob/main/MAINTAINERS.md#inactive-codeowners-policy):
166+
167+
1. We will wait **1 month** from the date of this issue before proceeding with
168+
any removals
169+
2. If you are still interested in maintaining your repository, please comment on
170+
this issue or resume review activity
171+
3. If you are no longer able to maintain the repository, no action is needed -
172+
we will proceed with the removal after the notification period
173+
4. You can be re-added as a CODEOWNER at any time in the future by pinging
174+
current maintainers or opening a PR
175+
176+
Being removed from CODEOWNERS doesn't mean you aren't wanted as a maintainer.
177+
It's simply to help us track active maintainers and adjust approval rules
178+
accordingly.
179+
180+
If you have any questions or concerns, please comment below.
181+
182+
**Removal Date:** [Date 1 month from issue creation]
183+
```
184+
185+
### Removal PR Template
186+
187+
After the notification period expires, a PR should be created to remove
188+
inactive CODEOWNERS using this template:
189+
190+
```markdown
191+
Title: Remove inactive CODEOWNERS - [Month Year]
192+
193+
# Remove Inactive CODEOWNERS
194+
195+
This PR removes CODEOWNERS who have been inactive for over 1 year and were
196+
notified in https://github.com/rust-vmm/community/issues/[issue-number].
197+
198+
## Changes
199+
200+
- Removed inactive CODEOWNERS: @username1 @username2 @username3 ...
201+
- Adjusted PR approval requirements where needed to match the new number of
202+
active maintainers
203+
204+
## Notification
205+
206+
All affected CODEOWNERS were notified on [date] via https://github.com/rust-vmm/community/issues/[issue-number]
207+
and given a 1-month period to respond.
208+
209+
## Policy Reference
210+
211+
This removal follows our [Inactive CODEOWNERS Policy](https://github.com/rust-vmm/community/blob/main/MAINTAINERS.md#inactive-codeowners-policy).
212+
213+
Removed maintainers can be re-added at any time by opening a PR or pinging
214+
current maintainers.
215+
```
216+
62217
## The Gatekeeper Role
63218

64219
The wider organization is managed by a team

0 commit comments

Comments
 (0)