[#2595] Added path-based documentation versioning with v1/v2 CI aggregation.#2601
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
WalkthroughCI workflows snapshot current docs as v1, fetch project/2.x content into the docs workspace, and set a versioned flag. Docusaurus config conditionally serves v1 at /docs and v2 at /docs/v2 with a dropdown and redirect. MDX imports use ChangesDocumentation Versioning System
sequenceDiagram
participant GitHubActions
participant DocusaurusCLI
participant GitOrigin
participant Workspace
GitHubActions->>DocusaurusCLI: yarn docusaurus docs:version 1.x
DocusaurusCLI->>Workspace: create versioned_docs (version-1.x)
GitHubActions->>GitOrigin: git fetch origin project/2.x
GitHubActions->>Workspace: remove .vortex/docs/content
GitHubActions->>GitOrigin: checkout .vortex/docs/content from project/2.x into workspace
GitHubActions->>GitHubActions: set DOCS_VERSIONED env flag
GitHubActions->>DocusaurusCLI: build documentation site
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 13-17: Update the README.md CI badges that currently target the
URL-encoded branch "project%2F2.x" to point to the repository's default branch
"main" (or add an explicit note that the badges intentionally track
"project/2.x"); specifically update the badge links for "Database, Build, Test
and Deploy", "CircleCI", "Test", "Test docs" and the codecov badge so their
branch query/path uses "main" instead of "project%2F2.x" to ensure the badges
reflect the default branch CI status.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8c128876-fa48-4c91-a5d2-cb1e6421643f
📒 Files selected for processing (7)
.github/workflows/vortex-release.yml.github/workflows/vortex-test-docs.yml.vortex/docs/content/contributing/code-of-conduct.mdx.vortex/docs/content/drupal/composer-json.mdx.vortex/docs/content/drupal/settings.mdx.vortex/docs/docusaurus.config.jsREADME.md
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2601 +/- ##
==========================================
- Coverage 86.56% 86.11% -0.46%
==========================================
Files 94 87 -7
Lines 4661 4502 -159
Branches 47 3 -44
==========================================
- Hits 4035 3877 -158
+ Misses 626 625 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
f493c1a to
5822353
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5822353 to
2d00138
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/vortex-release.yml:
- Around line 161-167: The Assemble versioned docs step deletes content before
verifying git operations; change the sequence so you first verify that git fetch
and checkout of origin/project/2.x succeed (e.g., perform git fetch origin
project/2.x --depth=1 and attempt git checkout origin/project/2.x --
.vortex/docs/content into a temporary location or test the checkout exit code),
and only run rm -rf content and replace it if those commands returned success;
ensure the step fails fast on fetch/checkout errors or uses an atomic move to
avoid leaving the repo without docs.
In @.github/workflows/vortex-test-docs.yml:
- Around line 97-101: The workflow currently runs destructive rm -rf content
before verifying git operations; update the step around git -C "${{
github.workspace }}" fetch origin project/2.x --depth=1 and git -C "${{
github.workspace }}" checkout origin/project/2.x -- .vortex/docs/content to fail
fast and only remove content after a successful fetch/checkout: either enable
shell errexit (set -e) for the run block or explicitly check the exit status of
the fetch and checkout commands, aborting (exit 1) if they fail, and move rm -rf
content to occur only after the checkout completes successfully so you never
delete content when the branch is missing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0d92404a-d208-4728-a7c6-b0a236316995
📒 Files selected for processing (6)
.github/workflows/vortex-release.yml.github/workflows/vortex-test-docs.yml.vortex/docs/content/contributing/code-of-conduct.mdx.vortex/docs/content/drupal/composer-json.mdx.vortex/docs/content/drupal/settings.mdx.vortex/docs/docusaurus.config.js
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a27f82723e9ce0687534b51--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
2d00138 to
28987bb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
28987bb to
574de24
Compare
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
|
Code coverage (threshold: 90%) Per-class coverage |
|
Code coverage (threshold: 90%) Per-class coverage |
Closes #2595
Summary
Added path-based documentation versioning to the Docusaurus site. Multi-version mode turns on automatically when a
versioned_docs/snapshot is present: v1 (a snapshot of the building branch's docs) is served at the bare/docsas the default, and v2 (pulled fromproject/2.x) is served at/docs/v2with anunreleasedbanner and a navbar version dropdown. A/docs/v1 -> /docsredirect keeps the explicit v1 path valid. With no snapshot - local development, per-branch preview builds, and thedocusaurus docs:versionrun that creates the snapshot - the site buildscontent/as a single unversioned set, so the config never references a version that does not exist yet.Three
.mdxfiles that import repo-root files were switched from depth-relative../../../../paths to the depth-independent@site/../..alias, so they still resolve whencontent/is relocated intoversioned_docs/during the CI assembly step.Both publish workflows gain a matching "Assemble versioned docs" step that snapshots the building branch's docs as
1.x, then fetches and swaps inproject/2.x's content as the current (v2) version before building.vortex-release.yml(production / GitHub Pages) runs it unconditionally;vortex-test-docs.yml(development / Netlify) runs it only onmain, so PR and feature-branch previews stay single-version. The step guards each git operation and verifies the branch exists before removing content, so a missing or failedproject/2.xfetch can never publish an empty docs site. The assembledversioned_docs/is gitignored and never committed.Changes
.vortex/docs/docusaurus.config.js- The multi-version config (theversionsblock with v1 aslastVersionat the bare/docs, v2 at pathv2with anunreleasedbanner, thedocsVersionDropdownnavbar item, and a/docs/v1 -> /docsclient redirect) is gated onfs.existsSync('versioned_docs'), so it applies only when the snapshot exists and produces no output otherwise..vortex/docs/content/contributing/code-of-conduct.mdx,.vortex/docs/content/drupal/composer-json.mdx,.vortex/docs/content/drupal/settings.mdx- Replaced depth-relative imports (../../../../) with the@site/../..alias so they remain valid when the file is copied intoversioned_docs/version-1.x/during CI assembly..github/workflows/vortex-release.ymland.github/workflows/vortex-test-docs.yml- Added a guarded "Assemble versioned docs" step before the build (docusaurus docs:version 1.x, then fetch + verifyorigin/project/2.xand swap its docs intocontent/). The release workflow runs it always; the test-docs workflow runs it only onmain. The build then auto-detects the assembled snapshot - no environment flag..vortex/docs/.gitignore- Ignoreversioned_docs/,versioned_sidebars/, andversions.json(assembled in CI for the published site, or locally to preview the multi-version build; never committed).Before / After
Summary by CodeRabbit
Documentation
Chores