villebro opened a new pull request, #45897:
URL: https://github.com/apache/superset/pull/45897

   ### SUMMARY
   
   `docs/scripts/generate-api-index.mjs` and 
`docs/scripts/generate-api-tag-pages.mjs` link every endpoint to the page 
`docusaurus-openapi-docs` generates for it. They look the page slug up in the 
generated sidebar by label and fall back to a local `slugify` when the lookup 
misses. The plugin names pages with lodash `kebabCase(summary)`, which splits 
letter/digit boundaries, so "OAuth2" becomes `o-auth-2`; the local fallback 
lowercases and joins it as `oauth2`. For most summaries the two agree, which is 
why the fallback looked equivalent.
   
   The OAuth2 token endpoints added in #45676 are the first summaries where 
they differ. When the sidebar lookup misses (seen on Netlify deploy previews, 
e.g. #45404's), the API index and the Database tag page link to 
`/developer-docs/api/list-oauth2-credential-metadata-for-a-database` and two 
similar paths, while the generated pages are `list-o-auth-2-...`, and 
Docusaurus fails the build with "Docusaurus found broken links!".
   
   This makes the fallback use `lodash/kebabCase` (already a direct docs 
dependency), the same algorithm the plugin uses, so fallback links always match 
the generated pages.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable.
   
   ### TESTING INSTRUCTIONS
   
   - `node -e "console.log(require('lodash/kebabCase')('List OAuth2 credential 
metadata for a database'))"` prints 
`list-o-auth-2-credential-metadata-for-a-database`, the page name the plugin 
generates.
   - The docs deploy preview on this PR should build, and the API index's 
Database section should link to working OAuth2 token pages.
   - I couldn't run the full Docusaurus build locally, so the deploy preview is 
the real check.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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