Versioned documentation snapshots - #181
Open
GuanzhouSong wants to merge 3 commits into
Open
Conversation
Compile frozen documentation snapshots from tags of the content repository into versioned/<label>/ and serve them under /docs/versions/<label>/, so a reader on an older DocumentDB release can find the docs that shipped with it. The sidebar, breadcrumb and version switcher are extracted into shared components used by both the current and the archived routes. Every link in the sidebar stays inside the version being viewed, so a reader cannot fall out of an archived version by navigating. Archived pages are noindex, which is what keeps them out of sitemap.xml - the generator already skips any page that says so about itself, so there is no second list to keep in sync. The base path is now derived in the workflow instead of hard-coded: upstream resolves it to the empty string exactly as before, while a fork resolves it to its repository name and can deploy a working preview without editing the workflow.
GuanzhouSong
force-pushed
the
versioned-docs
branch
from
September 10, 2026 18:02
38243b3 to
866f3d9
Compare
…t docs describe Both controls derived their "current" label from the newest snapshot label, but a snapshot is by definition an older release - so each printed the same version twice. The switcher showed "Current (v0.114-0, latest)" directly above "v0.114-0 (archived)", and the versions index showed "Current - v0.114-0" above "v0.114-0 archived snapshot", in two controls whose only job is telling versions apart. Read the tag from a server-safe constant instead. FALLBACK_RELEASE lives in a client module and arrives in server code as a client reference, rendering as "undefined", and its object literal is parsed by the CI release drift check so it cannot be refactored. A test pins the two together so they cannot drift.
REVERT BEFORE MERGE. Points the content compiler at a personal fork of the docs repository so the versioned-docs design can be previewed end to end: documentdb/docs currently carries no tags and no release-notes/ directory, so with the upstream config the versions list is necessarily empty and there is nothing for reviewers to look at. Isolated to this commit, and to two files, so dropping it once documentdb/docs is tagged is a single revert.
GuanzhouSong
force-pushed
the
versioned-docs
branch
from
September 10, 2026 18:10
866f3d9 to
2106094
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What I need from you
Sign-off on a docs snapshot policy. The code is built and reviewable below — nothing here reaches a reader until this table is filled in. My recommendation is in the right column; reply "agree" or edit it.
The problem
Today nothing on documentdb.io says which version you are reading. A user on an older release follows an install command that does not exist in their build, it fails, and they have no way to tell whether they made a mistake or read the wrong page.
Our only current answer is "go read the Markdown on a git tag." That is not an answer for anyone not already comfortable browsing a repository.
We are the outlier. Postgres, MongoDB, Redis and Kubernetes all ship browsable versioned docs. We are the project whose install command changes between releases and we are the one without them.
What it looks like for a reader
Finding it. The entry point sits at the bottom of the docs index, below the section cards — someone who wants current docs never steps over it; someone hunting for their version finds it where they land after not finding what they wanted.
Choosing. Current leads and is marked
latest release, because most people arriving here are checking they are in the right place, not looking for an archive. Versions we do not host get an honest answer — links to the tags and releases — rather than a dead end.Knowing where you are. Every archived page says so twice: a badge in the sidebar and a banner above the content with one click back to current. Someone arriving from a search engine lands mid-page with no memory of clicking anything, and this is exactly the confusion the feature exists to remove. Amber, not red — being here is valid, we are just saying where "here" is.
Moving between versions. Each entry goes to the same page in that version, not to that version's home. "How did this work in v0.114-0" is one click, from any page, current or archived.
Why not just keep annotating changes?
Fair challenge — we already annotate ("added in", "default changed in"), and that is cheaper. But annotations tell a reader what changed; they cannot show a reader the page as it was, and they break down completely when pages are restructured.
That is not hypothetical. It is visible in the two sidebars for the same section:
Docker and Linux Packages quick starts did not exist at v0.114-0. The VS Code Extension Guide did, and is gone today. No annotation can recover a page that was deleted.
The two judgment calls
Archived pages are not indexed. The failure this prevents is also the one it could cause: if Google ranks a v0.114-0 install page above the current one, we have hurt the majority to help a minority. Snapshots are for people who already know which version they want; search should keep sending everyone to current docs. The trade-off is real — someone Googling "documentdb v0.114 install" will not find the snapshot. I think this is the right side to err on, but it is your call, which is why it is in the table.
Snapshots are never edited. Current pages get editorial corrections at build time; archived pages deliberately do not. A snapshot we quietly keep fixing is not a snapshot, and its whole value is that it matches what the reader installed. The cost is that known-wrong content stays wrong in the archive — the banner is what makes that acceptable.
Cost, ownership, reversibility
/docs/versions/*.Engineering notes (reviewers)
Preview and the tagging blocker.
documentdb/docshas no git tags and norelease-notes/directory, so with the upstream config the version list is empty. The last commit (2106094) points the compiler at a fork carrying av0.114-0tag purely so this could be previewed — it is marked REVERT BEFORE MERGE and touches two files.Base path. Previewing a docs change on a fork used to require hand-editing the deploy workflow. It is now derived: upstream resolves to no base path (deploy behavior byte-identical to today), any fork resolves to its own repo name. That is what made these screenshots reproducible by any reviewer.
Bug found while producing these screenshots. Both the switcher and the versions index derived their "current" label from the newest snapshot label — but a snapshot is by definition an older release, so each rendered the same version twice ("Current (v0.114-0, latest)" directly above "v0.114-0 (archived)"). Fixed in
35eaec3, with a test pinning the constant to the release the rest of the site documents.Not pictured: mobile. Verified in the built markup rather than screenshotted — the banner renders at every width, and the collapsed nav summary reads "Getting Started navigation (v0.114-0)". The sidebar badge is inside that disclosure, so on mobile the redundancy is banner + summary rather than banner + badge.
Verification.
npm run lintclean ·npm test85/85 · production build exports/docs/versions,/docs/versions/v0.114-0and 18 archived pages · sitemap wrote 274 URLs, excluding all 19 archived pages while keeping the versions index listed.