8000 build: validate edge version in release workflow by alpeb · Pull Request #13993 · linkerd/linkerd2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

build: validate edge version in release workflow #13993

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

alpeb
Copy link
Member
@alpeb alpeb commented May 5, 2025

Currently when an edge version is tagged, it gets validated only until the chart_deploy job. If it fails, the release CLI gets published but the chart not, leaving things in a mixed bad state.

This change validates the version early on in the release.yml workflow.

It repurposes the script bin/helm-bump-edge as bin/compute-edge-version which performs the validation, and optionally mutates the version in the helm charts (the latter being used only in the chart_deploy job).

The following tests the functionality, assuming the tip of the repo is tagged as edge-25.5.1 and a new tag is expected to be edge-25.5.2:

# Remove current tag
$ git tag -d edge-25.5.1

# Test with invalid tag
$ git tag edge-25.5.3
$ bin/compute-edge-version
Tag (edge-25.5.3) doesnt match computed edge version (edge-25.5.2)

# Test with valid tag
$ git tag -d edge-25.5.3
Deleted tag 'edge-25.5.3' (was 4823b7af3)
$ git tag edge-25.5.2
# Empty results means success
$ bin/compute-edge-version

# Mutate charts
$ bin/compute-edge-version update-charts
Bumping charts/linkerd2-cni/Chart.yaml to 2025.5.2
Bumping charts/linkerd-control-plane/Chart.yaml to 2025.5.2
Bumping charts/linkerd-crds/Chart.yaml to 2025.5.2
Bumping jaeger/charts/linkerd-jaeger/Chart.yaml to 2025.5.2
Bumping multicluster/charts/linkerd-multicluster/Chart.yaml to 2025.5.2
Bumping viz/charts/linkerd-viz/Chart.yaml to 2025.5.2

Currently when an edge version is tagged, it gets validated only until
the chart_deploy job. If it fails, the release CLI gets published but
the chart not, leaving things in a mixed bad state.

This change validates the version early on in the release.yml workflow.

It repurposes the script bin/helm-bump-edge as bin/compute-edge-version
which performs the validation, and optionally mutates the version in the
helm charts (the latter being used only in the chart_deploy job).

The following tests the functionality, assuming the tip of the repo is tagged as
`edge-25.5.1` and a new tag is expected to be `edge-25.5.2`:

```bash
# Remove current tag
$ git tag -d edge-25.5.1

# Test with invalid tag
$ git tag edge-25.5.3
$ bin/compute-edge-version
Tag (edge-25.5.3) doesn't match computed edge version (edge-25.5.2)

# Test with valid tag
$ git tag -d edge-25.5.3
Deleted tag 'edge-25.5.3' (was 4823b7a)
$ git tag edge-25.5.2
# Empty results means success
$ bin/compute-edge-version

# Mutate charts
$ bin/compute-edge-version update-charts
Bumping charts/linkerd2-cni/Chart.yaml to 2025.5.2
Bumping charts/linkerd-control-plane/Chart.yaml to 2025.5.2
Bumping charts/linkerd-crds/Chart.yaml to 2025.5.2
Bumping jaeger/charts/linkerd-jaeger/Chart.yaml to 2025.5.2
Bumping multicluster/charts/linkerd-multicluster/Chart.yaml to 2025.5.2
Bumping viz/charts/linkerd-viz/Chart.yaml to 2025.5.2
```
@alpeb alpeb requested a review from a team as a code owner May 5, 2025 20:48
@@ -11,7 +11,7 @@ bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd )
. "$bindir"/_tag.sh
tag=$(named_tag)

edge_tag_regex='edge-([0-9][0-9])\.([0-9]|[0-9][0-9])\.([0-9]+)'
edge_tag_regex='edge-([0-9][0-9]).([0-9]|[0-9][0-9]).([0-9]+)'
Copy link
Member Author

Choose a reason for hiding this comment

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

dots don't need to be escaped in this context. Doing so makes awk show a warning.

@alpeb alpeb merged commit 4fa4d66 into main May 8, 2025
22 checks passed
@alpeb alpeb deleted the alpeb/validate-edge-version branch May 8, 2025 17:05
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.

2 participants
0