From ae312323fee5a2760334bc758e7e0a56f61e5a01 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 13:45:26 -0700 Subject: [PATCH 01/14] ci: add cron to auto remove stale branches --- .github/workflows/remove-stale-branches.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/remove-stale-branches.yml diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml new file mode 100644 index 000000000..20ce45ab6 --- /dev/null +++ b/.github/workflows/remove-stale-branches.yml @@ -0,0 +1,20 @@ +name: Remove Stale Branches + +on: + schedule: + - cron: "0 0 * * *" # Everday at midnight + +jobs: + remove-stale-branches: + runs-on: ubuntu-latest + steps: + - uses: fpicalausa/remove-stale-branches@v1.6.0 + with: + dry-run: true # Check out the console output before setting this to false + exempt-authors-regex: "^dependabot" + days-before-branch-stale: 90 + days-before-branch-delete: 7 + excluded-branches: | + main + release-dev/** + v[0-9]+\.[0-9]+\.[0-9]+ From 0521931b8d1485019df69cb769fa3688d8e5ef43 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 13:47:35 -0700 Subject: [PATCH 02/14] update --- .github/workflows/remove-stale-branches.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 20ce45ab6..bec3b7f81 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -3,6 +3,7 @@ name: Remove Stale Branches on: schedule: - cron: "0 0 * * *" # Everday at midnight + workflow_dispatch: # Allows manual trigger from GitHub UI jobs: remove-stale-branches: From 13c108d835941adde7c16fbc1c2b73ab196fc49a Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 13:49:39 -0700 Subject: [PATCH 03/14] update --- .github/workflows/remove-stale-branches.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index bec3b7f81..e88277f6d 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -4,6 +4,7 @@ on: schedule: - cron: "0 0 * * *" # Everday at midnight workflow_dispatch: # Allows manual trigger from GitHub UI + pull_request: jobs: remove-stale-branches: From 24704e40cb201eb20bcaeea0b6283b741a73fc1f Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 13:51:20 -0700 Subject: [PATCH 04/14] update --- .github/workflows/remove-stale-branches.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index e88277f6d..596880cfd 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -16,6 +16,7 @@ jobs: exempt-authors-regex: "^dependabot" days-before-branch-stale: 90 days-before-branch-delete: 7 + operations-per-run: 100 excluded-branches: | main release-dev/** From 8a24e292aa9b17742deb4505c216a3f02a1041f0 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 13:52:42 -0700 Subject: [PATCH 05/14] ignore branch without author name --- .github/workflows/remove-stale-branches.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 596880cfd..923faabeb 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -21,3 +21,4 @@ jobs: main release-dev/** v[0-9]+\.[0-9]+\.[0-9]+ + ignore-unknown-authors: true From 76e97223327ed1b97c476de33c988be184c0891e Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 13:56:40 -0700 Subject: [PATCH 06/14] add default recipient --- .github/workflows/remove-stale-branches.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 923faabeb..388a8ac61 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -22,3 +22,4 @@ jobs: release-dev/** v[0-9]+\.[0-9]+\.[0-9]+ ignore-unknown-authors: true + default-recipient: "bowenli86" From 0e5d3c3e14e324eb7dfc71d361a0f2f09c09655e Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 14:00:45 -0700 Subject: [PATCH 07/14] update wildcard rule --- .github/workflows/remove-stale-branches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 388a8ac61..37d009aeb 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -20,6 +20,6 @@ jobs: excluded-branches: | main release-dev/** - v[0-9]+\.[0-9]+\.[0-9]+ + v*.*.* ignore-unknown-authors: true default-recipient: "bowenli86" From 4b5b50c9b33fdd52328867631e2d60a52bcff511 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 14:02:15 -0700 Subject: [PATCH 08/14] explicitly set token permission --- .github/workflows/remove-stale-branches.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 37d009aeb..4a3b9019e 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -6,6 +6,9 @@ on: workflow_dispatch: # Allows manual trigger from GitHub UI pull_request: +permissions: + contents: write + jobs: remove-stale-branches: runs-on: ubuntu-latest From 7da16cdef8ce4701feffb414d049999799a816bf Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 14:06:37 -0700 Subject: [PATCH 09/14] change wildcard --- .github/workflows/remove-stale-branches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 4a3b9019e..6247f0d6c 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -23,6 +23,6 @@ jobs: excluded-branches: | main release-dev/** - v*.*.* + v* ignore-unknown-authors: true default-recipient: "bowenli86" From a1438d0de32766696b9cd3971011743e4bb07193 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 14:11:52 -0700 Subject: [PATCH 10/14] use exclude-branches-regex --- .github/workflows/remove-stale-branches.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 6247f0d6c..76c01c59d 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -20,9 +20,6 @@ jobs: days-before-branch-stale: 90 days-before-branch-delete: 7 operations-per-run: 100 - excluded-branches: | - main - release-dev/** - v* + exclude-branches-regex: "^(main|release-dev/.*|v[0-9]+\\.[0-9]+\\.[0-9]+)$" ignore-unknown-authors: true default-recipient: "bowenli86" From bbcf3cd25fb9267c58e92658a6a89e699efc8fc4 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Tue, 29 Apr 2025 14:13:46 -0700 Subject: [PATCH 11/14] fix config name --- .github/workflows/remove-stale-branches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 76c01c59d..593285b16 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -20,6 +20,6 @@ jobs: days-before-branch-stale: 90 days-before-branch-delete: 7 operations-per-run: 100 - exclude-branches-regex: "^(main|release-dev/.*|v[0-9]+\\.[0-9]+\\.[0-9]+)$" + exempt-branches-regex: "^(main|release-dev/.*|v[0-9]+\\.[0-9]+\\.[0-9]+)$" ignore-unknown-authors: true default-recipient: "bowenli86" From ee679223d86084879ffd130aa459135a744445cd Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Wed, 30 Apr 2025 09:37:17 -0700 Subject: [PATCH 12/14] turn off dryrun --- .github/workflows/remove-stale-branches.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 593285b16..713ab6b64 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: fpicalausa/remove-stale-branches@v1.6.0 with: - dry-run: true # Check out the console output before setting this to false + dry-run: false # Check out the console output before setting this to false exempt-authors-regex: "^dependabot" days-before-branch-stale: 90 days-before-branch-delete: 7 From fdb56a59ba65a5daef2a10a7504bcd25db427ff3 Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Wed, 30 Apr 2025 09:52:10 -0700 Subject: [PATCH 13/14] update doc --- MAINTENANCE.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/MAINTENANCE.md b/MAINTENANCE.md index 3549e96b8..4df7aa40a 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -68,6 +68,26 @@ When merging a complete `release-dev` branch into `main` after a major feature i - **Breaking Changes**: Clearly document any breaking changes in PR descriptions +### Auto Remove Stale Branches + +Many stale branches lives in the repo and never got cleaned up. to balance developer convenience vs being organized/legible, we have implemented a CI workflow to identify and remove stable branches. + +The CI workflow will: + +- scan stale branches that not hv new commits since 90 days ago, and notify owner if there's one +- if still no changes coming in, delete the stable branch 7 days later + +Following branches and regex are excluded + +- `main` +- `release-dev/*` (release development branches) +- `v*.*.*` (release branches) + +Regex rules can be changed by modifying `exempt-branches-regex` config in the [yml](https://github.com/Layr-Labs/eigenlayer-contracts/blob/main/.github/workflows/remove-stale-branches.yml) + + +------ + ## Release Management From b52c16c36796cd12b6875c2e0ac94686252c54ff Mon Sep 17 00:00:00 2001 From: Bowen Li Date: Wed, 30 Apr 2025 09:52:59 -0700 Subject: [PATCH 14/14] remove trigger by pull request --- .github/workflows/remove-stale-branches.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/remove-stale-branches.yml b/.github/workflows/remove-stale-branches.yml index 713ab6b64..9f09c8b23 100644 --- a/.github/workflows/remove-stale-branches.yml +++ b/.github/workflows/remove-stale-branches.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "0 0 * * *" # Everday at midnight workflow_dispatch: # Allows manual trigger from GitHub UI - pull_request: permissions: contents: write