Skip to content

feat: add multi-version documentation support#113

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

feat: add multi-version documentation support#113
emjay0921 merged 2 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 /v1.3/ paths (with 'v' prefix)
  • 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:

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

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 /v1.3/
docs/_static/switcher.json Updated URLs for v2.0 (root) and v1.3 (/v1.3/)

Issues Addressed

  • Old workflow now skips stable branch (prevents conflict)
  • csvlexer import disabled via sed before v1.3 build (not in requirements)
  • version_switcher.js saved from stable before switching branches (ensures regex fix is used)
  • Removed stable-specific code from old workflow

Test plan

  • Review workflow logic
  • Verify version switcher URLs are correct
  • Test locally using manual build approach (tested successfully)
  • After merge, verify both versions deploy correctly

- 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/
@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. It establishes a new CI/CD pipeline to build and deploy different documentation versions to distinct URL paths, ensuring that users can access both the latest and older stable versions. Concurrently, it updates the client-side version switching mechanism to accurately navigate these new versioned paths, providing a seamless user experience.

Highlights

  • Multi-version Documentation CI: A new GitHub Actions workflow (build_deploy_multiversion.yml) has been introduced to automate the building and deployment of multiple documentation versions.
  • Version Switcher Logic: The docs/_static/version_switcher.js script has been updated with a refined regular expression to correctly parse and handle documentation paths that include an optional 'v' prefix (e.g., /v1.3/).
  • Documentation Version Configuration: The docs/_static/switcher.json file has been modified to reflect the new documentation versions, specifically mapping "2.0 (latest)" to the root URL and "1.3" to the /v1.3/ path.
Changelog
  • .github/workflows/build_deploy_multiversion.yml
    • Added a new GitHub Actions workflow to build and deploy multi-version documentation.
    • Configured to deploy 'v2.0 (latest)' from the 'v2-odoo19-doc-refresh' branch to the root ('/') and 'v1.3' from the 'stable' branch to '/v1.3/'.
  • docs/_static/switcher.json
    • Updated the 'stable (latest)' entry to '2.0 (latest)' with version: "2.0".
    • Changed 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
    • Modified the regex ^/[0-9.]+ to ^/v?[0-9.]+ to correctly identify and remove version prefixes in URLs, including those with an optional 'v' (e.g., /v1.3/).
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build_deploy_multiversion.yml
Activity
  • The author has provided a detailed summary of changes, how the new multi-version documentation works, and a test plan.
  • Notes were included regarding the eventual disabling or removal of the old build_deploy.yml workflow.
  • No other human activity (comments, reviews) has been recorded yet.
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. The changes in switcher.json correctly update the version information, and the modification in version_switcher.js properly handles the new v-prefixed URL paths. I have one suggestion to make a regular expression in the JavaScript file more robust. Otherwise, the changes look solid and well-aligned with the goal of the pull request.

// This regex matches /version-number/ patterns at the start
currentPath = currentPath.replace(/^\/[0-9.]+\//, '/');
// 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

The regex [0-9.]+ is a bit too broad and could match invalid version strings like 1..3 or .3. This could lead to unexpected behavior with malformed URLs. Consider making the pattern more specific to only match valid version number formats. For example, a pattern like \d+(\.\d+)* would be more robust, as it ensures the pattern is composed of digits separated by single dots.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on February 17

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

"name": "stable (latest)",
"version": "stable",
"name": "2.0 (latest)",
"version": "2.0",
Copy link

Choose a reason for hiding this comment

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

Version detection returns wrong default breaking dropdown selection

Medium Severity

The switcher.json version value changed from "stable" to "2.0", but the getCurrentVersion() function in version_switcher.js still returns 'stable' as its default fallback. Since the version comparison on line 12 checks v.version === getCurrentVersion(), the dropdown will never show the correct version as selected when the title parsing fails, because 'stable' won't match "2.0" or "1.3".

Fix in Cursor Fix in Web

- 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)
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

@emjay0921 emjay0921 merged commit a65cd7d into stable Feb 4, 2026
3 of 4 checks passed
emjay0921 added a commit that referenced this pull request 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