Copilot commented on code in PR #39837:
URL: https://github.com/apache/superset/pull/39837#discussion_r3230616490


##########
docs/scripts/manage-versions.mjs:
##########
@@ -211,16 +368,19 @@ function removeVersion(section, version) {
 function printUsage() {
   console.log(`
 Usage:
-  node scripts/manage-versions.js add <section> <version>
+  node scripts/manage-versions.js add <section> <version> [--skip-generate]
   node scripts/manage-versions.js remove <section> <version>
 
 Where:
-  - section: 'docs', 'developer_portal', or 'components'
+  - section: 'docs', 'developer_docs', 'admin_docs', or 'components'
   - version: version string (e.g., '1.2.0', '2.0.0')
+  - --skip-generate: skip refreshing auto-generated docs before snapshotting
+                     (use when you've already placed a fresh databases.json
+                     from CI and want to preserve it)
 
 Examples:
   node scripts/manage-versions.js add docs 2.0.0
-  node scripts/manage-versions.js add developer_portal 1.3.0
+  node scripts/manage-versions.js add developer_docs 1.3.0
   node scripts/manage-versions.js remove components 1.0.0
 `);

Review Comment:
   `printUsage()` references `node scripts/manage-versions.js ...`, but the 
script is `manage-versions.mjs` (and package.json invokes the `.mjs` file). 
This makes the usage output misleading; update the printed commands/examples to 
use the correct filename/extension.



##########
docs/scripts/manage-versions.mjs:
##########
@@ -30,9 +30,11 @@ const __dirname = path.dirname(__filename);
 const CONFIG_FILE = path.join(__dirname, '..', 'versions-config.json');
 
 // Parse command line arguments
-const args = process.argv.slice(2);
+const rawArgs = process.argv.slice(2);
+const skipGenerate = rawArgs.includes('--skip-generate');
+const args = rawArgs.filter((a) => a !== '--skip-generate');
 const command = args[0]; // 'add' or 'remove'
-const section = args[1]; // 'docs', 'developer_portal', or 'components'
+const section = args[1]; // 'docs', 'developer_docs', or 'components'

Review Comment:
   The inline comment describing valid `section` values is now outdated: it 
omits `admin_docs`, which is supported elsewhere in this script and in the 
usage text. Please update the comment to reflect the full supported set to 
avoid confusion when maintaining the CLI parsing.
   



##########
docs/src/theme/DocVersionBadge/index.js:
##########
@@ -40,8 +40,8 @@ export default function DocVersionBadge() {
   const isVersioned = [
     'default',  // main docs
     'components',
-    'tutorials',
-    'developer_portal',
+    'admin_docs',
+    'developer_docs',
   ].includes(pluginId);

Review Comment:
   Now that `admin_docs` and `developer_docs` are treated as versioned, the URL 
parsing logic later in this component (it derives `basePath` as `/${pluginId}`) 
won't match their actual `routeBasePath` values (`/admin-docs` and 
`/developer-docs` in docusaurus.config.ts). This prevents preserving the 
current page when switching versions for those sections. Use the section's 
configured routeBasePath (or a mapping from pluginId -> routeBasePath) when 
computing `basePath`/splitting `pathname`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to