Skip to content

Commit 3f47581

Browse files
ppiegazedocsy
andauthored
docsy(v2): record retired pins, and deploy their redirects from that (#1507)
Seeds `retired` with the four pins already retired plus v2.6.2.0, which the next cut retires. Their redirect rows are removed from redirects.csv in unionai-docs-infra#TBD and derived from this list instead, so a pin's retirement and its redirect can no longer drift apart -- they are one edit now. The workflow fires on versions.toml as well as the submodule pointer, because a change to `retired` changes the deployed set exactly as a CSV edit does, and fetches both branches because the deploy reads both lines. Seeding v2.6.2.0 before its cut merges means it redirects while its tree is still published, which is deliberate: the alternative ordering leaves 404s, and it resolves when the cut lands. Same trade as the v2.6.1.0 row. Verified by dry run: 8,760 redirect sources before, 8,761 after, the addition being v2.6.2.0. Nothing lost, no duplicate sources. DOC-1497. Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com> Co-authored-by: docsy <docsy@union.ai>
1 parent 134268b commit 3f47581

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

.github/workflows/deploy-redirects.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches: [main, v1]
7-
paths: ['unionai-docs-infra']
7+
paths: ['unionai-docs-infra', 'versions.toml']
88

99
jobs:
1010
deploy-redirects:
@@ -18,7 +18,7 @@ jobs:
1818
submodules: 'true'
1919
fetch-depth: 2 # Need previous commit to detect submodule changes
2020

21-
- name: Check if redirects.csv changed
21+
- name: Check if the deployed redirect set changed
2222
id: check-redirects
2323
run: |
2424
set -euo pipefail
@@ -30,6 +30,13 @@ jobs:
3030
fi
3131
# For push events, check if the unionai-docs-infra submodule ref changed and
3232
# whether that change includes redirects.csv
33+
# Retired-pin redirects are derived from versions.toml `retired`, so a
34+
# change there changes the deployed set just as much as a CSV edit does.
35+
if ! git diff --quiet HEAD~1 HEAD -- versions.toml; then
36+
echo "changed=true" >> "$GITHUB_OUTPUT"
37+
echo "versions.toml changed, proceeding with deploy."
38+
exit 0
39+
fi
3340
OLD_REF=$(git diff HEAD~1 HEAD -- unionai-docs-infra | grep "^-Subproject" | awk '{print $3}' || true)
3441
NEW_REF=$(git diff HEAD~1 HEAD -- unionai-docs-infra | grep "^+Subproject" | awk '{print $3}' || true)
3542
if [ -z "$OLD_REF" ] || [ -z "$NEW_REF" ]; then
@@ -57,6 +64,12 @@ jobs:
5764
with:
5865
python-version: '3.12'
5966

67+
# deploy_redirects.py reads BOTH lines' versions.toml. The checkout has only
68+
# this branch, so make the sibling ref resolvable or the deploy fails closed.
69+
- name: Fetch both documentation lines
70+
if: steps.check-redirects.outputs.changed == 'true'
71+
run: git fetch --depth=1 origin main v1
72+
6073
- name: Deploy redirects to Cloudflare
6174
if: steps.check-redirects.outputs.changed == 'true'
6275
env:

versions.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,21 @@ stable = "v2.6.6.0"
99
# Retention: Cloudflare Pages caps a deployment at 20,000 files, and every
1010
# entry here materializes another full site tree (~3,000 files). Seven trees
1111
# broke the deploy outright on 2026-08-21. Keep this list short; retiring a
12-
# pin needs a redirect row in unionai-docs-infra/redirects.csv.
12+
# pin is recorded in `retired` below, which is where its redirect comes from.
1313
enumerated = [
1414
"v2.6.2.0",
1515
"v2.6.3.0",
1616
"v2.6.5.0",
1717
]
18+
# Pins that have been retired. A pin leaves `enumerated` and arrives here in the
19+
# same edit, made by `manifest.py --promote`, and its redirect is DERIVED from
20+
# this list at deploy time -- do NOT add a row to redirects.csv (DOC-1497; see
21+
# unionai-docs-infra/VERSIONING.md "Retired pins redirect themselves").
22+
retired = [
23+
"v2.5.16.3",
24+
"v2.5.18.3",
25+
"v2.6.0.0",
26+
"v2.6.1.0",
27+
"v2.6.2.0",
28+
]
29+

0 commit comments

Comments
 (0)