Skip to content

feat: add multi-version documentation support#116

Merged
emjay0921 merged 4 commits intostablefrom
feat/multiversion-docs
Feb 4, 2026
Merged

feat: add multi-version documentation support#116
emjay0921 merged 4 commits intostablefrom
feat/multiversion-docs

Conversation

@emjay0921
Copy link
Contributor

@emjay0921 emjay0921 commented Feb 4, 2026

Summary

  • Add new CI workflow (build_deploy_multiversion.yml) for building and deploying multi-version documentation
  • Fix version_switcher.js regex to properly handle version paths
  • Update switcher.json with correct version URLs for production
  • Modify old workflow to handle previews only (stable handled by new workflow)

How it works

The new workflow builds two versions:

  • v1.3 (stable) from stable branch -> deployed to root /
  • v2.0 (preview) from v2-odoo19-doc-refresh branch -> deployed to /v2.0/

Changes

File Change
.github/workflows/build_deploy_multiversion.yml New workflow for multi-version builds
.github/workflows/build_deploy.yml Now handles previews only (skips stable)
docs/_static/version_switcher.js Fixed regex /^\/v?[0-9.]+\// to handle version paths
docs/_static/switcher.json Updated URLs for v1.3 (root) and v2.0 (/v2.0/)

GitHub Actions Compatibility

This workflow uses only GitHub-owned actions and native commands:

  • actions/checkout@v3 - GitHub-owned
  • actions/setup-python@v4 - GitHub-owned
  • graphviz installed via apt-get (replaces ts-graphviz/setup-graphviz@v1)
  • Deployment via git commands (replaces peaceiris/actions-gh-pages@v3)

This approach avoids the organization's policy that blocks third-party actions.

Test plan

  • Tested locally using manual build approach
  • Updated workflow to use GitHub-owned actions only
  • Verify workflow runs successfully after merge to stable

- Add new workflow for building v2.0 (root) and v1.3 (/v1.3/)
- Fix version_switcher.js regex to handle /v1.3/ paths
- Update switcher.json with correct version URLs

This enables deploying both documentation versions:
- v2.0 (latest) from v2-odoo19-doc-refresh branch at /
- v1.3 from stable branch at /v1.3/
- Disable csvlexer import in stable build (not in requirements)
- Save version_switcher.js from stable before switching branches
- Update old workflow to skip stable (now handled by multiversion)
- Remove stable-specific code from old workflow (previews only)
- Remove ts-graphviz/setup-graphviz@v1, install graphviz via apt-get
- Replace peaceiris/actions-gh-pages@v3 with git commands
- Preserves preview deployments when deploying to cf-pages branch
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @emjay0921, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for multi-version documentation, enhancing the project's ability to maintain and deploy different documentation versions simultaneously. It refines the documentation build and deployment process through a new, policy-compliant CI workflow, updates version configuration, and improves the client-side version switching logic.

Highlights

  • Multi-version Documentation CI: A new CI workflow (build_deploy_multiversion.yml) has been introduced to support building and deploying multiple versions of the documentation.
  • Version Switcher Regex Fix: The version_switcher.js file has been updated with a refined regular expression to correctly parse paths like /v1.3/, ensuring proper version switching.
  • Documentation Version Configuration: The switcher.json file now contains updated version names and URLs, mapping "2.0 (latest)" to the root and "1.3" to /v1.3/.
  • Streamlined Preview Workflow: The existing build_deploy.yml workflow has been adjusted to focus solely on building documentation previews, with stable deployments now handled by the new multi-version workflow.
  • GitHub Actions Compatibility: The new workflow exclusively uses GitHub-owned actions and native commands, aligning with organizational policy against third-party actions.
Changelog
  • .github/workflows/build_deploy.yml
    • Modified to exclusively handle documentation previews.
    • Stable documentation deployments are now managed by the new build_deploy_multiversion.yml workflow.
  • .github/workflows/build_deploy_multiversion.yml
    • New workflow added to build and deploy multi-version documentation (v2.0 and v1.3).
    • Configured to deploy v2.0 (latest) from v2-odoo19-doc-refresh to the root (/).
    • Configured to deploy v1.3 from stable to /v1.3/.
    • Uses only GitHub-owned actions and native commands to comply with organizational policy.
  • docs/_static/switcher.json
    • Updated the "stable (latest)" entry to "2.0 (latest)" with version: "2.0".
    • Modified the URL for version "1.3" from https://docs.openspp.org/1.3/ to https://docs.openspp.org/v1.3/.
  • docs/_static/version_switcher.js
    • Updated the regular expression currentPath.replace(/^\/[0-9.]+\//, '/') to currentPath.replace(/^\/v?[0-9.]+\//, '/').
    • This change allows the version switcher to correctly handle paths that include an optional 'v' prefix, such as /v1.3/.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/build_deploy.yml
    • .github/workflows/build_deploy_multiversion.yml
Activity
  • Pull request created by emjay0921 to add multi-version documentation support.
  • Author performed local testing using a manual build approach.
  • Workflow was updated to exclusively use GitHub-owned actions for compliance.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for multi-version documentation by introducing a new workflow and updating the version switcher logic. The changes to switcher.json correctly configure the new version names and URLs. The updated regular expression in version_switcher.js properly handles versioned paths. My review includes one suggestion to refactor the JavaScript code for better conciseness and efficiency. Overall, the changes are well-described and correctly implemented.

Comment on lines +34 to +35
// This regex matches /v1.3/ or /1.3/ patterns at the start (with optional 'v' prefix)
currentPath = currentPath.replace(/^\/v?[0-9.]+\//, '/');
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While these changes are correct, the two consecutive replace calls can be combined into a single, more efficient operation. This would make the code more concise by grouping the path-cleaning logic for both previews and versioned paths.

You could combine the logic into a single replace call using a regular expression like:

currentPath = currentPath.replace(/^\/(previews\/[^\/]+|v?[0-9.]+)\//, '/');

- v1.3 (stable) now deployed to root /
- v2.0 (preview) now deployed to /v2.0/
- Updated switcher.json with correct URLs
@emjay0921 emjay0921 merged commit 2ed85ff into stable Feb 4, 2026
1 check passed
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

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.

1 participant