From 6416290479509bb1061dcac7e0fa5696a1380b9a Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Fri, 17 Apr 2026 12:00:27 -0700 Subject: [PATCH 1/3] Allow automated merge forward to target monthly releases --- branch-release/branch_release.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/branch-release/branch_release.sh b/branch-release/branch_release.sh index bf9b660..7ff169f 100755 --- a/branch-release/branch_release.sh +++ b/branch-release/branch_release.sh @@ -52,6 +52,11 @@ AHEAD_BY_EXP='"ahead_by":\d+' # Get patch number from tag '19.3.11' => '11' PATCH_NUMBER="$( echo "$TAG" | cut -d'.' -f3- | grep -oE '(^[0-9]+$)' )" +# By default, this automation will skip monthly releases that have locked in a '.0' release +# If you manually set a patch number that starts with a +# Get forced target release from tag '26.3._26.4' => '26.4' +FORCED_TARGET_RELEASE="$( echo "$TAG" | cut -d'.' -f3- | grep -oE '^_(.+$)' | cut -d'_' -f2- )" + SNAPSHOT_BRANCH="release${RELEASE_NUM}-SNAPSHOT" RELEASE_BRANCH="release${RELEASE_NUM}" @@ -310,7 +315,18 @@ case "_${release_minor}" in _3|_7) NEXT_RELEASE="${release_major}.$(( release_minor + 4 ))";; esac -if [ -n "${NEXT_RELEASE:-}" ]; then + +if [ -n "${FORCED_TARGET_RELEASE:-}" ]; then + TARGET_BRANCH=release${FORCED_TARGET_RELEASE}-SNAPSHOT + if git rev-parse --verify --quiet "refs/remotes/origin/${TARGET_BRANCH}"; then + echo "" + echo "Overriding default merge forward target with '${TARGET_BRANCH}'. Merging ${TAG} to it." + MERGE_BRANCH="${FORCED_TARGET_RELEASE}_fb_bot_merge_${RELEASE_NUM}" + else + echo "The created tag '${TAG}' specified an invalid target release override: ${TARGET_BRANCH}." >&2 + exit 1 + fi +elif [ -n "${NEXT_RELEASE:-}" ]; then TARGET_BRANCH=release${NEXT_RELEASE}-SNAPSHOT if git rev-parse --verify --quiet "refs/remotes/origin/${TARGET_BRANCH}"; then echo "" From 318ab3f4a0a3d7dc88103d8eefc74b358b12912d Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Fri, 17 Apr 2026 12:15:33 -0700 Subject: [PATCH 2/3] More specific regex --- branch-release/branch_release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch-release/branch_release.sh b/branch-release/branch_release.sh index 7ff169f..b7b59e2 100755 --- a/branch-release/branch_release.sh +++ b/branch-release/branch_release.sh @@ -55,7 +55,7 @@ PATCH_NUMBER="$( echo "$TAG" | cut -d'.' -f3- | grep -oE '(^[0-9]+$)' )" # By default, this automation will skip monthly releases that have locked in a '.0' release # If you manually set a patch number that starts with a # Get forced target release from tag '26.3._26.4' => '26.4' -FORCED_TARGET_RELEASE="$( echo "$TAG" | cut -d'.' -f3- | grep -oE '^_(.+$)' | cut -d'_' -f2- )" +FORCED_TARGET_RELEASE="$( echo "$TAG" | cut -d'.' -f3- | grep -oE '(^_[0-9]+\.[0-9]+$)' | cut -d'_' -f2- )" SNAPSHOT_BRANCH="release${RELEASE_NUM}-SNAPSHOT" RELEASE_BRANCH="release${RELEASE_NUM}" From 1d58876cdc7e13f31c245beb62c266d1151105ca Mon Sep 17 00:00:00 2001 From: labkey-tchad Date: Fri, 17 Apr 2026 12:24:28 -0700 Subject: [PATCH 3/3] Fix comment --- branch-release/branch_release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/branch-release/branch_release.sh b/branch-release/branch_release.sh index b7b59e2..3999ceb 100755 --- a/branch-release/branch_release.sh +++ b/branch-release/branch_release.sh @@ -53,7 +53,7 @@ AHEAD_BY_EXP='"ahead_by":\d+' PATCH_NUMBER="$( echo "$TAG" | cut -d'.' -f3- | grep -oE '(^[0-9]+$)' )" # By default, this automation will skip monthly releases that have locked in a '.0' release -# If you manually set a patch number that starts with a +# If you manually set a patch number that starts with a '_', it will merge forward to the specified version # Get forced target release from tag '26.3._26.4' => '26.4' FORCED_TARGET_RELEASE="$( echo "$TAG" | cut -d'.' -f3- | grep -oE '(^_[0-9]+\.[0-9]+$)' | cut -d'_' -f2- )"