Update Backport Script to not Accept Release Branch Name as Patch Release Name by mhlidd · Pull Request #9053 · DataDog/dd-trace-java · GitHub
Skip to content

Update Backport Script to not Accept Release Branch Name as Patch Release Name#9053

Merged
mhlidd merged 3 commits into
masterfrom
mhlidd_update_backport_script
Jul 8, 2025
Merged

Update Backport Script to not Accept Release Branch Name as Patch Release Name#9053
mhlidd merged 3 commits into
masterfrom
mhlidd_update_backport_script

Conversation

@mhlidd

@mhlidd mhlidd commented Jun 27, 2025

Copy link
Copy Markdown
Contributor

What Does This Do

Currently the backport script expects that the PATCH_RELEASE_NAME is prefixed with release/. This does not make sense because the PATCH_RELEASE_BRANCH is defined as release/$PATCH_RELEASE_NAME, which could potentially lead to branch names such as release/release/v1.50.x. This PR removes the check to ensure that PATCH_RELEASE_NAME is prefixed with release/ (since the variable is no longer used afterwards), and actually enforces that it does not start with that prefix to avoid the release/release/v.1.50.x scenario.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@sarahchen6 sarahchen6 added type: enhancement Enhancements and improvements comp: tooling Build & Tooling labels Jun 27, 2025
@pr-commenter

pr-commenter Bot commented Jun 27, 2025

Copy link
Copy Markdown

@mhlidd mhlidd marked this pull request as ready for review June 27, 2025 17:09
@mhlidd mhlidd requested a review from a team as a code owner June 27, 2025 17:09
@mhlidd mhlidd requested review from PerfectSlayer and smola June 27, 2025 17:09
@mhlidd mhlidd added the tag: no release notes Changes to exclude from release notes label Jun 27, 2025
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?

@PerfectSlayer PerfectSlayer Jul 9, 2025

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.

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

@mhlidd mhlidd merged commit e22a67b into master Jul 8, 2025
508 checks passed
@mhlidd mhlidd deleted the mhlidd_update_backport_script branch July 8, 2025 13:53
@github-actions github-actions Bot added this to the 1.51.0 milestone Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants