From d19b27c77e0d7cf37d2dfe81d48e98d2e8e7c996 Mon Sep 17 00:00:00 2001 From: chloeYue Date: Tue, 12 May 2026 11:46:37 +0200 Subject: [PATCH 1/4] fix: scan more open PRs in release-branch-sync (MCRM-66) `gh pr list --state open` defaults to 30 results, so on busy repos the next release PR was often not in the result set returned to get_active_release_branches. The script then logged "No active release branches found" and exited without creating any sync PR. This bit metamask-extension after the 13.20.1 hotfix release: PR release/13.21.0 was open but not in the first 30 results, so no sync PR was auto-created and the next release branch had to be patched manually. Pass --limit 500 so the next release PR is always included, and document why in a comment so the limit isn't silently lowered later. Co-authored-by: Cursor --- .github/scripts/release-branch-sync.sh | 8 ++++++++ CHANGELOG.md | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/.github/scripts/release-branch-sync.sh b/.github/scripts/release-branch-sync.sh index 9c56523a..e03beb5a 100644 --- a/.github/scripts/release-branch-sync.sh +++ b/.github/scripts/release-branch-sync.sh @@ -108,9 +108,17 @@ get_active_release_branches() { # Query open and draft PRs with title starting with "release:" (case-insensitive) # The jq filter extracts version from PR titles like "release: 7.36.0" or "Release: 7.36.0 (#1234)" + # + # `--limit` must be high enough that the next release PR is always in the + # result set. The default `gh pr list` limit is 30, which is not enough for + # busy repos (e.g. metamask-extension) where the release PR is often older + # than the 30 most-recently-created open PRs — in that case the script would + # silently log "No active release branches found" and exit without creating + # any sync PR. See https://consensyssoftware.atlassian.net/browse/MCRM-66. local pr_data pr_data=$(gh pr list \ --state open \ + --limit 500 \ --json title,isDraft \ --jq '.[] | select(.title | test("^release:\\s*[0-9]+\\.[0-9]+\\.[0-9]+"; "i")) | .title' \ 2>/dev/null || echo "") diff --git a/CHANGELOG.md b/CHANGELOG.md index c61074ab..4e4b65cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fix `release-branch-sync` action silently skipping the next release PR when the repo has many open PRs. `gh pr list` was called without `--limit` and defaulted to 30 results, so the next release PR could fall outside the returned set. This caused hotfix sync PRs (e.g. `release/13.20.1` → `release/13.21.0` on metamask-extension) not to be auto-created. Now scans up to 500 open PRs ([MCRM-66](https://consensyssoftware.atlassian.net/browse/MCRM-66)). + ## [1.9.2] ### Changed From c83569b4825fa0a0706b6bc005ddd8624dfc6bf0 Mon Sep 17 00:00:00 2001 From: chloeYue Date: Tue, 12 May 2026 11:52:14 +0200 Subject: [PATCH 2/4] edit --- .github/scripts/release-branch-sync.sh | 9 --------- CHANGELOG.md | 4 ---- 2 files changed, 13 deletions(-) diff --git a/.github/scripts/release-branch-sync.sh b/.github/scripts/release-branch-sync.sh index e03beb5a..66299c6a 100644 --- a/.github/scripts/release-branch-sync.sh +++ b/.github/scripts/release-branch-sync.sh @@ -106,15 +106,6 @@ stable_has_new_commits() { get_active_release_branches() { local branches="" - # Query open and draft PRs with title starting with "release:" (case-insensitive) - # The jq filter extracts version from PR titles like "release: 7.36.0" or "Release: 7.36.0 (#1234)" - # - # `--limit` must be high enough that the next release PR is always in the - # result set. The default `gh pr list` limit is 30, which is not enough for - # busy repos (e.g. metamask-extension) where the release PR is often older - # than the 30 most-recently-created open PRs — in that case the script would - # silently log "No active release branches found" and exit without creating - # any sync PR. See https://consensyssoftware.atlassian.net/browse/MCRM-66. local pr_data pr_data=$(gh pr list \ --state open \ diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e4b65cb..c61074ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Fixed - -- Fix `release-branch-sync` action silently skipping the next release PR when the repo has many open PRs. `gh pr list` was called without `--limit` and defaulted to 30 results, so the next release PR could fall outside the returned set. This caused hotfix sync PRs (e.g. `release/13.20.1` → `release/13.21.0` on metamask-extension) not to be auto-created. Now scans up to 500 open PRs ([MCRM-66](https://consensyssoftware.atlassian.net/browse/MCRM-66)). - ## [1.9.2] ### Changed From 0d77bfafeb27314fffae4f4c5169de411687f985 Mon Sep 17 00:00:00 2001 From: chloeYue Date: Tue, 12 May 2026 11:55:44 +0200 Subject: [PATCH 3/4] edit --- .github/scripts/release-branch-sync.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/scripts/release-branch-sync.sh b/.github/scripts/release-branch-sync.sh index 66299c6a..7af40057 100644 --- a/.github/scripts/release-branch-sync.sh +++ b/.github/scripts/release-branch-sync.sh @@ -106,6 +106,8 @@ stable_has_new_commits() { get_active_release_branches() { local branches="" + # Query open and draft PRs with title starting with "release:" (case-insensitive) + # The jq filter extracts version from PR titles like "release: 7.36.0" or "Release: 7.36.0 (#1234)" local pr_data pr_data=$(gh pr list \ --state open \ From 6460b6818d9429c5435301dbf51d98052a66bd55 Mon Sep 17 00:00:00 2001 From: chloeYue <105063779+chloeYue@users.noreply.github.com> Date: Tue, 12 May 2026 18:34:01 +0200 Subject: [PATCH 4/4] Update .github/scripts/release-branch-sync.sh Co-authored-by: Mark Stacey --- .github/scripts/release-branch-sync.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/release-branch-sync.sh b/.github/scripts/release-branch-sync.sh index 7af40057..d1ebf3b7 100644 --- a/.github/scripts/release-branch-sync.sh +++ b/.github/scripts/release-branch-sync.sh @@ -112,6 +112,7 @@ get_active_release_branches() { pr_data=$(gh pr list \ --state open \ --limit 500 \ + --search 'in:title release' \ --json title,isDraft \ --jq '.[] | select(.title | test("^release:\\s*[0-9]+\\.[0-9]+\\.[0-9]+"; "i")) | .title' \ 2>/dev/null || echo "")