feat: add multi-version documentation support#113
Conversation
- 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/
Summary of ChangesHello @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
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.]+\//, '/'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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".
- 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)
|




Summary
build_deploy_multiversion.yml) for building and deploying multi-version documentationversion_switcher.jsregex to properly handle/v1.3/paths (with 'v' prefix)switcher.jsonwith correct version URLs for productionHow it works
The new workflow builds two versions:
v2-odoo19-doc-refreshbranch → deployed to root/stablebranch → deployed to/v1.3/Changes
.github/workflows/build_deploy_multiversion.yml.github/workflows/build_deploy.ymldocs/_static/version_switcher.js/^\/v?[0-9.]+\//to handle/v1.3/docs/_static/switcher.jsonIssues Addressed
stablebranch (prevents conflict)sedbefore v1.3 build (not in requirements)version_switcher.jssaved from stable before switching branches (ensures regex fix is used)Test plan