Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] correctly escape . characters during release preparation #34193

Merged

Conversation

mowies
Copy link
Member

@mowies mowies commented Jul 22, 2024

Description

This PR fixes an issue where the . character in a version string (e.g. 1.2.3) was interpreted by sed as any character and therefore needed to be properly escaped. This happened during the prepare-release workflow.
The version string for the current stable and current beta version strings provided at pipeline start is replaced as follows:

1.2.3 -> 1[.]2[.]3

This ensures that sed searches for the literal . character instead of interpreting it as a wildcard character.
I specifically used the [] syntax to avoid the hassle of "how many backslashes do i need until it's properly escaped?". (and that for bash and sed, which work different on different OSes anyways which makes it hard to test as well)

Link to tracking issue

Fixes #23981

Notes

This PR uses the same solution as done in open-telemetry/opentelemetry-collector#10631 to fix the same issue in that repo.

Signed-off-by: Moritz Wiesinger <moritz.wiesinger@dynatrace.com>
@mowies mowies requested review from a team and evan-bradley July 22, 2024 11:54
Copy link
Contributor

@evan-bradley evan-bradley left a comment

Choose a reason for hiding this comment

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

Ran a quick local test just to verify, looks good to me.

@evan-bradley evan-bradley requested a review from mx-psi July 22, 2024 12:39
@mx-psi mx-psi merged commit b5f8197 into open-telemetry:main Jul 22, 2024
157 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 22, 2024
@mowies mowies deleted the fix-prepare-release-sed branch July 22, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prepare release script sed usage is still fragile
4 participants