Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update backport-pr-to-patch-release.sh
  • Loading branch information
mhlidd authored Jun 27, 2025
commit a74c24fa159a1a4c4aa0da9cf0396236c4f84025
4 changes: 2 additions & 2 deletions tooling/backport-pr-to-patch-release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

# PATCH_RELEASE_NAME should be the name of the release that is being done without the patch number.
# PATCH_RELEASE_NAME should be the name of the release that is being done without the patch number. (e.g. v1.2.x)
PATCH_RELEASE_NAME=$1
PATCH_RELEASE_BRANCH=release/$PATCH_RELEASE_NAME
PR_NUMBER=$2
Expand All @@ -23,7 +23,7 @@ if [ -z "$PATCH_RELEASE_NAME" ]; then
fi
# Check patch release name does not start with "release/"
if [[ "$PATCH_RELEASE_NAME" =~ ^release/.* ]]; then
echo "Patch release name should not be the same as the release branch name. Only include the release name without patch number. (e.g. 1.2.x)"
echo "Patch release name should not be the same as the release branch name. Only include the release name without patch number. (e.g. v1.2.x)"
exit 1
Comment on lines +25 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're enforcing the patch release name to be in the v1.2.x format, you should test it then.
Bash can do regexp testing 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this locally, trying to backport a PR with PATCH_RELEASE_NAME=release/1.50.2 and it got caught in the proper check. On the contrary, doing PATCH_RELEASE_NAME=1.50.2 skips that check.

@PerfectSlayer Is this what you mean by testing the regexp testing?

Copy link
Copy Markdown
Contributor

@PerfectSlayer PerfectSlayer Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I meant you should test that the arg is following the ^v[0-9]\.....$ pattern.
I made #9127 as follow up.

fi
# Check PR number is provided
Expand Down