Skip to content

Commit 8589261

Browse files
fix(fleet): repin rewrites stale dryrun refs, not just rc refs (#392)
The repin's in-repo ref rewrite only matched vX.Y.Z-rc.N, so a hand-written setup-cli pin left pointing at a vX.Y.Z-dryrun.N tag (from a dry-run validation repin) was never updated to the current rc. After the dryrun tags were pruned, primary and rollback-dispatch failed at Set up job (Unable to resolve action stablekernel/cascade@v0.6.0-dryrun.2) and the first live nightly fleet went red. Broaden the grep and sed to match -(rc|dryrun). so any stale prerelease pin self-heals to the rc on the next repin. Part of #373. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
1 parent a160040 commit 8589261

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/fleet-e2e.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ jobs:
353353
run: |
354354
set -euo pipefail
355355
# The full roster of 10 example repos. Repinning means: set manifest
356-
# cli_version to the rc, replace any other in-repo rc-version refs,
356+
# cli_version to the rc, replace any other in-repo prerelease refs (rc/dryrun),
357357
# regenerate the workflows with the rc binary, then commit + push only
358358
# if something changed. This preserves every hand-written suite feature:
359359
# regeneration only rewrites the generated workflows, and we touch
@@ -379,14 +379,15 @@ jobs:
379379
# repos is tracked separately.
380380
sed -i -E '/^[[:space:]]*cli_version_sha:[[:space:]]*/d' "$manifest"
381381
382-
# 2. Replace any other in-repo rc-version refs (e.g. an explicit
383-
# setup-cli@v..-rc.. pin a suite hand-wrote) with the rc. Scope
382+
# 2. Replace any other in-repo prerelease refs (rc OR dryrun, e.g. an
383+
# explicit setup-cli@v..-rc.. or a stale @v..-dryrun.. pin a suite
384+
# hand-wrote, which a prior dry-run repin may have left) with the rc. Scope
384385
# to tracked text files; the regen below rewrites generated
385386
# workflows, this catches anything outside them.
386387
while IFS= read -r f; do
387388
[ -f "$f" ] || continue
388-
sed -i -E "s|v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+|${RC_VERSION}|g" "$f"
389-
done < <(grep -rlE "v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+" . --include='*.yaml' --include='*.yml' 2>/dev/null || true)
389+
sed -i -E "s#v[0-9]+\.[0-9]+\.[0-9]+-(rc|dryrun)\.[0-9]+#${RC_VERSION}#g" "$f"
390+
done < <(grep -rlE "v[0-9]+\.[0-9]+\.[0-9]+-(rc|dryrun)\.[0-9]+" . --include='*.yaml' --include='*.yml' 2>/dev/null || true)
390391
391392
# 3. Regenerate the workflows with the rc binary. This rewrites the
392393
# generated setup-cli refs to the rc and nothing hand-written.

0 commit comments

Comments
 (0)