Skip to content

docs: document git-ref-based docs versioning - #6558

Open
devin-ai-integration[bot] wants to merge 8 commits into
mainfrom
devin/1786039614-git-ref-versioning-docs
Open

docs: document git-ref-based docs versioning#6558
devin-ai-integration[bot] wants to merge 8 commits into
mainfrom
devin/1786039614-git-ref-versioning-docs

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents ref: on a docs.yml version entry (fern#17288) as a new section on the existing Versions page, plus a changelog entry.

The section is deliberately opinionated: ref: is framed as the way to serve frozen versions archived at a past release, not versions under active maintenance, because fern docs dev previews working-tree versions only and ref-backed content is built at publish. The recommended shape is a single main/master branch holding current docs and the full versions: list, with past releases archived at tags — the alternative to long-lived version branches.

Also notes that tags/SHAs are immutable while branch refs re-resolve on every publish, and how Fern picks what to build at the ref (the ref's default version if its docs.yml is versioned, otherwise its top-level navigation).

Link to Devin session: https://app.devin.ai/sessions/bd012060ec3549629c8a073910ae761d

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot requested a review from devalog as a code owner August 6, 2026 18:07
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring


## Build a version from a git ref

Instead of a `path` into your working tree, a version entry can name a `ref`: a git branch, tag, or commit SHA. On publish, Fern resolves the ref to a commit, checks out the repository at that commit, and builds that version's pages, navigation, assets, API definitions, and committed library output from it, composed with the current branch's theme, shell, and `versions` metadata.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just build that versions content

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trimmed to "builds that version's content from it" in 4fd1354 (same in the changelog entry).

Ryan-Amirthan and others added 2 commits August 6, 2026 18:11
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Tags and commit SHAs are immutable, so a published version stays byte-for-byte stable. Branch refs resolve to whatever commit the remote branch points at when you publish, which means a republish can change already-published content.

At the ref, Fern builds the navigation from that commit's `versions[0].path`, falling back to its top-level `navigation`. The ref's own `versions` list isn't followed, so older versions declared there are ignored. Publishing requires git and access to the remote; shallow CI checkouts are backfilled with a targeted fetch. If a version's [library reference output](/learn/docs/api-references/library-reference) is missing at the ref, Fern warns and skips that section rather than failing the build.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does versions[0].path mean anything for an end user?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No — that was internal shorthand. Reworded in 305a279: "If the ref's own docs.yml is versioned, Fern builds its default version (the first entry in its versions list) and ignores the rest; otherwise it builds the ref's top-level navigation."

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- display-name: Latest
path: ./versions/latest.yml # built from the working tree
- display-name: v2
ref: v2.0.0 # built from the tag v2.0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an example of a branch as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 67d6c50 — the example now shows a branch (release/v2) alongside the tag (v1.0.0).

```
</CodeBlock>

A version entry sets either `path` or `ref`, never both. Declaring both fails `fern check`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think u need to explicitly mention

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped in 67d6c50.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Tags and commit SHAs are immutable, so a published version stays byte-for-byte stable. Branch refs resolve to whatever commit the remote branch points at when you publish, which means a republish can change already-published content.

If the ref's own `docs.yml` is versioned, Fern builds its default version (the first entry in its `versions` list) and ignores the rest; otherwise it builds the ref's top-level `navigation`. Publishing requires git and access to the remote; shallow CI checkouts are backfilled with a targeted fetch. If a version's [library reference output](/learn/docs/api-references/library-reference) is missing at the ref, Fern warns and skips that section rather than failing the build.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shallow CI checkouts are backfilled with a targeted fetch. If a version's library reference output is missing at the ref, Fern warns and skips that section rather than failing the build.

^ not necessary to add

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed both in e87a1e3; the paragraph now ends at "Publishing requires git and access to the remote."

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

<CodeBlock title="docs.yml">
```yaml {5}
versions:
- display-name: Latest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'Latest' that become outdated

```yaml {5}
versions:
- display-name: Latest
path: ./versions/latest.yml # built from the working tree

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'latest' that become outdated

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants