Skip to content

feat: automate docs version snapshot during release#1111

Merged
chhoumann merged 2 commits intomasterfrom
1109-automate-docs-version-snapshot-+-lastversion-update-on-each-release
Feb 22, 2026
Merged

feat: automate docs version snapshot during release#1111
chhoumann merged 2 commits intomasterfrom
1109-automate-docs-version-snapshot-+-lastversion-update-on-each-release

Conversation

@chhoumann
Copy link
Copy Markdown
Owner

@chhoumann chhoumann commented Feb 22, 2026

Summary

  • add a semantic-release prepare hook that snapshots docs for stable releases
  • add a stable-only docs versioning script with idempotent behavior when snapshot already exists
  • derive docs lastVersion dynamically from docs/versions.json
  • include docs version artifacts in release commit assets
  • install docs dependencies in release workflow and include docs lockfile in cache key

Closes #1109

Summary by CodeRabbit

  • New Features

    • Automated documentation versioning: releases now create and manage versioned docs so stable release docs are snapshot and served automatically.
  • Chores

    • CI/CD improvements: dependency installation extended to include the docs workspace and dependency caching updated to reduce rebuilds and speed releases.

@chhoumann chhoumann linked an issue Feb 22, 2026 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quickadd Ready Ready Preview Feb 22, 2026 0:15am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 22, 2026

📝 Walkthrough

Walkthrough

Automates docs versioning in the release prepare phase: adds a semantic-release plugin and an ES module script that snapshot docs for stable releases, updates docs config to use versions.json, expands release assets, and updates CI to install and cache docs dependencies.

Changes

Cohort / File(s) Summary
Release plugin & script
scripts/release/docs-versioning-plugin.cjs, scripts/release/version-docs.mjs
Adds a semantic-release prepare plugin that validates nextRelease.version, skips prereleases, and invokes a script which runs cd docs && bun run docusaurus docs:version <version> when needed; includes logging and error propagation.
Docs configuration
docs/docusaurus.config.js
Replaces hardcoded lastVersion and static version entry with dynamic values derived from docs/versions.json (latestStableVersion) and conditionally spreads lastVersion and a dynamic versions entry.
Release config
package.json
Registers ./scripts/release/docs-versioning-plugin.cjs in release.plugins and adds documentation artifacts to the @semantic-release/git assets (docs/versions.json, docs/versioned_docs/**/*, docs/versioned_sidebars/*.json).
CI workflow
.github/workflows/release.yml
Extends Bun cache key to include docs/bun.lock and adds a step to install dependencies in docs (cd docs && bun install) during the release workflow.

Sequence Diagram

sequenceDiagram
    participant SR as "semantic-release"
    participant PL as "docs-versioning-plugin"
    participant VD as "version-docs.mjs"
    participant Bun as "Bun / Docusaurus"
    participant Git as "Git (release commit)"

    SR->>PL: prepare(nextRelease.version)
    PL->>PL: validate semantic X.Y.Z
    alt prerelease
        PL-->>SR: skip docs snapshot
    else stable
        PL->>VD: spawn with version arg
        VD->>VD: check versions.json & snapshot exists?
        alt snapshot exists
            VD-->>PL: skip (already versioned)
        else snapshot missing
            VD->>Bun: cd docs && bun run docusaurus docs:version <version>
            Bun-->>VD: generate versioned_docs & sidebars
            VD->>VD: ensure docs/docusaurus.config.js updated (lastVersion, versions entry)
            VD-->>PL: success
        end
        PL-->>SR: prepare complete
    end
    SR->>Git: commit docs artifacts + config updates
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I hopped through release scripts today,
Bun and Docusaurus showed the way,
Snapshotted verses, set the lastVersion true,
Now docs and releases dance in view — hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: automating documentation version snapshots during the release process.
Linked Issues check ✅ Passed The PR implements all key requirements from issue #1109: automated docs versioning via semantic-release, dynamic lastVersion configuration, docs artifact inclusion in release commits, and docs dependency installation in CI workflow.
Out of Scope Changes check ✅ Passed All changes directly support the objective of automating docs versioning during release; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 1109-automate-docs-version-snapshot-+-lastversion-update-on-each-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 22, 2026

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: e4979a2
Status: ✅  Deploy successful!
Preview URL: https://4fa9bc04.quickadd.pages.dev
Branch Preview URL: https://1109-automate-docs-version-s.quickadd.pages.dev

View logs

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
docs/docusaurus.config.js (1)

8-13: Redundant docsVersions = [] in the catch block.

Because docsVersions is already initialised to [] on line 8 and require only reassigns it on success, the catch assignment is a no-op — the value never changed from the initial [].

♻️ Proposed simplification
 let docsVersions = [];
 try {
   docsVersions = require('./versions.json');
-} catch {
-  docsVersions = [];
-}
+} catch { /* versions.json absent (pre-first-release); keep [] */ }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/docusaurus.config.js` around lines 8 - 13, The variable docsVersions is
pre-initialized to [] and the catch block redundantly reassigns docsVersions =
[]; remove the redundant assignment inside the catch so the try/catch simply
attempts to set docsVersions = require('./versions.json') and silently falls
back to the pre-initialized value if require throws; update the catch to be
empty (or optionally add a brief comment) and leave the symbols docsVersions and
require('./versions.json') as the markers to locate the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/docusaurus.config.js`:
- Around line 8-13: The variable docsVersions is pre-initialized to [] and the
catch block redundantly reassigns docsVersions = []; remove the redundant
assignment inside the catch so the try/catch simply attempts to set docsVersions
= require('./versions.json') and silently falls back to the pre-initialized
value if require throws; update the catch to be empty (or optionally add a brief
comment) and leave the symbols docsVersions and require('./versions.json') as
the markers to locate the change.

