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

Prepare release script sed usage is still fragile #23981

Closed
mx-psi opened this issue Jul 5, 2023 · 2 comments · Fixed by #34193
Closed

Prepare release script sed usage is still fragile #23981

mx-psi opened this issue Jul 5, 2023 · 2 comments · Fixed by #34193
Labels
admin issues tracker issues etc. ci-cd CI, CD, testing, build issues never stale Issues marked with this label will be never staled and automatically removed priority:p3 Lowest release-retro Issues discussed in a release retrospective

Comments

@mx-psi
Copy link
Member

mx-psi commented Jul 5, 2023

Component(s)

No response

Describe the issue you're reporting

For releases we use the "Automation - Prepare Release" workflow, which uses this script to create a PR that is the first step of the contrib release.

It used to look like

sed -i.bak "s/${CURRENT_BETA}/${CANDIDATE_BETA}/g" ./cmd/oteltestbedcol/builder-config.yaml
sed -i.bak "s/${CURRENT_BETA}/${CANDIDATE_BETA}/g" ./cmd/otelcontribcol/builder-config.yaml

and after #23977 it looks like

sed -i.bak "s/v${CURRENT_BETA}/v${CANDIDATE_BETA}/g" ./cmd/oteltestbedcol/builder-config.yaml
sed -i.bak "s/v${CURRENT_BETA}/v${CANDIDATE_BETA}/g" ./cmd/otelcontribcol/builder-config.yaml
sed -i.bak "s/${CURRENT_BETA}-dev/${CANDIDATE_BETA}-dev/g" ./cmd/otelcontribcol/builder-config.yaml
sed -i.bak "s/${CURRENT_BETA}-dev/${CANDIDATE_BETA}-dev/g" ./cmd/oteltestbedcol/builder-config.yaml

This sed command may replace versions from dependencies we are replacing, which was the motivation for #23977. The current version still has some issues:

  1. The . on a version like 0.80.0 are still interpreted as 'any character' by sed, which is not what we want. A way to solve this is to do ${CURRENT_BETA//\./\\.} to escape dots as pointed out by @astencel-sumo
  2. Even when solving (1), we still can run into issues if a dependency in the manifest were to exactly match the version used by the Collector (not something that can happen today with the current set of replaces).

We should rework how we handle this replacement to avoid issues in the future.

@mx-psi mx-psi added priority:p3 Lowest ci-cd CI, CD, testing, build issues admin issues tracker issues etc. release-retro Issues discussed in a release retrospective labels Jul 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Sep 4, 2023
@mx-psi mx-psi removed the Stale label Sep 4, 2023
Copy link
Contributor

github-actions bot commented Nov 6, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin issues tracker issues etc. ci-cd CI, CD, testing, build issues never stale Issues marked with this label will be never staled and automatically removed priority:p3 Lowest release-retro Issues discussed in a release retrospective
Projects
None yet
1 participant