Skip to content

feat(md-exports): Improve soft-404 recovery for agent .md requests - #20608

Merged
BYK merged 1 commit into
masterfrom
feat/md-soft-404-recovery
Nov 6, 2026
Merged

BYK merged 1 commit into
masterfrom
feat/md-soft-404-recovery

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

This revives most of #18953 by @sergical, which the stale bot closed. It's rebased on current master, and @sergical is credited as co-author on the commit. When an agent requests a .md page that has no export, the response now explains why:

  • /platform-redirect.md (the most-missed path) now serves guidance from md-overrides/platform-redirect.mdx on building /platforms/<platform>/<page>.md URLs directly. /platform-redirect/ is a dynamic route with no static HTML, so the override was never emitted in feat(md-exports): Improve soft-404 recovery for agent .md requests #18953 (Bugbot's finding). A new standalone: true override frontmatter flag lets generate-md-exports emit an override without a matching HTML page. Overrides without the flag still get the "did not match any HTML file" warning, so typos are still caught.
  • Pages that exist but whose export is missing get a "Markdown Export Unavailable" body that links to the HTML page and the page's children, with a 60s cache. Synthetic doctree nodes (missing: true) only fill gaps in the hierarchy, so they keep the generic "Page Not Found" response. This fixes Bugbot's second finding.
  • docs.md_export.not_found gains an outcome attribute (page_exists | unknown_path).

Dropped: the "Page Moved" response for redirected paths, together with its middleware.ts exports and redirect-table lookup. #20336 already makes .md requests for moved pages follow the redirect map with a 308, for example /ai/mcp.md → mcp.sentry.dev. Two different answers for the same request would conflict.

The response keeps its 200 status, the X-Sentry-Docs-Not-Found: 1 header and noindex. getsentry/toolkit#2051 relies on that header to detect these misses.

I updated the route tests: I removed the redirect cases and added one for synthetic nodes. vitest passes (527 tests), and ESLint and Prettier are clean on the changed files. generate-md-exports.mjs runs on import, so the standalone branch has no unit test. Checking /platform-redirect.md on the Vercel preview will verify it.

IS YOUR CHANGE URGENT?

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

via @BYK.

--

View Session [Sentry]

Revives the non-redirect parts of #18953.

- Add md-overrides/platform-redirect.mdx so the platform chooser exports
  guidance on building platform URLs directly. /platform-redirect/ is a
  dynamic route with no static HTML, so a new `standalone` override flag
  lets generate-md-exports emit it without a matching page.
- Serve "Markdown Export Unavailable" for pages that are in the doctree
  but whose export is missing, with a 60s cache. Synthetic `missing`
  doctree nodes are not real pages and keep the not-found response.
- Tag docs.md_export.not_found with outcome (page_exists | unknown_path).

The "Page Moved" response for redirected paths is dropped; #20336
redirects .md requests for moved pages instead.

Co-Authored-By: Burak Yigit Kaya <[email protected]>
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
develop-docs Ready Ready Preview Nov 6, 2026 7:23pm UTC
sentry-docs Ready Ready Preview Nov 6, 2026 7:23pm UTC

Request Review

@cursor

cursor Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Getting ready to monitor this change · Rollout details

Status Service Environment
⏳ Getting ready to monitor this change

@BYK
BYK enabled auto-merge (squash) November 6, 2026 19:21
@BYK
BYK merged commit fe1ee3d into master Nov 6, 2026
27 checks passed
@BYK
BYK deleted the feat/md-soft-404-recovery branch November 6, 2026 19:24

This branch was successfully deployed

2 active deployments
Preview – sentry-docs — 76d08e4e Deployed Nov 6, 2026 by vercel[bot]
Preview – develop-docs — 76d08e4e Deployed Nov 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant