-
Notifications
You must be signed in to change notification settings - Fork 29
fix(docs): correct stale version pins and prevent next.yaml drift #589
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b0e6583
fix(docs): correct stale version pins for go-types install
myasnikovdaniil d4a885c
feat(docs): auto-generate next.yaml version pins from upstream
myasnikovdaniil ed8f6be
fix(docs): pin Talos/cozystack versions in boot-to-talos warning
myasnikovdaniil 949bc63
fix(docs): let update_versions.sh report a failed Talos fetch
myasnikovdaniil 1c3cb2b
fix(docs): let update_versions.sh report a failed release-tag lookup
myasnikovdaniil 134667b
fix(docs): guard update_versions.sh flags against missing values
myasnikovdaniil 07482d3
fix(docs): skip update-versions for prerelease tags
myasnikovdaniil 352bbb6
fix(docs): correct go-module tag note in v1.2 version pins
myasnikovdaniil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 "<key>" >}} 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<major>.<minor>.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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Pinned upstream-tool versions for the Cozystack v1.2 docs. | ||
| # | ||
| # Referenced from content via the {{< version-pin "<key>" >}} 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) | ||
| # 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 …@<tag>` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 "<key>" >}} shortcode. See | ||
| # data/versions/v1.3.yaml for key semantics and rationale. | ||
| # Referenced from content via the {{< version-pin "<key>" >}} 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<major>.<minor>.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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| usage() { | ||
| cat <<'EOF' | ||
| Usage: hack/update_versions.sh [OPTIONS] | ||
|
|
||
| Regenerate a data/versions/<version>.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/<version>.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|--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 | ||
| 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}' || 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 | ||
| 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 || 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 | ||
| exit 1 | ||
| fi | ||
| cozystack_version="${COZYSTACK_TAG#v}" | ||
|
|
||
| # -------------------- 3. (Re)generate the pin file -------------------- | ||
| mkdir -p "$(dirname "$DEST")" | ||
| cat > "$DEST" <<EOF | ||
| # AUTOGENERATED by hack/update_versions.sh — do not edit by hand. | ||
| # | ||
| # Regenerated by 'make update-all' so the {{< version-pin >}} 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})" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.