Skip to content

Commit 97e33de

Browse files
docs: explain the folder-per-version model in the README (#60)
The monorepo replaced branch-per-version with one folder per product version, but the README only stated that in a table row. It never explained the model, so three things had to be reverse-engineered from site.yml and sync/manifest.yml. Add a "Versioning model" section covering: - one folder per version, aggregated by glob, so the published version set is exactly the folder set on disk - why folder names are pure version numbers and no master/next/dev/ latest folder may be added: a moving path segment silently retargets links and indexed results, and release rollover would move every URL - backporting without branches: the same edit in each version folder, one PR per change, with the modules/ mirror-replace caveat while the upstream sync is active - dropping a version: delete the folder, plus the manifest mapping, the latest-*/previous-* attributes, server PUBLISHED_VERSIONS, and the fact that retired URLs 404 README-only; no build, config, or content changes. Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent ff6e7e6 commit 97e33de

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,102 @@ content/<product>/<ver>/ each version is a folder with its own antora.yml
3333
.github/workflows/ci.yml build → pagefind → deploy to GitHub Pages
3434
```
3535

36+
## Versioning model
37+
38+
### One folder per version
39+
40+
Each product version is a folder `content/<product>/<version>/` carrying its own
41+
`antora.yml`, whose `version:` key repeats the folder name
42+
(`content/ocis/8.2/antora.yml` → `version: '8.2'`). `site.yml` aggregates them by
43+
glob (`content/ocis/*`, `content/server/*`, …), so **the published version set is
44+
exactly the folder set on disk** — adding or removing a version needs no playbook
45+
edit.
46+
47+
Two components are versionless and have no version folder: `content/main` (the
48+
`ROOT` landing component, `version: ~`) and `content/webui` (a single rolling
49+
component).
50+
51+
### Only explicit version numbers as folder names
52+
53+
Folder names are pure version numbers — `8.2`, `10.16`, `12.7`. There is
54+
deliberately **no `master`, `next`, `dev`, or `latest` folder**, and none should
55+
be added:
56+
57+
- **A moving path segment is a broken promise.** `…/ocis/next/` points at a
58+
different release every few months, so links, bookmarks, and indexed search
59+
results silently retarget to content the reader was never sent to.
60+
`…/ocis/8.3/` means one release forever.
61+
- **Release rollover moves no URLs.** The in-development line already lives at
62+
its real number, marked `prerelease: true` with a `display_version: '8.3 (dev)'`
63+
(see `content/ocis/8.3/antora.yml`). Shipping it means dropping those two keys —
64+
no path changes, no redirects. With a `next` folder, every page of the release
65+
would change its URL on ship day.
66+
- **The version is legible everywhere it matters** — folder, path, PR diff, and
67+
URL. A reviewer reads `content/ocis/8.2/…` in a diff and knows the target
68+
version without consulting a branch→version mapping.
69+
- **`latest` is generated, never a source folder.**
70+
`antora-extensions/latest-alias.js` publishes `/<product>/latest/` as a tree of
71+
redirect stubs pointing at the newest non-prerelease version; `site.yml`
72+
deliberately does not set `latest_version_segment`.
73+
74+
See the dev-version note under [Versions imported](#versions-imported) for what
75+
moves together on release rollover.
76+
77+
### Backporting
78+
79+
There are no branches, so there is nothing to cherry-pick. Backporting means
80+
**making the same edit in every version folder that should carry it**:
81+
82+
```
83+
content/ocis/8.3/modules/.../page.adoc original edit
84+
content/ocis/8.2/modules/.../page.adoc same edit
85+
content/ocis/8.1/modules/.../page.adoc same edit
86+
```
87+
88+
One PR then carries the change for every affected version: the reviewer sees the
89+
whole backport at once, and no version is deferred to a follow-up that never
90+
happens. The cost is N copies of the hunk instead of one commit replayed N times;
91+
in exchange there is no conflict resolution, which matters because these docs
92+
genuinely diverge per version (paths, attribute values, screenshots). Text that
93+
is truly version-independent belongs in a shared partial or a
94+
`global-attributes.yml` attribute rather than in N copies.
95+
96+
> ⚠️ **While the upstream sync is active, do not hand-edit `modules/`.** Each
97+
> version folder's `modules/` directory is mirror-replaced from the upstream
98+
> `owncloud/docs-*` branch mapped in `sync/manifest.yml` (`sync/sync-repo.sh`
99+
> deletes and re-copies it; upstream wins). A local edit there is wiped by the
100+
> next sync run. Content changes must land upstream on the matching branch — so
101+
> backports are made per branch there — or, for monorepo-only corrections, in
102+
> `sync/patches/<repo>.sh`, which is re-applied idempotently after every mirror.
103+
> Everything outside `sync_paths` (notably `antora.yml`) is monorepo-owned and
104+
> safe to edit here.
105+
106+
### Dropping a version
107+
108+
Delete the folder:
109+
110+
```sh
111+
rm -r content/server/10.15
112+
```
113+
114+
That is the whole content change — `site.yml` needs no edit, because it globs.
115+
Four bits of bookkeeping remain:
116+
117+
1. Remove the matching `mappings:` entry from `sync/manifest.yml`. Otherwise the
118+
next sync run aborts with `ERROR: dest folder does not exist`.
119+
2. Update the hand-maintained `latest-*` / `previous-*` / `current-*` attributes
120+
in `global-attributes.yml` if the removed version appeared in them. The
121+
`latest` alias itself moves automatically (`latest-alias.js` derives it from
122+
the newest non-prerelease version).
123+
3. **Server only:** drop the segment from `PUBLISHED_VERSIONS` in
124+
`ui/supplemental/js/go-redirect.js`; `test/go-redirect.test.js` fails the build
125+
if that list drifts from the published `public/server/*` trees. Legacy
126+
`go.php?to=` links for the removed version then fall back to `latest`, which is
127+
the intended safety net.
128+
4. Accept that the version's URLs now 404 — nothing redirects a retired version
129+
tree. Drop a version only when its inbound links are acceptable casualties, or
130+
add redirects deliberately.
131+
36132
## Versions imported
37133

38134
| Product | Versions (folder) | Notes |

0 commit comments

Comments
 (0)