1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #5461 from SvenDowideit/getmaintainers.sh

This commit is contained in:
Solomon Hykes 2014-05-15 17:15:40 -07:00
commit 87fc7130a4
2 changed files with 23 additions and 13 deletions

View file

@ -53,14 +53,17 @@ All decisions affecting docker, big and small, follow the same 3 steps:
* Step 2: Discuss the pull request. Anyone can do this. * Step 2: Discuss the pull request. Anyone can do this.
* Step 3: Accept or refuse a pull request. The relevant maintainer does this (see below "Who decides what?") * Step 3: Accept (`LGTM`) or refuse a pull request. The relevant maintainers do
this (see below "Who decides what?")
## Who decides what? ## Who decides what?
So all decisions are pull requests, and the relevant maintainer makes All decisions are pull requests, and the relevant maintainers make
the decision by accepting or refusing the pull request. But how do we decisions by accepting or refusing the pull request. Review and acceptance
identify the relevant maintainer for a given pull request? by anyone is denoted by adding a comment in the pull request: `LGTM`.
However, only currently listed `MAINTAINERS` are counted towards the required
majority.
Docker follows the timeless, highly efficient and totally unfair system Docker follows the timeless, highly efficient and totally unfair system
known as [Benevolent dictator for known as [Benevolent dictator for
@ -70,19 +73,22 @@ decisions are made by default by Solomon. Since making every decision
myself would be highly un-scalable, in practice decisions are spread myself would be highly un-scalable, in practice decisions are spread
across multiple maintainers. across multiple maintainers.
The relevant maintainer for a pull request is assigned in 3 steps: The relevant maintainers for a pull request can be worked out in 2 steps:
* Step 1: Determine the subdirectory affected by the pull request. This * Step 1: Determine the subdirectories affected by the pull request. This
might be `src/registry`, `docs/source/api`, or any other part of the repo. might be `src/registry`, `docs/source/api`, or any other part of the repo.
* Step 2: Find the `MAINTAINERS` file which affects this directory. If the * Step 2: Find the `MAINTAINERS` file which affects this directory. If the
directory itself does not have a `MAINTAINERS` file, work your way up directory itself does not have a `MAINTAINERS` file, work your way up
the repo hierarchy until you find one. the repo hierarchy until you find one.
* Step 3: The first maintainer listed is the primary maintainer. The There is also a `hacks/getmaintainers.sh` script that will print out the
pull request is assigned to him. He may assign it to other listed maintainers for a specified directory.
maintainers, at his discretion.
### I'm a maintainer, and I'm going on holiday
Please let your co-maintainers and other contributors know by raising a pull
request that comments out your `MAINTAINERS` file entry using a `#`.
### I'm a maintainer, should I make pull requests too? ### I'm a maintainer, should I make pull requests too?
@ -91,7 +97,7 @@ made through a pull request.
### Who assigns maintainers? ### Who assigns maintainers?
Solomon. Solomon has final `LGTM` approval for all pull requests to `MAINTAINERS` files.
### How is this process changed? ### How is this process changed?

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/usr/bin/env bash
set -e
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
echo >&2 "Usage: $0 PATH" echo >&2 "Usage: $0 PATH"
@ -34,6 +35,7 @@ while true; do
fi fi
done; done;
} < MAINTAINERS } < MAINTAINERS
break
fi fi
if [ -d .git ]; then if [ -d .git ]; then
break break
@ -46,13 +48,15 @@ done
PRIMARY="${MAINTAINERS[0]}" PRIMARY="${MAINTAINERS[0]}"
PRIMARY_FIRSTNAME=$(echo $PRIMARY | cut -d' ' -f1) PRIMARY_FIRSTNAME=$(echo $PRIMARY | cut -d' ' -f1)
LGTM_COUNT=${#MAINTAINERS[@]}
LGTM_COUNT=$((LGTM_COUNT%2 +1))
firstname() { firstname() {
echo $1 | cut -d' ' -f1 echo $1 | cut -d' ' -f1
} }
echo "--- $PRIMARY is the PRIMARY MAINTAINER of $1. Assign pull requests to him." echo "A pull request in $1 will need $LGTM_COUNT LGTM's to be merged."
echo "$(firstname $PRIMARY) may assign pull requests to the following secondary maintainers:" echo "--- $PRIMARY is the PRIMARY MAINTAINER of $1."
for SECONDARY in "${MAINTAINERS[@]:1}"; do for SECONDARY in "${MAINTAINERS[@]:1}"; do
echo "--- $SECONDARY" echo "--- $SECONDARY"
done done