Skip to content

Commit 4fa4d66

Browse files
authored
build: validate edge version in release workflow (#13993)
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 ```
1 parent 2f19be7 commit 4fa4d66

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/actions/helm-publish/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
run: |
1111
mkdir -p target/helm
1212
gsutil cp gs://helm.linkerd.io/edge/index.yaml target/helm/index-pre.yaml
13-
bin/helm-bump-edge
13+
bin/compute-edge-version update-charts
1414
helm-docs
1515
bin/helm-build package
1616
cp charts/artifacthub-repo-edge.yml target/helm/artifacthub-repo.yml

.github/workflows/release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2525
- run: echo "tag=$(CI_FORCE_CLEAN=1 bin/root-tag)" >> "$GITHUB_OUTPUT"
2626
id: tag
27+
- name: Validate edge version
28+
run: bin/compute-edge-version
2729
outputs:
2830
tag: ${{ steps.tag.outputs.tag }}
2931

bin/helm-bump-edge renamed to bin/compute-edge-version

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd )
1111
. "$bindir"/_tag.sh
1212
tag=$(named_tag)
1313

14-
edge_tag_regex='edge-([0-9][0-9])\.([0-9]|[0-9][0-9])\.([0-9]+)'
14+
edge_tag_regex='edge-([0-9][0-9]).([0-9]|[0-9][0-9]).([0-9]+)'
1515

1616
# Get the current edge version.
1717
url=https://run.linkerd.io/install-edge
@@ -37,6 +37,8 @@ if [ "$tag" != "$expected_tag" ]; then
3737
exit 1
3838
fi
3939

40+
[[ "${1:-}" == "update-charts" ]] || exit 0
41+
4042
new_version="$yyyy.$new_mm.$new_xx"
4143

4244
for chart in **/Chart.yaml; do

0 commit comments

Comments
 (0)