Files
coder/scripts/update-release-calendar.sh
T
Nick Vigilante d5a6047879 docs: restructure Install into the five phase deployment spine (#29304)
Restructures the Install section into the five-phase deployment spine,
so the reading order matches the order a deployment actually happens:
**plan, prepare, install, validate, operate.** Today the first thing a
reader sees is a shell command, and architecture and sizing sit
downstream in Administration, after the point where they would have been
useful.

Resolves [DOCS-869](https://linear.app/codercom/issue/DOCS-869). Part of
[DOCS-685](https://linear.app/codercom/issue/DOCS-685) and
[DOCS-738](https://linear.app/codercom/issue/DOCS-738).

> [!IMPORTANT]
> **Stacked on [#28960](https://github.com/coder/coder/pull/28960)**
(DOCS-871, terminology). Base is that branch, not `main`. Retarget to
`main` after it merges.
>
> **Paired with coder/coder.com
[#1077](https://github.com/coder/coder.com/pull/1077)**, which must
merge **first**. Without it, every inbound link to a moved page 404s in
the gap.

## Deliberately mechanical

No prose changes. The only edits inside moved pages are relative link
and image path repairs, so the diff reads as renames. That is the point:
this is the highest link-breakage change in the project, and it should
be reviewable as such.

The prose work is [DOCS-868](https://linear.app/codercom/issue/DOCS-868)
(phase overview, architecture rewrite, sizing split, actor table) and
[DOCS-872](https://linear.app/codercom/issue/DOCS-872) (new pages).

## The new spine

```text
Install and deploy Coder            /install
├── Coder CLI                                   [unchanged, retired by DOCS-870]
├── 1. Plan your deployment
│   ├── Architecture and components             [from admin/infrastructure]
│   └── Coder Validated Architecture            [from admin/infrastructure]
│       └── 1k / 2k / 3k / 10k users
├── 2. Prepare prerequisites
│   ├── Licensing                               [from admin/licensing]
│   ├── Air-gapped deployments                  [from install/airgap]
│   └── Mirror images and registries            [from install/registry-mirror-artifactory]
├── 3. Install the control plane
│   ├── Docker / Kubernetes / Rancher / OpenShift
│   ├── Cloud marketplace and VM images
│   └── Unofficial install methods
├── 4. Validate your deployment
│   └── Scale testing                           [from admin/infrastructure]
│       ├── Scale test utility
│       └── Scaling best practices
└── 5. Operate and maintain
    ├── External provisioners                   [from admin/provisioners]
    ├── Upgrading (+ best practices, ESR guides)
    └── Uninstall
```

Leaving Install: release channels become `reference/releases`, feature
stages become `reference/feature-stages`.

`docs/admin/infrastructure/` is gone entirely, which is what DOCS-738
recommended.

## Numbers

- 31 pages moved, all as `git mv` renames.
- 1 page deleted: `admin/infrastructure/index.md`, whose content was a
one-line section blurb.
- 5 new placeholder index pages, one per phase, each a sentence of
orientation plus `<children></children>`. The nav schema requires a path
on every entry, so a phase cannot exist without one.
- 265 relative links and asset paths repaired across 57 files.
- `docs/manifest.json` restructured. Entry count goes 460 to 464: plus 5
stubs, minus the deleted Infrastructure entry.

## Reviewer attention, please

**The redirects PR repairs 19 existing redirects, not just adds new
ones.** This was the surprise. `redirects.json` already had entries
whose *destinations* pointed at pages this PR moves, so they would have
started redirecting to 404s. Examples:
`/docs/architecture/architecture`, `/docs/admin/architectures`,
`/docs/scaling/scale-testing`, `/docs/licensing`, `/docs/enterprise`,
`/docs/install/offline`, `/docs/platforms`, `/docs/install/1-click`,
`/docs/admin/upgrade`, `/docs/install/cloud/ec2`, and both
`feature-stages` aliases. All 19 are fixed in the paired PR.

**This PR touches `scripts/`, so it is not docs-only.** Two release
tools write to paths that moved and would have broken silently at
release time:

- `scripts/update-release-calendar.sh`: `DOCS_FILE` now points at
`docs/reference/releases.md`.
- `scripts/releaser/docs.go`: `releasesFile`, and also `kubernetesFile`
and `rancherFile`, which pointed at `docs/install/kubernetes.md` and
`docs/install/rancher.md`.

<details>
<summary>Deliberate scope decisions</summary>

- **Self-managed vs cloud grouping is flattened.** The reconciled IA
nested platform pages under a "Self-managed platforms" parent. That
would need two more placeholder index pages for groups with no content
yet, so the platform pages sit directly under Phase 3 and the grouping
lands with the DOCS-868 prose.
- **Release-notes URLs left alone.** `scripts/releaser/release.go` and
`scripts/release/generate_release_notes.sh` embed
`https://coder.com/docs/install/releases` and `/docs/install/upgrade` in
release-note templates. The redirects cover them, and changing the
strings would require updating Go test fixtures in
`scripts/release/main_internal_test.go`. Better as its own change.
- **In-product doc links left alone.** Several `site/src` pages link to
`coder.com/docs/admin/provisioners` and similar. Those are absolute
URLs, so the redirects cover them. Updating them is a frontend change
that would pull frontend review into a docs restructure.
- **`admin/security/audit-logs.md` line 237** is hand-written prose
below the generated table, and its `../licensing/index.md` link had to
move with the licensing page. Verified `make gen` does not revert it.
- **`reference/feature-stages.md`** has generated blocks whose relative
links changed depth with the move. The generator named in its own marker
comment (`scripts/release/docs_update_feature_stages.sh`) no longer
exists in the repo, so those links were repaired by hand and the file is
effectively hand-maintained. Worth its own issue.
- **`install/cli.md` keeps its nav slot** here. DOCS-870 retires it.

</details>

## Verification

| Check | Result |
|---|---|
| Broken relative link scan | 0 in `install/`, `admin/`, `reference/`.
21 remain, all pre-existing illustrative examples in
`docs/.style/style-guide/**` and one malformed URL in `docs/README.md` |
| `make gen` | clean, manifest not clobbered, phase structure intact |
| `make lint/markdown` | pass, 508 files, 0 errors |
| `make lint/emdash` | pass |
| `make lint/docs-html` | pass |
| `make lint/prose` | pass, 1 intentional demo error, no new findings |
| `make pre-commit` | pass, including `lint/go`, `lint/ts`,
`lint/shellcheck`, and a slim build |
| Manifest audit | every path resolves to a file on disk; entry-by-entry
diff shows only the expected moves |

Generated with Coder Agents on behalf of @nickvigilante.


<details>
<summary>CI note: doc-check failure is infrastructure, not this
PR</summary>

`Analyze PR for Documentation Updates Needed` fails before it reviews
anything: the Coder account behind `agents-chat-action` returns `User is
not active (status = "suspended")`. It isn't a required check.
`check-docs` (linkspector) and every other check pass on `58ed9e3e4b`.

_CI note added by Coder Agents on behalf of @nickvigilante._
</details>
2026-09-24 13:51:38 -04:00

261 lines
7.5 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# This script automatically updates the release calendar in docs/reference/releases.md
# It updates the status of each release (Not Supported, Security Support, Stable, Mainline,
# Extended Support Release, Not Released) and gets the release dates from the first published
# tag for each minor release.
#
# ESR (Extended Support Release) versions are biannually released and receive extended
# maintenance. The active ESR set is maintained in scripts/release_channels/esr_versions.txt,
# which is also consumed by .github/workflows/backport.yaml. Update that file when new ESR
# versions are designated or old ones reach end of life.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOCS_FILE="docs/reference/releases.md"
ESR_VERSIONS_FILE="${SCRIPT_DIR}/release_channels/esr_versions.txt"
CALENDAR_START_MARKER="<!-- RELEASE_CALENDAR_START -->"
CALENDAR_END_MARKER="<!-- RELEASE_CALENDAR_END -->"
# Known active ESR (Extended Support Release) minor versions. The shared source
# of truth stores full major.minor versions; extract the minor component, since
# the calendar logic below is scoped to the 2.x line. Blank lines and '#'
# comments are ignored.
mapfile -t ESR_VERSIONS < <(grep -vE '^\s*(#|$)' "$ESR_VERSIONS_FILE" | cut -d. -f2)
# Check if a minor version is a known active ESR version.
is_esr_version() {
local minor=$1
for esr in "${ESR_VERSIONS[@]}"; do
if [[ "$minor" -eq "$esr" ]]; then
return 0
fi
done
return 1
}
# Format date as "Month DD, YYYY"
format_date() {
TZ=UTC date -d "$1" +"%B %d, %Y"
}
get_latest_patch() {
local version_major=$1
local version_minor=$2
local tags
local latest
# Get all tags for this minor version
tags=$(cd "$(git rev-parse --show-toplevel)" && git tag | grep "^v$version_major\\.$version_minor\\." | sort -V)
latest=$(echo "$tags" | tail -1)
if [ -z "$latest" ]; then
echo ""
else
echo "${latest#v}"
fi
}
get_first_patch() {
local version_major=$1
local version_minor=$2
local tags
local first
# Get all tags for this minor version
tags=$(cd "$(git rev-parse --show-toplevel)" && git tag | grep "^v$version_major\\.$version_minor\\." | sort -V)
first=$(echo "$tags" | head -1)
if [ -z "$first" ]; then
echo ""
else
echo "${first#v}"
fi
}
get_release_date() {
local version_major=$1
local version_minor=$2
local first_patch
local tag_date
# Get the first patch release
first_patch=$(get_first_patch "$version_major" "$version_minor")
if [ -z "$first_patch" ]; then
# No release found
echo ""
return
fi
# Get the tag date from git
tag_date=$(cd "$(git rev-parse --show-toplevel)" && git log -1 --format=%ai "v$first_patch" 2>/dev/null || echo "")
if [ -z "$tag_date" ]; then
echo ""
else
# Extract date in YYYY-MM-DD format
TZ=UTC date -d "$tag_date" +"%Y-%m-%d"
fi
}
# Generate a single release row for the calendar table.
# Arguments: version_major, rel_minor, status
generate_release_row() {
local version_major=$1
local rel_minor=$2
local status=$3
local version_name="$version_major.$rel_minor"
local actual_release_date
local formatted_date
local latest_patch
local patch_link
local formatted_version_name
# Get the actual release date from the first published tag
if [[ "$status" != "Not Released" ]]; then
actual_release_date=$(get_release_date "$version_major" "$rel_minor")
if [ -n "$actual_release_date" ]; then
formatted_date=$(format_date "$actual_release_date")
else
formatted_date="TBD"
fi
fi
# Get latest patch version
latest_patch=$(get_latest_patch "$version_major" "$rel_minor")
if [ -n "$latest_patch" ]; then
patch_link="[v${latest_patch}](https://github.com/coder/coder/releases/tag/v${latest_patch})"
else
patch_link="N/A"
fi
# Format version name and patch link based on release status
if [[ "$status" == "Not Released" ]]; then
formatted_version_name="$version_name"
patch_link="N/A"
echo "| $formatted_version_name | | $status | $patch_link |"
else
formatted_version_name="[$version_name](https://coder.com/changelog/coder-$version_major-$rel_minor)"
echo "| $formatted_version_name | $formatted_date | $status | $patch_link |"
fi
}
# Generate releases table showing:
# - Active ESR releases (older than the standard window)
# - 3 previous unsupported releases
# - 1 security support release (n-2)
# - 1 stable release (n-1)
# - 1 mainline release (n)
# - 1 next release (n+1)
#
# ESR versions within the standard window that would otherwise show as
# "Not Supported" are marked as "Extended Support Release" instead.
generate_release_calendar() {
local result=""
local version_major=2
local latest_version
local version_minor
local start_minor
# Find the current minor version by looking at the last mainline release tag
latest_version=$(cd "$(git rev-parse --show-toplevel)" && git tag | grep '^v[0-9]*\.[0-9]*\.[0-9]*$' | sort -V | tail -1)
version_minor=$(echo "$latest_version" | cut -d. -f2)
# Start with 3 unsupported releases back
start_minor=$((version_minor - 5))
result="| Release name | Release Date | Status | Latest Release |\n"
result+="|--------------|--------------|--------|----------------|\n"
# Add active ESR versions that fall before the standard window
for esr_minor in "${ESR_VERSIONS[@]}"; do
if [[ "$esr_minor" -lt "$start_minor" ]]; then
result+="$(generate_release_row "$version_major" "$esr_minor" "Extended Support Release")\n"
fi
done
# Generate rows for each release (7 total: 3 unsupported, 1 security, 1 stable, 1 mainline, 1 next)
for i in {0..6}; do
# Calculate release minor version
local rel_minor=$((start_minor + i))
local status
# Determine status based on position
if [[ $i -eq 6 ]]; then
status="Not Released"
elif [[ $i -eq 5 ]]; then
status="Mainline"
elif [[ $i -eq 4 ]]; then
status="Stable"
elif [[ $i -eq 3 ]]; then
status="Security Support"
else
status="Not Supported"
fi
# Mark ESR versions. An ESR that has aged out of support shows as a
# full "Extended Support Release"; while it is still in an active
# channel we append "(ESR)" to that channel, e.g. "Mainline (ESR)".
if is_esr_version "$rel_minor"; then
if [[ "$status" == "Not Supported" ]]; then
status="Extended Support Release"
elif [[ "$status" != "Not Released" ]]; then
status="$status (ESR)"
fi
fi
result+="$(generate_release_row "$version_major" "$rel_minor" "$status")\n"
done
echo -e "$result"
}
# Check if the markdown comments exist in the file
if ! grep -q "$CALENDAR_START_MARKER" "$DOCS_FILE" || ! grep -q "$CALENDAR_END_MARKER" "$DOCS_FILE"; then
echo "Error: Markdown comment anchors not found in $DOCS_FILE"
echo "Please add the following anchors around the release calendar table:"
echo " $CALENDAR_START_MARKER"
echo " $CALENDAR_END_MARKER"
exit 1
fi
# Generate the new calendar table content
NEW_CALENDAR=$(generate_release_calendar)
# Update the file while preserving the rest of the content
awk -v start_marker="$CALENDAR_START_MARKER" \
-v end_marker="$CALENDAR_END_MARKER" \
-v new_calendar="$NEW_CALENDAR" \
'
BEGIN { found_start = 0; found_end = 0; print_line = 1; }
$0 ~ start_marker {
print;
print new_calendar;
found_start = 1;
print_line = 0;
next;
}
$0 ~ end_marker {
found_end = 1;
print_line = 1;
print;
next;
}
print_line || !found_start || found_end { print }
' "$DOCS_FILE" >"${DOCS_FILE}.new"
# Replace the original file with the updated version
mv "${DOCS_FILE}.new" "$DOCS_FILE"
# run make fmt/markdown
make fmt/markdown
echo "Successfully updated release calendar in $DOCS_FILE"