Skip to content

Commit f466d34

Browse files
authored
fix(docs): stop autoupdate PRs from rewriting source URLs every run (#516)
## Summary - Decouple the displayed `source:` URL ref in synced docs from the fetch branch so patch releases and the daily cron stop flipping it on every run. - Realign existing `v1.0/` source URLs (which stamped `release-1.2.1`) to `release-1.0`. ## Context Auto-update PRs from this repo's daily cron, and from `cozystack/cozystack`'s release `tags.yaml`, were touching ~30 files per run for nothing more than swapping the `source:` line between `main`, `release-1.X`, and `vX.Y.Z`. The fetch ref and the displayed ref were the same value. `hack/update_apps.sh` now accepts an optional `--source-ref REF` (defaults to `--branch` for backward compat). The Makefile derives a stable `SOURCE_REF` from `DOC_VERSION`: | `DOC_VERSION` | `SOURCE_REF` | | --- | --- | | `v0` | `main` (legacy, preserves current state) | | `vX.Y` (X≥1) | `release-X.Y` | Fetch still uses `BRANCH` (the exact tag for reproducibility). ## Caller compatibility - Upstream `cozystack/cozystack` `tags.yaml`: `make update-all BRANCH=… RELEASE_TAG=…` — unchanged. - Website daily cron `update-managed-apps.yaml`: `make update-all DOC_VERSION=…` — unchanged. - Standalone `hack/update_apps.sh` runs without `--source-ref`: falls back to `--branch` (no behavior change). - `fill_templates.sh` doesn't touch `source:` URLs, so no changes there. ## Test plan - [x] `make -n update-apps` → `--source-ref release-1.2` - [x] `make -n update-apps RELEASE_TAG=v1.0.5` → `--source-ref release-1.0`, fetch from `v1.0.5` - [x] `make -n update-apps RELEASE_TAG=v1.2.5` → `--source-ref release-1.2`, fetch from `v1.2.5` - [x] `make -n update-apps RELEASE_TAG=v0.30.5` → `--source-ref main`, fetch from `v0.30.5` - [x] HEAD-checked all `release-1.0` README URLs used in v1.0 docs return 200 - [x] Standalone script run without `--source-ref` falls back to `--branch` (verified in temp dir) - [ ] Next post-merge auto-update PR (daily cron at 03:00 UTC, or next `cozystack/cozystack` release) should be small — touching only files whose upstream README content actually changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Build tooling now supports a separate source reference for generated documentation links (can differ from the branch used to fetch content). * **Documentation** * Updated autogenerated documentation source references across v1.0 content to point to the release-1.0 upstream. [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/cozystack/website/pull/516) <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 514a77a + 148d699 commit f466d34

27 files changed

Lines changed: 60 additions & 37 deletions

Makefile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ else
4747
DOC_VERSION ?= next
4848
endif
4949

50+
# SOURCE_REF: stable git ref written into the displayed `source:` URL of generated docs.
51+
# Decoupled from BRANCH (which fetches content) so that patch releases of the same
52+
# minor don't churn every file's source URL on every release.
53+
# v0 → main (legacy bucket; many 0.x tags share this dir)
54+
# next → main (trunk tracks upstream main)
55+
# vX.Y → release-X.Y (the upstream long-lived branch for that minor)
56+
ifeq ($(DOC_VERSION),v0)
57+
SOURCE_REF ?= main
58+
else ifeq ($(DOC_VERSION),next)
59+
SOURCE_REF ?= main
60+
else
61+
SOURCE_REF ?= release-$(patsubst v%,%,$(DOC_VERSION))
62+
endif
63+
5064
# App lists (override on the command line: `make update-apps APPS="tenant redis"`)
5165
APPS ?= tenant clickhouse foundationdb harbor redis mongodb openbao rabbitmq postgres nats kafka mariadb qdrant
5266
K8S ?= kubernetes
@@ -64,19 +78,19 @@ SERVICES_DEST_DIR ?= content/en/docs/$(DOC_VERSION)/operations/services
6478
init-version init-next release-next download-openapi download-openapi-all serve show-target
6579

6680
update-apps:
67-
./hack/update_apps.sh --apps "$(APPS)" --dest "$(APPS_DEST_DIR)" --branch "$(BRANCH)"
81+
./hack/update_apps.sh --apps "$(APPS)" --dest "$(APPS_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)"
6882

6983
update-vms:
70-
./hack/update_apps.sh --apps "$(VMS)" --dest "$(VMS_DEST_DIR)" --branch "$(BRANCH)"
84+
./hack/update_apps.sh --apps "$(VMS)" --dest "$(VMS_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)"
7185

7286
update-networking:
73-
./hack/update_apps.sh --apps "$(NETWORKING)" --dest "$(NETWORKING_DEST_DIR)" --branch "$(BRANCH)"
87+
./hack/update_apps.sh --apps "$(NETWORKING)" --dest "$(NETWORKING_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)"
7488

7589
update-k8s:
76-
./hack/update_apps.sh --index --apps "$(K8S)" --dest "$(K8S_DEST_DIR)" --branch "$(BRANCH)"
90+
./hack/update_apps.sh --index --apps "$(K8S)" --dest "$(K8S_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)"
7791

7892
update-services:
79-
./hack/update_apps.sh --apps "$(SERVICES)" --dest "$(SERVICES_DEST_DIR)" --branch "$(BRANCH)" --pkgdir extra
93+
./hack/update_apps.sh --apps "$(SERVICES)" --dest "$(SERVICES_DEST_DIR)" --branch "$(BRANCH)" --source-ref "$(SOURCE_REF)" --pkgdir extra
8094

8195
update-oss-health:
8296
python3 hack/update_oss_health.py

content/en/docs/v1.0/applications/clickhouse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ aliases:
1111
<!--
1212
Autogenerated content. Don't edit this file directly; edit sources instead.
1313
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/clickhouse.md
14-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/clickhouse/README.md
14+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/clickhouse/README.md
1515
-->
1616

1717

content/en/docs/v1.0/applications/foundationdb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ weight: 50
66
<!--
77
Autogenerated content. Don't edit this file directly; edit sources instead.
88
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/foundationdb.md
9-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/foundationdb/README.md
9+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/foundationdb/README.md
1010
-->
1111

1212

content/en/docs/v1.0/applications/harbor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ weight: 50
77
<!--
88
Autogenerated content. Don't edit this file directly; edit sources instead.
99
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/harbor.md
10-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/harbor/README.md
10+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/harbor/README.md
1111
-->
1212

1313

content/en/docs/v1.0/applications/kafka.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aliases:
1010
<!--
1111
Autogenerated content. Don't edit this file directly; edit sources instead.
1212
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/kafka.md
13-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/kafka/README.md
13+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/kafka/README.md
1414
-->
1515

1616

content/en/docs/v1.0/applications/mariadb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aliases:
1010
<!--
1111
Autogenerated content. Don't edit this file directly; edit sources instead.
1212
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/mariadb.md
13-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/mariadb/README.md
13+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/mariadb/README.md
1414
-->
1515

1616

content/en/docs/v1.0/applications/mongodb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aliases:
1010
<!--
1111
Autogenerated content. Don't edit this file directly; edit sources instead.
1212
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/mongodb.md
13-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/mongodb/README.md
13+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/mongodb/README.md
1414
-->
1515

1616

content/en/docs/v1.0/applications/nats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aliases:
1010
<!--
1111
Autogenerated content. Don't edit this file directly; edit sources instead.
1212
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/nats.md
13-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/nats/README.md
13+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/nats/README.md
1414
-->
1515

1616

content/en/docs/v1.0/applications/openbao.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ weight: 50
77
<!--
88
Autogenerated content. Don't edit this file directly; edit sources instead.
99
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/openbao.md
10-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/openbao/README.md
10+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/openbao/README.md
1111
-->
1212

1313

content/en/docs/v1.0/applications/postgres.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aliases:
1010
<!--
1111
Autogenerated content. Don't edit this file directly; edit sources instead.
1212
metadata: https://github.com/cozystack/website/blob/main/content/en/docs/v1.0/applications/_include/postgres.md
13-
source: https://github.com/cozystack/cozystack/blob/release-1.2.1/packages/apps/postgres/README.md
13+
source: https://github.com/cozystack/cozystack/blob/release-1.0/packages/apps/postgres/README.md
1414
-->
1515

1616

0 commit comments

Comments
 (0)