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

   ### SUMMARY
   
   Tightens `onBrokenLinks: 'warn'` → `'throw'` so the docs build fails on any 
broken internal route, and fixes everything that fell out.
   
   Three classes of issue surfaced and got fixed:
   
   **1. Bare-relative MDX links — the SPA-nav broken-flow** (the 
"/extensions/overview/mcp" 404 a user reported)
   
   Markdown links like `[Label](./mcp)` (no `.md`/`.mdx` extension) render an 
absolute href in SSR HTML, so static crawlers (and `curl`) see the correct 
link. **But** React Router's `<Link>` component on the client side resolves the 
bare path relative to the current URL on click — so when the page URL has a 
trailing slash (`/extensions/overview/`), `./mcp` resolves to 
`/extensions/overview/mcp` (404). Added the file extension to all 44 such links 
across 17 files; this lets Docusaurus's MDX loader resolve them to the 
canonical doc URL at the `<Link>` level, so SPA navigation works regardless of 
trailing slash.
   
   This is what was breaking the "Next Steps" bullets on 
`/developer-docs/extensions/overview/`.
   
   **2. Stale `/docs/...` references in the 6.0.0 versioned snapshot**
   
   The user-facing docs section was renamed `docs` → `user-docs` 
(routeBasePath) at some point after 6.0.0 was cut, but the snapshot's links 
still pointed at the old prefix. The live site redirects `/docs/*` → 
`/user-docs/*` at runtime, but Docusaurus's `onBrokenLinks` checker doesn't 
honor redirect routes. Bulk-rewrote `/docs/*` → `/user-docs/*` across the 
snapshot (and one `/docs/api` → `/developer-docs/api`).
   
   **3. Miscellaneous content fixes**
   
   - 4 `/configuration/feature-flags` references in the 6.0.0 snapshot pointed 
at a page that doesn't exist in that version (the dedicated feature-flags page 
was added later). Repointed to the `#feature-flags` anchor inside 
`configuring-superset.mdx`.
   - 3 references to `superset-core/src/superset_core/rest_api/decorators.py` 
in extensions docs were rendered as relative URLs, resolving to 
`/developer-docs/extensions/superset-core/...` (404). Converted to absolute 
GitHub URLs.
   - 1 `/storybook/?path=...` link in `extensions/components/index.mdx` pointed 
at a non-existent `/storybook` route. Repointed to the existing 
`/developer-docs/testing/storybook` page that explains how to run Storybook 
locally.
   - 4 unclosed-paren markdown links in 
`6.0.0/installation/installation-methods.mdx` (pre-existing source bugs the 
strict checker exposed).
   
   ### Follow-up
   
   `onBrokenAnchors` is still `'warn'` (default). The build currently surfaces 
~60 instances of `/community#superset-community-calendar` (the anchor IS 
defined in `docs/src/pages/community.tsx` via `<BlurredSection id="...">` but 
Docusaurus's anchor checker doesn't seem to discover it on the custom React 
page). Worth a separate PR to tighten that and figure out the anchor detection.
   
   Doesn't address the broader question of catching stale **deployed** links 
(Algolia stale index, external link rot) — that'd be a periodic CI check 
against the live site, separate scope.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd docs
   yarn install
   yarn build
   ```
   
   Build should succeed. Visit `/developer-docs/extensions/overview/` (with 
trailing slash) locally via `yarn serve` and click the "MCP Integration" bullet 
— it should navigate to `/developer-docs/extensions/mcp` (not 
`/developer-docs/extensions/overview/mcp`).
   
   ### 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