Skip to content

Commit 0c52332

Browse files
fix(docs): correct stale version pins and prevent next.yaml drift (#589)
## What & why The `{{< version-pin >}}` data file for the default docs version (`data/versions/v1.5.yaml`) was a verbatim copy of `next.yaml` that never got bumped, so **every** version-pin on the v1.5 docs rendered cozystack `v1.3.0` / Talos `v1.12.6` instead of `v1.5.0` / `v1.13.0` — including the Go types `go get` example and ~40 install-doc references. Root cause: `release_next.sh` snapshots `next.yaml`, and `next.yaml` had itself been stale since the v1.3 cycle. ## Changes **Correct the stale pins** - Fix `data/versions/v1.5.yaml` to the real v1.5 values (`v1.5.0` / Talos `v1.13.0`, verified against the upstream v1.5.0 installer profile). - Add `data/versions/v1.2.yaml` and switch the v1.2 `go-types` page from a hardcoded `@v1.2.0` to `version-pin`. v1.0/v1.1 keep the literal — the `api/apps/v1alpha1` submodule has earlier git tags (`v1.1.6`, `v1.1.7`) but they don't resolve as Go modules (`proxy.golang.org` 404s), so `v1.2.0` is the earliest version `go get` resolves. **Stop it recurring** - Harden `release_next.sh` to rewrite `cozystack_version`/`cozystack_tag` from `RELEASE_TAG` at snapshot time, so a stale `next.yaml` can't freeze the wrong version into a release again. - Add `hack/update_versions.sh` + a `make update-versions` step in `update-all` that regenerates `next.yaml` from upstream (Talos from the installer profile, cozystack tag from the latest release). The next trunk can no longer go stale; regeneration is idempotent. **Fix a rendered-wrong warning** - The `boot-to-talos` version-mismatch warning hardcoded "Cozystack v1.3.0 … target Talos v1.12", which rendered wrong on v1.4/v1.5 (both ship Talos v1.13). Swap the literals for the `version-pin` shortcodes already used elsewhere in the same file, across next/v1.5/v1.4/v1.3. ## Not included (flagged for follow-up) - 25 autogenerated `source:` URLs in `next/` are frozen at `v1.3.0` (should track `main`). They self-heal on the next `make update-all` for the trunk and that also refetches README bodies, so it's better done as a separate, deliberate re-sync. ## Test notes - Verified each affected page's effective render against its data file (v1.5 → `v1.5.0` / Talos `v1.13`; v1.3 unchanged / correct). - `hack/update_versions.sh` is byte-idempotent across consecutive runs; `release_next.sh` snapshot rewrite verified in isolation. - A full `hugo` build was not run here — local Hugo is v0.163.0 vs the repo-pinned v0.160.1, and 0.163's `security.allowContent` policy rejects an unrelated existing content file. CI/Netlify use the pinned version. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated Talos installation guides to use generic, version-pinned compatibility warnings (using template-driven Cozystack/Talos pins) instead of hardcoded examples. * Updated Go API installation instructions to use dynamic version pins rather than a fixed version tag. * **Chores** * Added automated version-data regeneration tooling for documentation pins, including prerelease handling and safer “next” updates. * Regenerated next/trunk and updated released pins (Cozystack v1.5.0; Talos v1.13.0), including improved release snapshot pinning. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents a90171c + 352bbb6 commit 0c52332

11 files changed

Lines changed: 205 additions & 56 deletions

File tree

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ else
2323
BRANCH ?= main
2424
endif
2525

26+
# Non-empty when RELEASE_TAG carries a prerelease suffix (-rc.N / -beta.N /
27+
# -alpha.N). Used to skip trunk pin regeneration on prereleases — update_versions.sh
28+
# only accepts final vX.Y.Z tags, and the trunk should track the latest final release.
29+
_is_prerelease := $(findstring -,$(RELEASE_TAG))
30+
2631
# Routing: DOC_VERSION is either a real vX.Y directory (patch releases of an
2732
# already-released version) or `next` (everything else).
2833
#
@@ -74,6 +79,7 @@ NETWORKING_DEST_DIR ?= content/en/docs/$(DOC_VERSION)/networking
7479
SERVICES_DEST_DIR ?= content/en/docs/$(DOC_VERSION)/operations/services
7580

7681
.PHONY: update-apps update-vms update-networking update-k8s update-services update-oss-health update-all \
82+
update-versions \
7783
template-apps template-vms template-networking template-k8s template-services template-all \
7884
init-version init-next release-next download-openapi download-openapi-all serve show-target
7985

@@ -144,6 +150,25 @@ update-all:
144150
$(MAKE) update-networking
145151
$(MAKE) update-k8s
146152
$(MAKE) update-services
153+
$(MAKE) update-versions
154+
155+
# Regenerate the {{< version-pin >}} data file from upstream so the next/ trunk
156+
# never goes stale. Only the next trunk is auto-managed here; released vX.Y.yaml
157+
# files are frozen at release time by hack/release_next.sh.
158+
#
159+
# Prerelease tags are skipped: the upstream tags workflow runs `make update-all`
160+
# for every -rc/-beta/-alpha tag too, but update_versions.sh only accepts final
161+
# vX.Y.Z tags, and the trunk pins are meant to track the latest final release.
162+
update-versions:
163+
ifeq ($(DOC_VERSION),next)
164+
ifeq ($(_is_prerelease),)
165+
./hack/update_versions.sh --dest data/versions/next.yaml --branch "$(BRANCH)" $(if $(RELEASE_TAG),--cozystack-tag "$(RELEASE_TAG)")
166+
else
167+
@echo "update-versions: prerelease $(RELEASE_TAG) — skipping trunk pin refresh (pins track the latest final release)."
168+
endif
169+
else
170+
@echo "update-versions: $(DOC_VERSION) is a released version (frozen at release time) — skipping."
171+
endif
147172

148173
template-apps:
149174
./hack/fill_templates.sh --apps "$(APPS)" --dest "$(APPS_DEST_DIR)" --branch "$(BRANCH)"

content/en/docs/next/install/talos/boot-to-talos.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot
3232
`boot-to-talos` v0.7.x carries its own hardcoded default image
3333
(`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see
3434
[`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)).
35-
If you let the interactive prompt fall through to that default on a cluster
36-
you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node
37-
while the Cozystack installer and Talm templates target Talos v1.12 — you
38-
will hit a mismatch at bootstrap time. Always type in the image matching
39-
your target Cozystack release (or pass `-image` on the command line).
35+
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).
4036
{{% /alert %}}
4137

4238
## Modes

content/en/docs/v1.2/cozystack-api/go-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Cozystack publishes its Kubernetes resource types as a Go module, enabling manag
1313
Add the dependency to your Go module:
1414

1515
```bash
16-
go get github.com/cozystack/cozystack/api/apps/v1alpha1@v1.2.0
16+
go get github.com/cozystack/cozystack/api/apps/v1alpha1@{{< version-pin "cozystack_tag" >}}
1717
```
1818

1919
## Use Cases

content/en/docs/v1.3/install/talos/boot-to-talos.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot
3232
`boot-to-talos` v0.7.x carries its own hardcoded default image
3333
(`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see
3434
[`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)).
35-
If you let the interactive prompt fall through to that default on a cluster
36-
you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node
37-
while the Cozystack installer and Talm templates target Talos v1.12 — you
38-
will hit a mismatch at bootstrap time. Always type in the image matching
39-
your target Cozystack release (or pass `-image` on the command line).
35+
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).
4036
{{% /alert %}}
4137

4238
## Modes

content/en/docs/v1.4/install/talos/boot-to-talos.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot
3232
`boot-to-talos` v0.7.x carries its own hardcoded default image
3333
(`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see
3434
[`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)).
35-
If you let the interactive prompt fall through to that default on a cluster
36-
you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node
37-
while the Cozystack installer and Talm templates target Talos v1.12 — you
38-
will hit a mismatch at bootstrap time. Always type in the image matching
39-
your target Cozystack release (or pass `-image` on the command line).
35+
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).
4036
{{% /alert %}}
4137

4238
## Modes

