From b0e65832c708a5934ede6dd92569fc26fab824ac Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Tue, 23 Jun 2026 14:26:02 +0500 Subject: [PATCH 1/8] fix(docs): correct stale version pins for go-types install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Go types `go get` example hardcoded @v1.2.0, and data/versions/v1.5.yaml was a stale copy of next.yaml — so every {{< version-pin >}} on the default (v1.5) docs rendered cozystack v1.3.0 / Talos v1.12.6 instead of v1.5.0 / v1.13.0. - Fix data/versions/v1.5.yaml to the real v1.5 pins - Add data/versions/v1.2.yaml; switch v1.2 go-types to version-pin (v1.0/v1.1 keep the literal — the api submodule's earliest tag is v1.2.0) - Harden release_next.sh to rewrite cozystack_version/tag from RELEASE_TAG so a stale next.yaml can't freeze the wrong version into a release again Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Myasnikov Daniil --- .../en/docs/v1.2/cozystack-api/go-types.md | 2 +- data/versions/v1.2.yaml | 17 +++++++++ data/versions/v1.5.yaml | 36 ++++++++++--------- hack/release_next.sh | 12 ++++++- 4 files changed, 48 insertions(+), 19 deletions(-) create mode 100644 data/versions/v1.2.yaml diff --git a/content/en/docs/v1.2/cozystack-api/go-types.md b/content/en/docs/v1.2/cozystack-api/go-types.md index ba0aca8f..f9df675d 100644 --- a/content/en/docs/v1.2/cozystack-api/go-types.md +++ b/content/en/docs/v1.2/cozystack-api/go-types.md @@ -13,7 +13,7 @@ Cozystack publishes its Kubernetes resource types as a Go module, enabling manag Add the dependency to your Go module: ```bash -go get github.com/cozystack/cozystack/api/apps/v1alpha1@v1.2.0 +go get github.com/cozystack/cozystack/api/apps/v1alpha1@{{< version-pin "cozystack_tag" >}} ``` ## Use Cases diff --git a/data/versions/v1.2.yaml b/data/versions/v1.2.yaml new file mode 100644 index 00000000..9b456f8b --- /dev/null +++ b/data/versions/v1.2.yaml @@ -0,0 +1,17 @@ +# Pinned upstream-tool versions for the Cozystack v1.2 docs. +# +# Referenced from content via the {{< version-pin "" >}} shortcode, which +# derives the version directory from the page's file path — a page under +# content/en/docs/v1.2/ reads this file. +# +# Minimal by design: only the keys actually referenced by v1.2 pages are +# present (see v0.yaml for the same philosophy). The single consumer is +# cozystack-api/go-types.md. +# +# Note: the Go API submodule (github.com/cozystack/cozystack/api/apps/v1alpha1) +# was first tagged at api/apps/v1alpha1/v1.2.0, so v1.2 is the earliest release +# whose go-types page can pin to its own tag. The v1.0/v1.1 go-types pages keep +# a v1.2.0 literal because no earlier module tag exists for `go get` to resolve. + +# Cozystack release the docs are pinned to. +cozystack_tag: "v1.2.0" # v-prefixed, as used in `go get …@` diff --git a/data/versions/v1.5.yaml b/data/versions/v1.5.yaml index ccac476f..34ad8777 100644 --- a/data/versions/v1.5.yaml +++ b/data/versions/v1.5.yaml @@ -1,21 +1,23 @@ -# Pinned upstream-tool versions for the `next/` trunk docs. +# Pinned upstream-tool versions for the Cozystack v1.5 docs. # -# Referenced from content via the {{< version-pin "" >}} shortcode. See -# data/versions/v1.3.yaml for key semantics and rationale. +# Referenced from content via the {{< version-pin "" >}} shortcode. The +# shortcode derives the version directory from the page's file path, so a page +# under content/en/docs/v1.5/ reads this file. # -# During development of an upcoming release, keep these values pointing at the -# latest upstream pre-release / pinned versions for the forthcoming minor so -# the `next/` docs render deterministically. At release time, -# hack/release_next.sh copies this file to data/versions/v..yaml -# so the released docs freeze on the values that were true at the cut. +# Only include pins that are coupled to the Cozystack release and would go +# stale if not updated — the Talos tag that ships in the installer, Cozystack +# release-asset URLs, and tagged source-tree links. Tools that stay +# backwards-compatible across minors (talm, boot-to-talos, talos-bootstrap +# install scripts) stay floating on main / latest in the markdown. +# +# Update when cutting a new minor (see hack/release-checklist.md). -# Upcoming Cozystack release the trunk targets. -# Use the target tag while the minor is in development (e.g. "v1.4.0"). -cozystack_version: "1.3.0" -cozystack_tag: "v1.3.0" +# Cozystack release the docs are pinned to. +cozystack_version: "1.5.0" # bare, as used by `helm --version` +cozystack_tag: "v1.5.0" # v-prefixed, as used in GitHub URLs -# Talos version shipped by the Cozystack installer for the upcoming minor. -# Keep in sync with packages/core/talos/images/talos/profiles/installer.yaml -# in cozystack/cozystack on main. -talos: "v1.12.6" -talos_minor: "v1.12" +# Talos version shipped by the Cozystack installer for this minor. +# Source of truth: packages/core/talos/images/talos/profiles/installer.yaml +# in the cozystack/cozystack repo at `cozystack_tag`. +talos: "v1.13.0" +talos_minor: "v1.13" # the docs minor used by talos.dev URLs diff --git a/hack/release_next.sh b/hack/release_next.sh index 5ba709da..1344edf0 100755 --- a/hack/release_next.sh +++ b/hack/release_next.sh @@ -131,7 +131,17 @@ if [[ -f "$NEXT_DATA" ]]; then echo "! $TARGET_DATA already exists; leaving it as-is." >&2 else cp "$NEXT_DATA" "$TARGET_DATA" - echo "✓ Snapshotted $NEXT_DATA → $TARGET_DATA" + # Pin the release-coupled Cozystack version from RELEASE_TAG so a stale + # next.yaml can't silently freeze the wrong version into the snapshot — + # this is exactly how v1.5.yaml once inherited next.yaml's v1.3.0 values. + # Talos pins are left as snapshotted; they're refreshed manually per cycle. + VERSION_BARE="${RELEASE_TAG#v}" + sed -i.bak \ + -e "s|^\(cozystack_version:[[:space:]]*\).*|\1\"${VERSION_BARE}\"|" \ + -e "s|^\(cozystack_tag:[[:space:]]*\).*|\1\"${RELEASE_TAG}\"|" \ + "$TARGET_DATA" + rm -f "$TARGET_DATA.bak" + echo "✓ Snapshotted $NEXT_DATA → $TARGET_DATA (pinned cozystack_tag=${RELEASE_TAG})" fi else echo "! $NEXT_DATA missing; skipped data/versions snapshot. Create $TARGET_DATA manually if the docs use {{< version-pin >}}." >&2 From d4a885c84af3489591128ed508f2fc1584556e71 Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Tue, 23 Jun 2026 14:26:29 +0500 Subject: [PATCH 2/8] feat(docs): auto-generate next.yaml version pins from upstream next.yaml had been stale at cozystack v1.3.0 / Talos v1.12.6 since the v1.3 cycle because nothing refreshed it. Add hack/update_versions.sh to regenerate it from cozystack/cozystack (Talos from the installer profile, cozystack tag from the latest release) and wire it into `make update-all` for the next trunk, so it can no longer go stale. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Myasnikov Daniil --- Makefile | 12 +++++ data/versions/next.yaml | 31 ++++++------ hack/update_versions.sh | 101 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 17 deletions(-) create mode 100755 hack/update_versions.sh diff --git a/Makefile b/Makefile index fbe90e5b..c240800e 100644 --- a/Makefile +++ b/Makefile @@ -74,6 +74,7 @@ NETWORKING_DEST_DIR ?= content/en/docs/$(DOC_VERSION)/networking SERVICES_DEST_DIR ?= content/en/docs/$(DOC_VERSION)/operations/services .PHONY: update-apps update-vms update-networking update-k8s update-services update-oss-health update-all \ + update-versions \ template-apps template-vms template-networking template-k8s template-services template-all \ init-version init-next release-next download-openapi download-openapi-all serve show-target @@ -144,6 +145,17 @@ update-all: $(MAKE) update-networking $(MAKE) update-k8s $(MAKE) update-services + $(MAKE) update-versions + +# Regenerate the {{< version-pin >}} data file from upstream so the next/ trunk +# never goes stale. Only the next trunk is auto-managed here; released vX.Y.yaml +# files are frozen at release time by hack/release_next.sh. +update-versions: +ifeq ($(DOC_VERSION),next) + ./hack/update_versions.sh --dest data/versions/next.yaml --branch "$(BRANCH)" $(if $(RELEASE_TAG),--cozystack-tag "$(RELEASE_TAG)") +else + @echo "update-versions: $(DOC_VERSION) is a released version (frozen at release time) — skipping." +endif template-apps: ./hack/fill_templates.sh --apps "$(APPS)" --dest "$(APPS_DEST_DIR)" --branch "$(BRANCH)" diff --git a/data/versions/next.yaml b/data/versions/next.yaml index ccac476f..48e06b74 100644 --- a/data/versions/next.yaml +++ b/data/versions/next.yaml @@ -1,21 +1,18 @@ -# Pinned upstream-tool versions for the `next/` trunk docs. +# AUTOGENERATED by hack/update_versions.sh — do not edit by hand. # -# Referenced from content via the {{< version-pin "" >}} shortcode. See -# data/versions/v1.3.yaml for key semantics and rationale. +# Regenerated by 'make update-all' so the {{< version-pin >}} values in the +# next/ trunk track upstream cozystack/cozystack@main: # -# During development of an upcoming release, keep these values pointing at the -# latest upstream pre-release / pinned versions for the forthcoming minor so -# the `next/` docs render deterministically. At release time, -# hack/release_next.sh copies this file to data/versions/v..yaml -# so the released docs freeze on the values that were true at the cut. +# talos / talos_minor ← packages/core/talos/images/talos/profiles/installer.yaml @ main +# cozystack_version / _tag ← latest final release tag (the upcoming release's +# own tag/assets don't exist until it is cut; +# hack/release_next.sh overrides these from +# RELEASE_TAG when next/ is promoted). -# Upcoming Cozystack release the trunk targets. -# Use the target tag while the minor is in development (e.g. "v1.4.0"). -cozystack_version: "1.3.0" -cozystack_tag: "v1.3.0" +# Cozystack release the docs are pinned to. +cozystack_version: "1.5.0" # bare, as used by `helm --version` +cozystack_tag: "v1.5.0" # v-prefixed, as used in GitHub URLs -# Talos version shipped by the Cozystack installer for the upcoming minor. -# Keep in sync with packages/core/talos/images/talos/profiles/installer.yaml -# in cozystack/cozystack on main. -talos: "v1.12.6" -talos_minor: "v1.12" +# Talos version shipped by the Cozystack installer for this trunk. +talos: "v1.13.0" +talos_minor: "v1.13" # the docs minor used by talos.dev URLs diff --git a/hack/update_versions.sh b/hack/update_versions.sh new file mode 100755 index 00000000..4aafad72 --- /dev/null +++ b/hack/update_versions.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' +Usage: hack/update_versions.sh [OPTIONS] + +Regenerate a data/versions/.yaml pin file from upstream +cozystack/cozystack, so the {{< version-pin >}} values never go stale. + +Sources of truth: + * talos / talos_minor ← packages/core/talos/images/talos/profiles/installer.yaml + at --branch (always the version main/the tag ships). + * cozystack_version/_tag ← --cozystack-tag if given (e.g. an upcoming release + tag); otherwise the latest final upstream release + tag. Used as the `next` trunk's resolvable default + until the real release is cut. + +Options: + --dest PATH data/versions/.yaml file to (re)generate (required) + --branch REF Git ref in cozystack/cozystack to read the Talos installer + from (default: main) + --cozystack-tag TAG Pin cozystack_tag to this vX.Y.Z tag instead of the latest + release (optional) + -h, --help Show this help and exit + +Examples: + hack/update_versions.sh --dest data/versions/next.yaml --branch main + hack/update_versions.sh --dest data/versions/next.yaml --branch v1.6.0 --cozystack-tag v1.6.0 +EOF +} + +SOURCE_REPO="cozystack/cozystack" +DEST="" +BRANCH="main" +COZYSTACK_TAG="" + +# -------------------- Parse arguments -------------------- +while [[ $# -gt 0 ]]; do + case "$1" in + --dest) DEST="$2"; shift 2 ;; + --branch) BRANCH="$2"; shift 2 ;; + --cozystack-tag) COZYSTACK_TAG="$2"; shift 2 ;; + -h|--help) usage; exit 0 ;; + *) echo "Unknown argument: $1" >&2; usage; exit 1 ;; + esac +done + +if [[ -z "$DEST" ]]; then + echo "Error: --dest is required." >&2 + usage; exit 1 +fi + +# -------------------- 1. Talos version from the installer profile -------------------- +INSTALLER_PATH="packages/core/talos/images/talos/profiles/installer.yaml" +INSTALLER_URL="https://raw.githubusercontent.com/${SOURCE_REPO}/${BRANCH}/${INSTALLER_PATH}" +talos="$(curl -fsSL "$INSTALLER_URL" 2>/dev/null | awk '/^version:[[:space:]]/{print $2; exit}')" +if [[ ! "$talos" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: could not read a Talos version from $INSTALLER_URL (got '${talos:-}')." >&2 + exit 1 +fi +talos_minor="${talos%.*}" # v1.13.0 -> v1.13 + +# -------------------- 2. Cozystack release tag -------------------- +if [[ -z "$COZYSTACK_TAG" ]]; then + # Latest final release: top-level refs/tags/vX.Y.Z only (excludes the + # api/apps/v1alpha1/* submodule tags and any -rc/-beta pre-releases). + COZYSTACK_TAG="$(git ls-remote --tags --refs "https://github.com/${SOURCE_REPO}.git" 'v*.*.*' \ + | awk -F/ '/refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+$/{print $NF}' \ + | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)" +fi +if [[ ! "$COZYSTACK_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: could not determine a cozystack release tag (got '${COZYSTACK_TAG:-}')." >&2 + exit 1 +fi +cozystack_version="${COZYSTACK_TAG#v}" + +# -------------------- 3. (Re)generate the pin file -------------------- +mkdir -p "$(dirname "$DEST")" +cat > "$DEST" <}} values in the +# next/ trunk track upstream cozystack/cozystack@${BRANCH}: +# +# talos / talos_minor ← ${INSTALLER_PATH} @ ${BRANCH} +# cozystack_version / _tag ← latest final release tag (the upcoming release's +# own tag/assets don't exist until it is cut; +# hack/release_next.sh overrides these from +# RELEASE_TAG when next/ is promoted). + +# Cozystack release the docs are pinned to. +cozystack_version: "${cozystack_version}" # bare, as used by \`helm --version\` +cozystack_tag: "${COZYSTACK_TAG}" # v-prefixed, as used in GitHub URLs + +# Talos version shipped by the Cozystack installer for this trunk. +talos: "${talos}" +talos_minor: "${talos_minor}" # the docs minor used by talos.dev URLs +EOF + +echo "✓ Regenerated $DEST (cozystack_tag=${COZYSTACK_TAG}, talos=${talos}, from ${SOURCE_REPO}@${BRANCH})" From ed8f6bed4f5a929e61c2f9f1d61506e72c74cad0 Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Tue, 23 Jun 2026 14:26:29 +0500 Subject: [PATCH 3/8] fix(docs): pin Talos/cozystack versions in boot-to-talos warning The version-mismatch warning hardcoded "Cozystack v1.3.0 ... target Talos v1.12", which renders wrong on v1.4/v1.5 (both ship Talos v1.13). Replace the literals with the {{< version-pin >}} shortcodes already used elsewhere in the file, across next/v1.5/v1.4/v1.3. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Myasnikov Daniil --- content/en/docs/next/install/talos/boot-to-talos.md | 6 +----- content/en/docs/v1.3/install/talos/boot-to-talos.md | 6 +----- content/en/docs/v1.4/install/talos/boot-to-talos.md | 6 +----- content/en/docs/v1.5/install/talos/boot-to-talos.md | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/content/en/docs/next/install/talos/boot-to-talos.md b/content/en/docs/next/install/talos/boot-to-talos.md index 268ed071..b3b6cff4 100644 --- a/content/en/docs/next/install/talos/boot-to-talos.md +++ b/content/en/docs/next/install/talos/boot-to-talos.md @@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot `boot-to-talos` v0.7.x carries its own hardcoded default image (`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see [`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)). -If you let the interactive prompt fall through to that default on a cluster -you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node -while the Cozystack installer and Talm templates target Talos v1.12 — you -will hit a mismatch at bootstrap time. Always type in the image matching -your target Cozystack release (or pass `-image` on the command line). +If you let the interactive prompt fall through to that default on a cluster you intend to run Cozystack {{< version-pin "cozystack_version" >}}, you will end up with a Talos v1.11 node while the Cozystack installer and Talm templates target Talos {{< version-pin "talos_minor" >}} — you will hit a mismatch at bootstrap time. Always type in the image matching your target Cozystack release (or pass `-image` on the command line). {{% /alert %}} ## Modes diff --git a/content/en/docs/v1.3/install/talos/boot-to-talos.md b/content/en/docs/v1.3/install/talos/boot-to-talos.md index a8ed1d31..0912b949 100644 --- a/content/en/docs/v1.3/install/talos/boot-to-talos.md +++ b/content/en/docs/v1.3/install/talos/boot-to-talos.md @@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot `boot-to-talos` v0.7.x carries its own hardcoded default image (`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see [`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)). -If you let the interactive prompt fall through to that default on a cluster -you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node -while the Cozystack installer and Talm templates target Talos v1.12 — you -will hit a mismatch at bootstrap time. Always type in the image matching -your target Cozystack release (or pass `-image` on the command line). +If you let the interactive prompt fall through to that default on a cluster you intend to run Cozystack {{< version-pin "cozystack_version" >}}, you will end up with a Talos v1.11 node while the Cozystack installer and Talm templates target Talos {{< version-pin "talos_minor" >}} — you will hit a mismatch at bootstrap time. Always type in the image matching your target Cozystack release (or pass `-image` on the command line). {{% /alert %}} ## Modes diff --git a/content/en/docs/v1.4/install/talos/boot-to-talos.md b/content/en/docs/v1.4/install/talos/boot-to-talos.md index 2050e106..8bacba3c 100644 --- a/content/en/docs/v1.4/install/talos/boot-to-talos.md +++ b/content/en/docs/v1.4/install/talos/boot-to-talos.md @@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot `boot-to-talos` v0.7.x carries its own hardcoded default image (`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see [`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)). -If you let the interactive prompt fall through to that default on a cluster -you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node -while the Cozystack installer and Talm templates target Talos v1.12 — you -will hit a mismatch at bootstrap time. Always type in the image matching -your target Cozystack release (or pass `-image` on the command line). +If you let the interactive prompt fall through to that default on a cluster you intend to run Cozystack {{< version-pin "cozystack_version" >}}, you will end up with a Talos v1.11 node while the Cozystack installer and Talm templates target Talos {{< version-pin "talos_minor" >}} — you will hit a mismatch at bootstrap time. Always type in the image matching your target Cozystack release (or pass `-image` on the command line). {{% /alert %}} ## Modes diff --git a/content/en/docs/v1.5/install/talos/boot-to-talos.md b/content/en/docs/v1.5/install/talos/boot-to-talos.md index 3b9e6dbf..84330815 100644 --- a/content/en/docs/v1.5/install/talos/boot-to-talos.md +++ b/content/en/docs/v1.5/install/talos/boot-to-talos.md @@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot `boot-to-talos` v0.7.x carries its own hardcoded default image (`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see [`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)). -If you let the interactive prompt fall through to that default on a cluster -you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node -while the Cozystack installer and Talm templates target Talos v1.12 — you -will hit a mismatch at bootstrap time. Always type in the image matching -your target Cozystack release (or pass `-image` on the command line). +If you let the interactive prompt fall through to that default on a cluster you intend to run Cozystack {{< version-pin "cozystack_version" >}}, you will end up with a Talos v1.11 node while the Cozystack installer and Talm templates target Talos {{< version-pin "talos_minor" >}} — you will hit a mismatch at bootstrap time. Always type in the image matching your target Cozystack release (or pass `-image` on the command line). {{% /alert %}} ## Modes From 949bc6388e273aecdb51a270c33da55e35c1e308 Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Tue, 23 Jun 2026 14:43:29 +0500 Subject: [PATCH 4/8] fix(docs): let update_versions.sh report a failed Talos fetch Address review feedback from gemini-code-assist on hack/update_versions.sh:57: under `set -e`/`set -o pipefail` a failed curl pipeline made the command substitution exit the script before the validation block, so the helpful "could not read a Talos version" error never printed. Append `|| true` so the fetch failure falls through to the validation block instead. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Myasnikov Daniil --- hack/update_versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/update_versions.sh b/hack/update_versions.sh index 4aafad72..ef73e51b 100755 --- a/hack/update_versions.sh +++ b/hack/update_versions.sh @@ -54,7 +54,7 @@ fi # -------------------- 1. Talos version from the installer profile -------------------- INSTALLER_PATH="packages/core/talos/images/talos/profiles/installer.yaml" INSTALLER_URL="https://raw.githubusercontent.com/${SOURCE_REPO}/${BRANCH}/${INSTALLER_PATH}" -talos="$(curl -fsSL "$INSTALLER_URL" 2>/dev/null | awk '/^version:[[:space:]]/{print $2; exit}')" +talos="$(curl -fsSL "$INSTALLER_URL" 2>/dev/null | awk '/^version:[[:space:]]/{print $2; exit}' || true)" if [[ ! "$talos" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Error: could not read a Talos version from $INSTALLER_URL (got '${talos:-}')." >&2 exit 1 From 1c3cb2b4dd0242f807a48c9c5608f43bbecc9dd4 Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Tue, 23 Jun 2026 14:43:57 +0500 Subject: [PATCH 5/8] fix(docs): let update_versions.sh report a failed release-tag lookup Address review feedback from gemini-code-assist on hack/update_versions.sh:70: same `set -e`/`pipefail` premature-exit issue on the `git ls-remote` pipeline. Append `|| true` so a failed lookup falls through to the validation block. The `sort -V` portability suggestion is intentionally not taken: the repo standardises on GNU `sort -V` (hack/download_openapi.sh, hack/init_version.sh), so this stays consistent with the existing scripts. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Myasnikov Daniil --- hack/update_versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/update_versions.sh b/hack/update_versions.sh index ef73e51b..3a235ad9 100755 --- a/hack/update_versions.sh +++ b/hack/update_versions.sh @@ -67,7 +67,7 @@ if [[ -z "$COZYSTACK_TAG" ]]; then # api/apps/v1alpha1/* submodule tags and any -rc/-beta pre-releases). COZYSTACK_TAG="$(git ls-remote --tags --refs "https://github.com/${SOURCE_REPO}.git" 'v*.*.*' \ | awk -F/ '/refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+$/{print $NF}' \ - | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)" + | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1 || true)" fi if [[ ! "$COZYSTACK_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Error: could not determine a cozystack release tag (got '${COZYSTACK_TAG:-}')." >&2 From 134667b8b7408d13e06e2d081d26c2b2867c48c0 Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Thu, 25 Jun 2026 13:30:49 +0500 Subject: [PATCH 6/8] fix(docs): guard update_versions.sh flags against missing values Address review feedback from coderabbitai on hack/update_versions.sh:46: --dest/--branch/--cozystack-tag now emit a clear usage error instead of tripping set -u ("unbound variable") when a flag is passed without a value. Signed-off-by: Myasnikov Daniil --- hack/update_versions.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/hack/update_versions.sh b/hack/update_versions.sh index 3a235ad9..2527b670 100755 --- a/hack/update_versions.sh +++ b/hack/update_versions.sh @@ -38,9 +38,19 @@ COZYSTACK_TAG="" # -------------------- Parse arguments -------------------- while [[ $# -gt 0 ]]; do case "$1" in - --dest) DEST="$2"; shift 2 ;; - --branch) BRANCH="$2"; shift 2 ;; - --cozystack-tag) COZYSTACK_TAG="$2"; shift 2 ;; + --dest|--branch|--cozystack-tag) + # Guard the value-taking flags: without this, a missing value makes the + # `$2` read trip `set -u` ("unbound variable") instead of a clean usage error. + if [[ $# -lt 2 ]]; then + echo "Error: $1 requires a value." >&2 + usage; exit 1 + fi + case "$1" in + --dest) DEST="$2" ;; + --branch) BRANCH="$2" ;; + --cozystack-tag) COZYSTACK_TAG="$2" ;; + esac + shift 2 ;; -h|--help) usage; exit 0 ;; *) echo "Unknown argument: $1" >&2; usage; exit 1 ;; esac From 07482d3a97b243defc0b6fbae33f66ecde2be1ed Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Thu, 25 Jun 2026 13:30:58 +0500 Subject: [PATCH 7/8] fix(docs): skip update-versions for prerelease tags Address review feedback from IvanHunters on the Makefile: the upstream cozystack/cozystack tags workflow runs `make update-all` for every -rc/-beta/-alpha tag too, but update_versions.sh only accepts final vX.Y.Z tags. Gate the step on a non-prerelease RELEASE_TAG so prerelease docs-update CI runs no longer fail; trunk pins keep tracking the latest final release. Signed-off-by: Myasnikov Daniil --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile b/Makefile index c240800e..6c1131e0 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,11 @@ else BRANCH ?= main endif +# Non-empty when RELEASE_TAG carries a prerelease suffix (-rc.N / -beta.N / +# -alpha.N). Used to skip trunk pin regeneration on prereleases — update_versions.sh +# only accepts final vX.Y.Z tags, and the trunk should track the latest final release. +_is_prerelease := $(findstring -,$(RELEASE_TAG)) + # Routing: DOC_VERSION is either a real vX.Y directory (patch releases of an # already-released version) or `next` (everything else). # @@ -150,9 +155,17 @@ update-all: # Regenerate the {{< version-pin >}} data file from upstream so the next/ trunk # never goes stale. Only the next trunk is auto-managed here; released vX.Y.yaml # files are frozen at release time by hack/release_next.sh. +# +# Prerelease tags are skipped: the upstream tags workflow runs `make update-all` +# for every -rc/-beta/-alpha tag too, but update_versions.sh only accepts final +# vX.Y.Z tags, and the trunk pins are meant to track the latest final release. update-versions: ifeq ($(DOC_VERSION),next) +ifeq ($(_is_prerelease),) ./hack/update_versions.sh --dest data/versions/next.yaml --branch "$(BRANCH)" $(if $(RELEASE_TAG),--cozystack-tag "$(RELEASE_TAG)") +else + @echo "update-versions: prerelease $(RELEASE_TAG) — skipping trunk pin refresh (pins track the latest final release)." +endif else @echo "update-versions: $(DOC_VERSION) is a released version (frozen at release time) — skipping." endif From 352bbb68fa95df2a8551d4030128cc27caac7efa Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Thu, 25 Jun 2026 13:30:58 +0500 Subject: [PATCH 8/8] fix(docs): correct go-module tag note in v1.2 version pins Address review feedback from IvanHunters on data/versions/v1.2.yaml: earlier git tags api/apps/v1alpha1/v1.1.6 and v1.1.7 exist but do not resolve as Go module versions (proxy.golang.org returns 404), whereas v1.2.0 resolves. So v1.2.0 is the earliest `go get`-resolvable version; the action is unchanged and only the rationale comment is corrected. Signed-off-by: Myasnikov Daniil --- data/versions/v1.2.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/versions/v1.2.yaml b/data/versions/v1.2.yaml index 9b456f8b..ac374fe2 100644 --- a/data/versions/v1.2.yaml +++ b/data/versions/v1.2.yaml @@ -9,9 +9,12 @@ # cozystack-api/go-types.md. # # Note: the Go API submodule (github.com/cozystack/cozystack/api/apps/v1alpha1) -# was first tagged at api/apps/v1alpha1/v1.2.0, so v1.2 is the earliest release -# whose go-types page can pin to its own tag. The v1.0/v1.1 go-types pages keep -# a v1.2.0 literal because no earlier module tag exists for `go get` to resolve. +# has earlier git tags (api/apps/v1alpha1/v1.1.6, v1.1.7), but those do not +# resolve as Go module versions — proxy.golang.org returns 404 for them, while +# v1.2.0 resolves. So v1.2.0 is the earliest version `go get` can fetch, making +# v1.2 the first release whose go-types page can pin to its own tag. The +# v1.0/v1.1 go-types pages keep a v1.2.0 literal for the same reason: no earlier +# resolvable module version exists. # Cozystack release the docs are pinned to. cozystack_tag: "v1.2.0" # v-prefixed, as used in `go get …@`