@chhoumann chhoumann merged commit 1571846 into master Feb 22, 2026
5 checks passed
@chhoumann chhoumann deleted the 1109-automate-docs-version-snapshot-+-lastversion-update-on-each-release branch February 22, 2026 12:22
github-actions Bot pushed a commit that referenced this pull request Mar 5, 2026
# [2.12.0](2.11.0...2.12.0) (2026-03-05)

### Bug Fixes

* **capture:** preserve canvas tab indentation on configured writes ([#1125](#1125)) ([0a1578e](0a1578e))
* disallow capture targets with .base extension ([cb39ed4](cb39ed4))
* **field-suggestions:** opt-in inline values from fenced code blocks ([#1128](#1128)) ([8597905](8597905))
* **gui:** preserve modal edit position during settings reload ([#1132](#1132)) ([11bda19](11bda19))
* **gui:** reduce ai settings modal reload churn ([#1134](#1134)) ([ae0f7a1](ae0f7a1))
* **gui:** reduce choice builder reload churn ([#1136](#1136)) ([818272a](818272a))
* **gui:** reduce macro settings modal reload churn ([#1135](#1135)) ([a1a6271](a1a6271))
* harden existing-tab matching and document issue workflow ([#1108](#1108)) ([7b12d3b](7b12d3b))
* make template path resolution deterministic ([3297d54](3297d54))
* normalize capture title for non-markdown targets ([964d672](964d672))
* preserve capture-format spacing for insert-at-end ([#1119](#1119)) ([8bb8ed4](8bb8ed4))
* preserve explicit capture target file extensions ([57e43ff](57e43ff))
* preserve insert-at-end order for non-newline captures ([#1120](#1120)) ([e7cbbf2](e7cbbf2))
* resolve template file-name paths without duplicate default folder ([7bfd41b](7bfd41b))
* resolve vault-relative template paths using root folders ([81216de](81216de))

### Features

* add AI request logging API and reduce assistant log noise ([#1110](#1110)) ([2c36800](2c36800))
* automate docs version snapshot during release ([#1111](#1111)) ([1571846](1571846))
* **capture:** fully support capture into canvas cards ([#1124](#1124)) ([a53f889](a53f889))
* **cli:** add native QuickAdd Obsidian CLI handlers ([#1129](#1129)) ([8102d47](8102d47))
* **format:** support mapped VALUE suggester display text ([#1127](#1127)) ([b8ec56c](b8ec56c))
* **macro:** add editor cursor navigation commands ([101d5f6](101d5f6))
* support .base template files for template choices ([11e6490](11e6490))

### Reverts

* **gui:** remove modal reload refactor series ([#1137](#1137)) ([3ba1a73](3ba1a73)), closes [#1136](#1136) [#1135](#1135) [#1134](#1134) [#1133](#1133) [#1132](#1132)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

🎉 This PR is included in version 2.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate docs version snapshot + lastVersion update on each release

1 participant