content/en/docs/v1.5/install/talos/boot-to-talos.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ Use `ghcr.io/cozystack/cozystack/talos:{{< version-pin "talos" >}}` as the `boot
3232
`boot-to-talos` v0.7.x carries its own hardcoded default image
3333
(`ghcr.io/cozystack/cozystack/talos:v1.11.6` as of v0.7.1, see
3434
[`cmd/boot-to-talos/main.go`](https://github.com/cozystack/boot-to-talos/blob/v0.7.1/cmd/boot-to-talos/main.go)).
35-
If you let the interactive prompt fall through to that default on a cluster
36-
you intend to run Cozystack v1.3.0, you will end up with a Talos v1.11 node
37-
while the Cozystack installer and Talm templates target Talos v1.12 — you
38-
will hit a mismatch at bootstrap time. Always type in the image matching
39-
your target Cozystack release (or pass `-image` on the command line).
35+
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).
4036
{{% /alert %}}
4137

4238
## Modes

data/versions/next.yaml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
# Pinned upstream-tool versions for the `next/` trunk docs.
1+
# AUTOGENERATED by hack/update_versions.sh — do not edit by hand.
22
#
3-
# Referenced from content via the {{< version-pin "<key>" >}} shortcode. See
4-
# data/versions/v1.3.yaml for key semantics and rationale.
3+
# Regenerated by 'make update-all' so the {{< version-pin >}} values in the
4+
# next/ trunk track upstream cozystack/cozystack@main:
55
#
6-
# During development of an upcoming release, keep these values pointing at the
7-
# latest upstream pre-release / pinned versions for the forthcoming minor so
8-
# the `next/` docs render deterministically. At release time,
9-
# hack/release_next.sh copies this file to data/versions/v<major>.<minor>.yaml
10-
# so the released docs freeze on the values that were true at the cut.
6+
# talos / talos_minor ← packages/core/talos/images/talos/profiles/installer.yaml @ main
7+
# cozystack_version / _tag ← latest final release tag (the upcoming release's
8+
# own tag/assets don't exist until it is cut;
9+
# hack/release_next.sh overrides these from
10+
# RELEASE_TAG when next/ is promoted).
1111

12-
# Upcoming Cozystack release the trunk targets.
13-
# Use the target tag while the minor is in development (e.g. "v1.4.0").
14-
cozystack_version: "1.3.0"
15-
cozystack_tag: "v1.3.0"
12+
# Cozystack release the docs are pinned to.
13+
cozystack_version: "1.5.0" # bare, as used by `helm --version`
14+
cozystack_tag: "v1.5.0" # v-prefixed, as used in GitHub URLs
1615

17-
# Talos version shipped by the Cozystack installer for the upcoming minor.
18-
# Keep in sync with packages/core/talos/images/talos/profiles/installer.yaml
19-
# in cozystack/cozystack on main.
20-
talos: "v1.12.6"
21-
talos_minor: "v1.12"
16+
# Talos version shipped by the Cozystack installer for this trunk.
17+
talos: "v1.13.0"
18+
talos_minor: "v1.13" # the docs minor used by talos.dev URLs

data/versions/v1.2.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Pinned upstream-tool versions for the Cozystack v1.2 docs.
2+
#
3+
# Referenced from content via the {{< version-pin "<key>" >}} shortcode, which
4+
# derives the version directory from the page's file path — a page under
5+
# content/en/docs/v1.2/ reads this file.
6+
#
7+
# Minimal by design: only the keys actually referenced by v1.2 pages are
8+
# present (see v0.yaml for the same philosophy). The single consumer is
9+
# cozystack-api/go-types.md.
10+
#
11+
# Note: the Go API submodule (github.com/cozystack/cozystack/api/apps/v1alpha1)
12+
# has earlier git tags (api/apps/v1alpha1/v1.1.6, v1.1.7), but those do not
13+
# resolve as Go module versions — proxy.golang.org returns 404 for them, while
14+
# v1.2.0 resolves. So v1.2.0 is the earliest version `go get` can fetch, making
15+
# v1.2 the first release whose go-types page can pin to its own tag. The
16+
# v1.0/v1.1 go-types pages keep a v1.2.0 literal for the same reason: no earlier
17+
# resolvable module version exists.
18+
19+
# Cozystack release the docs are pinned to.
20+
cozystack_tag: "v1.2.0" # v-prefixed, as used in `go get …@<tag>`

data/versions/v1.5.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
# Pinned upstream-tool versions for the `next/` trunk docs.
1+
# Pinned upstream-tool versions for the Cozystack v1.5 docs.
22
#
3-
# Referenced from content via the {{< version-pin "<key>" >}} shortcode. See
4-
# data/versions/v1.3.yaml for key semantics and rationale.
3+
# Referenced from content via the {{< version-pin "<key>" >}} shortcode. The
4+
# shortcode derives the version directory from the page's file path, so a page
5+
# under content/en/docs/v1.5/ reads this file.
56
#
6-
# During development of an upcoming release, keep these values pointing at the
7-
# latest upstream pre-release / pinned versions for the forthcoming minor so
8-
# the `next/` docs render deterministically. At release time,
9-
# hack/release_next.sh copies this file to data/versions/v<major>.<minor>.yaml
10-
# so the released docs freeze on the values that were true at the cut.
7+
# Only include pins that are coupled to the Cozystack release and would go
8+
# stale if not updated — the Talos tag that ships in the installer, Cozystack
9+
# release-asset URLs, and tagged source-tree links. Tools that stay
10+
# backwards-compatible across minors (talm, boot-to-talos, talos-bootstrap
11+
# install scripts) stay floating on main / latest in the markdown.
12+
#
13+
# Update when cutting a new minor (see hack/release-checklist.md).
1114

12-
# Upcoming Cozystack release the trunk targets.
13-
# Use the target tag while the minor is in development (e.g. "v1.4.0").
14-
cozystack_version: "1.3.0"
15-
cozystack_tag: "v1.3.0"
15+
# Cozystack release the docs are pinned to.
16+
cozystack_version: "1.5.0" # bare, as used by `helm --version`
17+
cozystack_tag: "v1.5.0" # v-prefixed, as used in GitHub URLs
1618

17-
# Talos version shipped by the Cozystack installer for the upcoming minor.
18-
# Keep in sync with packages/core/talos/images/talos/profiles/installer.yaml
19-
# in cozystack/cozystack on main.
20-
talos: "v1.12.6"
21-
talos_minor: "v1.12"
19+
# Talos version shipped by the Cozystack installer for this minor.
20+
# Source of truth: packages/core/talos/images/talos/profiles/installer.yaml
21+
# in the cozystack/cozystack repo at `cozystack_tag`.
22+
talos: "v1.13.0"
23+
talos_minor: "v1.13" # the docs minor used by talos.dev URLs

hack/release_next.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,17 @@ if [[ -f "$NEXT_DATA" ]]; then
131131
echo "! $TARGET_DATA already exists; leaving it as-is." >&2
132132
else
133133
cp "$NEXT_DATA" "$TARGET_DATA"
134-
echo "✓ Snapshotted $NEXT_DATA$TARGET_DATA"
134+
# Pin the release-coupled Cozystack version from RELEASE_TAG so a stale
135+
# next.yaml can't silently freeze the wrong version into the snapshot —
136+
# this is exactly how v1.5.yaml once inherited next.yaml's v1.3.0 values.
137+
# Talos pins are left as snapshotted; they're refreshed manually per cycle.
138+
VERSION_BARE="${RELEASE_TAG#v}"
139+
sed -i.bak \
140+
-e "s|^\(cozystack_version:[[:space:]]*\).*|\1\"${VERSION_BARE}\"|" \
141+
-e "s|^\(cozystack_tag:[[:space:]]*\).*|\1\"${RELEASE_TAG}\"|" \
142+
"$TARGET_DATA"
143+
rm -f "$TARGET_DATA.bak"
144+
echo "✓ Snapshotted $NEXT_DATA$TARGET_DATA (pinned cozystack_tag=${RELEASE_TAG})"
135145
fi
136146
else
137147
echo "! $NEXT_DATA missing; skipped data/versions snapshot. Create $TARGET_DATA manually if the docs use {{< version-pin >}}." >&2

0 commit comments

Comments
 (0)