Skip to content

Prepare release script sed usage is still fragile #23981

Closed
@mx-psi

Description

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.

Metadata

Assignees

No one assigned

    Labels

    admin issuestracker issues etc.ci-cdCI, CD, testing, build issuesnever staleIssues marked with this label will be never staled and automatically removedpriority:p3Lowestrelease-retroIssues discussed in a release retrospective

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions