Skip to content

Conversation

josh-wong
Copy link
Member

@josh-wong josh-wong commented Oct 6, 2025

Description

This PR upgrades Docusaurus (our static site generator) from version 3.7.0 to 3.9.1.

Aside from updating dependencies, the most significant change includes adding the new key attribute to items with the same label in the version sidebar navigation. For example, we use the same Reference label in multiple different places in the sidebar; but without adding a unique key attribute, errors occur when trying to build the site. Adding this attribute is necessary without the key attribute for those items that have the same label, Docusaurus 3.9 (and likely later unless this specification changes) will encounter errors during the build process.

As described in the Docusaurus blog post for 3.9: "In #11228, we added a new key attribute to the docs sidebar items, allowing to assign explicit translation keys to each sidebar item that use the same label and would otherwise lead to translation key conflicts."

To see how the site looks with Docusaurus 3.9, see the following staging site: https://68e35a1be3edf296d271c3f8--reliable-phoenix-b90994.netlify.app/docs/latest/

Related issues and/or PRs

N/A

Changes made

  • Dependency and configuration updates for upgrading from Docusaurus 3.7 to 3.9
    • Upgraded all Docusaurus-related dependencies and devDependencies from version 3.7.0 to 3.9.1 in package.json for improved stability and access to new features.
    • As suggested in the build output log and changed in this Docusaurus PR, moved the onBrokenMarkdownLinks: 'ignore' configuration from the root of docusaurus.config.js to the markdown.hooks section, and added onDuplicateRoutes: 'warn' to handle duplicate routes more gracefully.
    • Added colorMode to docusaurus.config.js to respect the user's light/dark theme preference set in their OS.
  • Addition of the key attribute in the sidebar navigation
    • Added unique key attributes to all sidebar navigation items that have the same label in all sidebar versions. This prevent duplicate route issues, which cause Docusaurus not to build in 3.9.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have updated the side navigation as necessary.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

The onBrokenMarkdownLinks option was removed from the root config and added under markdown.hooks to align with updated Docusaurus configuration structure. This change complies with a change made in Docusaurus 3.9: facebook/docusaurus#11283
When labels have duplicate names, the sidebar must contain a `key` attribute. Without these `key` attributes, Docusaurus 3.9 (and likely later unless this specification changes) will encounter errors during the build process.

As described in the Docusaurus blog post for 3.9: "In #11228, we added a new `key` attribute to the docs sidebar items, allowing to assign explicit translation keys to each sidebar item that use the same label and would otherwise lead to translation key conflicts."

Related Docusaurus PR: facebook/docusaurus#11228
@josh-wong josh-wong self-assigned this Oct 6, 2025
@josh-wong josh-wong added the improvement Improvements made to an existing feature label Oct 6, 2025
Copy link

Summary of Changes

Hello @josh-wong, 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 focuses on a significant infrastructure update by upgrading Docusaurus to version 3.9. The primary motivation for this upgrade is to resolve build issues related to duplicate sidebar labels, which required adding unique key attributes to numerous sidebar entries across multiple documentation versions and languages. Additionally, it includes general dependency updates and minor configuration changes to align with the new Docusaurus version.

Highlights

  • Docusaurus Upgrade: The Docusaurus static site generator has been upgraded from version 3.7 to 3.9, bringing stability improvements and access to new features.
  • Sidebar Key Attribute Addition: Unique key attributes have been added to all sidebar categories and documents in both English and Japanese documentation (specifically for version 3.16 and all versioned sidebars). This change is crucial for Docusaurus 3.9 to prevent build errors arising from duplicate labels in the navigation.
  • Configuration Adjustments: The docusaurus.config.js file was updated to move onBrokenMarkdownLinks: 'ignore' into the markdown.hooks section and add onDuplicateRoutes: 'warn' for more graceful handling of duplicate routes.
  • Dependency Updates: All Docusaurus-related dependencies and devDependencies in package.json have been updated from 3.7.0 to 3.9.1.
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.

@josh-wong josh-wong changed the title Upgrade to docusaurus 3.9 Upgrade Docusaurus from 3.7.0 to 3.9.1 Oct 6, 2025
@josh-wong josh-wong added the dependencies Pull requests that update a dependency file label Oct 6, 2025
Copy link

@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 effectively upgrades Docusaurus to version 3.9. The changes are comprehensive, covering dependency updates, configuration adjustments, and the necessary addition of unique key attributes to sidebar items across all versions to prevent build failures. The fixes for the Japanese documentation metadata and notification URL are also valuable improvements. I've found one minor issue with another URL in the notifications file that seems to have been overlooked. Otherwise, this is a solid update.

Comment on lines 32 to 33
en: 'requirements?RDBs=Db2#relational-databases?utm_source=docs-site&utm_medium=notifications',
ja: 'scalardb-cluster/getting-started-with-vector-search?RDBs=Db2#リレーショナルデータベース?utm_source=docs-site&utm_medium=notifications'
ja: 'scalardb-cluster/authorize-with-abac?utm_source=docs-site&utm_medium=notifications'

Choose a reason for hiding this comment

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

high

You've correctly fixed the malformed URL for the Japanese notification. That's a great catch! However, it looks like the English URL on the line above has a similar issue. It contains two ? characters, which makes the URL invalid. The fragment identifier (#relational-databases) should also be at the end of the URL.

To ensure the link works correctly for English-speaking users, it should be reformatted.

Suggested change
en: 'requirements?RDBs=Db2#relational-databases?utm_source=docs-site&utm_medium=notifications',
ja: 'scalardb-cluster/getting-started-with-vector-search?RDBs=Db2#リレーショナルデータベース?utm_source=docs-site&utm_medium=notifications'
ja: 'scalardb-cluster/authorize-with-abac?utm_source=docs-site&utm_medium=notifications'
en: 'requirements?RDBs=Db2&utm_source=docs-site&utm_medium=notifications#relational-databases',
ja: 'scalardb-cluster/authorize-with-abac?utm_source=docs-site&utm_medium=notifications'

@josh-wong josh-wong marked this pull request as draft October 6, 2025 06:34
Change as suggested by Gemini code review: #1564 (comment)
Added logic to create the output directory if it does not exist before writing the glossary JSON file. This prevents errors when the specified output path's directory is missing.
Bump Node.js version from `18` to `20` in deploy and test-deploy GitHub Actions workflows to ensure compatibility with the latest Node.js features and security updates. This is necessary because Docusaurus 3.9 drops support for Node.js 18: https://docusaurus.io/blog/releases/3.9#dropping-nodejs-18
Introduced a colorMode section in the Docusaurus config to set the default mode to light, enable the color mode switch, and respect the user's preferred color scheme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file improvement Improvements made to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant