Skip to content
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

meta: move to emeritus automatically after 18 months #41155

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/find-inactive-collaborators.yml
Expand Up @@ -9,7 +9,6 @@ on:

env:
NODE_VERSION: lts/*
NUM_COMMITS: 5000

jobs:
find:
Expand All @@ -19,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: ${{ env.NUM_COMMITS }}
fetch-depth: 0
persist-credentials: false

- name: Use Node.js ${{ env.NODE_VERSION }}
Expand All @@ -28,7 +27,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}

- name: Find inactive collaborators
run: tools/find-inactive-collaborators.mjs ${{ env.NUM_COMMITS }}
run: tools/find-inactive-collaborators.mjs

- name: Open pull request
uses: gr2m/create-or-update-pull-request-action@v1
Expand Down
4 changes: 4 additions & 0 deletions GOVERNANCE.md
Expand Up @@ -67,6 +67,10 @@ See:
The TSC can remove inactive collaborators or provide them with _emeritus_
status. Emeriti may request that the TSC restore them to active status.

A collaborator is automatically made emeritus (and removed from active
collaborator status) if it has been more than 18 months since the collaborator
has authored or approved a commit that has landed.

## Technical Steering Committee

A subset of the collaborators forms the Technical Steering Committee (TSC).
Expand Down
16 changes: 4 additions & 12 deletions tools/find-inactive-collaborators.mjs
Expand Up @@ -8,7 +8,7 @@ import cp from 'node:child_process';
import fs from 'node:fs';
import readline from 'node:readline';

const SINCE = +process.argv[2] || 5000;
const SINCE = process.argv[2] || '18 months ago';

async function runGitCommand(cmd, mapFn) {
const childProcess = cp.spawn('/bin/sh', ['-c', cmd], {
Expand Down Expand Up @@ -42,19 +42,13 @@ async function runGitCommand(cmd, mapFn) {

// Get all commit authors during the time period.
const authors = await runGitCommand(
`git shortlog -n -s --email --max-count="${SINCE}" HEAD`,
(line) => line.trim().split('\t', 2)[1]
);

// Get all commit landers during the time period.
const landers = await runGitCommand(
`git shortlog -n -s -c --email --max-count="${SINCE}" HEAD`,
`git shortlog -n -s --email --since="${SINCE}" HEAD`,
(line) => line.trim().split('\t', 2)[1]
);

// Get all approving reviewers of landed commits during the time period.
const approvingReviewers = await runGitCommand(
`git log --max-count="${SINCE}" | egrep "^ Reviewed-By: "`,
`git log --since="${SINCE}" | egrep "^ Reviewed-By: "`,
(line) => /^ Reviewed-By: ([^<]+)/.exec(line)[1].trim()
);

Expand Down Expand Up @@ -182,15 +176,13 @@ async function moveCollaboratorToEmeritus(peopleToMove) {
// Get list of current collaborators from README.md.
const collaborators = await getCollaboratorsFromReadme();

console.log(`In the last ${SINCE} commits:\n`);
console.log(`Since ${SINCE}:\n`);
console.log(`* ${authors.size.toLocaleString()} authors have made commits.`);
console.log(`* ${landers.size.toLocaleString()} landers have landed commits.`);
console.log(`* ${approvingReviewers.size.toLocaleString()} reviewers have approved landed commits.`);
console.log(`* ${collaborators.length.toLocaleString()} collaborators currently in the project.`);

const inactive = collaborators.filter((collaborator) =>
!authors.has(collaborator.mailmap) &&
!landers.has(collaborator.mailmap) &&
!approvingReviewers.has(collaborator.name)
);

Expand Down