-
-
Notifications
You must be signed in to change notification settings - Fork 24
Don't immediately remove new committers #31
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-08-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-12-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-08-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-08-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-10-07 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-11-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-10-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-12-01 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-08-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-11-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-11-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-10-07 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-01-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-11-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-12-01 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-01-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-08-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-11-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-08-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-12-01 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-01-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-01-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-10-07 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-01-20 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2025-04-22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-10-07 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-11-06 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-12-01 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2024-12-01 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,18 +26,19 @@ effect() { | |
| } | ||
|
|
||
| usage() { | ||
| log "Usage: $0 ORG ACTIVITY_REPO MEMBER_REPO DIR PR_CUTOFF_DATE" | ||
| log "Usage: $0 ORG ACTIVITY_REPO MEMBER_REPO DIR NOTICE_CUTOFF" | ||
| exit 1 | ||
| } | ||
|
|
||
| ORG=${1:-$(usage)} | ||
| ACTIVITY_REPO=${2:-$(usage)} | ||
| MEMBER_REPO=${3:-$(usage)} | ||
| DIR=${4:-$(usage)} | ||
| CUTOFF_DATE=${5:-$(usage)} | ||
| NOTICE_CUTOFF=${5:-$(usage)} | ||
|
|
||
| mainBranch=$(git branch --show-current) | ||
| cutoffEpoch=$(date --date="$CUTOFF_DATE" +%s) | ||
| newCutoff=$(date --date="1 year ago" +%s) | ||
| noticeCutoff=$(date --date="$NOTICE_CUTOFF" +%s) | ||
|
|
||
| if [[ -z "${PROD:-}" ]]; then | ||
| tmp=$(git rev-parse --show-toplevel)/.tmp | ||
|
|
@@ -52,6 +53,15 @@ fi | |
| mkdir -p "$DIR" | ||
| cd "$DIR" | ||
| for login in *; do | ||
|
|
||
| # Don't remove people that have been added recently | ||
| if [[ -s "$login" ]]; then | ||
| epochAdded=$(date --date="$(<"$login")" +%s) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I support these "member files" becoming JSON and having much more information in them, in the fullness of time.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hard to imagine what could go in it that wouldn't be in the maintainer list 🤔 |
||
| if (( newCutoff < epochAdded )); then | ||
| continue | ||
| fi | ||
| fi | ||
|
|
||
| trace gh api -X GET /repos/"$ORG"/"$ACTIVITY_REPO"/activity \ | ||
| -f time_period=year \ | ||
| -f actor="$login" \ | ||
|
|
@@ -75,7 +85,7 @@ for login in *; do | |
| # If there is a PR already | ||
| prNumber=$(jq .number <<< "$prInfo") | ||
| epochCreatedAt=$(date --date="$(jq -r .created_at <<< "$prInfo")" +%s) | ||
| if jq -e .draft <<< "$prInfo" >/dev/null && (( epochCreatedAt < cutoffEpoch )); then | ||
| if jq -e .draft <<< "$prInfo" >/dev/null && (( epochCreatedAt < noticeCutoff )); then | ||
| log "$login has a retirement PR due, unmarking PR as draft and commenting with next steps" | ||
| effect gh pr ready --repo "$ORG/$MEMBER_REPO" "$prNumber" | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is only needed because of the instructions below, as I read it, and not because the tool now relies on the git history. Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually an unrelated change to just improve the testing, because the script always pushes to a remote named
originI guess a separate commit would be in order, though I don't think it's essential