Skip to content

fix(ci): Preserve developer docs source-map API route - #19733

Open
sansynx wants to merge 4 commits into
getsentry:masterfrom
sansynx:fix/developer-source-map-redirect
Open

sansynx wants to merge 4 commits into
getsentry:masterfrom
sansynx:fix/developer-source-map-redirect

Conversation

@sansynx

@sansynx sansynx commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Fixes #19514. Follow-up to #19526, which already fixed cross-site link handling.

The developer docs redirect from /api/:path* to /backend/api/:path* also intercepts /api/source-map. The checker follows that redirect and receives HTML instead of JSON. Exclude the exact source-map endpoint from this legacy documentation redirect while preserving the other API documentation redirects.

Regression tests run the redirect definitions through Next.js routing for both docs sites, and cover legacy API paths, query strings, and similarly named paths.

Validation:

  • pnpm exec vitest run redirects.test.ts scripts/lint-404s/url.spec.ts scripts/lint-redirect-chains.spec.ts scripts/check-redirects-on-rename.spec.ts: 68 passed. The two developer source-map cases failed before the fix.
  • pnpm exec eslint redirects.js redirects.test.ts: passed.
  • pnpm exec prettier --check redirects.js redirects.test.ts and git diff --check: passed.
  • Local developer-docs server: /api/source-map/ changed from a 308 redirect to HTTP 200 with application/json and 315 source-map entries.

No full production build, full-site crawl, or Vercel preview verification was performed. Implementation and tests were AI-assisted, with a separate code review.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace YYYY-MM-DD with the due date. You can update this information later by editing the PR description.

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

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've supplied a deadline.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • 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

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

Copilot AI balanced review requested due to automatic review settings September 30, 2026 12:33
@vercel

vercel Bot commented Sep 30, 2026

Copy link
Copy Markdown

@sansynx is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the Priority: Normal Docs review has no urgent deadline label Sep 30, 2026
@codeowner-assignment
codeowner-assignment Bot requested a review from a team September 30, 2026 12:34
@cursor

cursor Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

The plan checks that the source-map API returns JSON. It also checks that other API documentation redirects still occur. Page errors and not-found responses must stay in band. An issue escalates when the source-map API still returns HTML or when other API redirects stop.

Services: develop-docs.

Mention @change-monitor in a comment to update the plan.

Plan

What changed

GET requests to /api/source-map now reach the JSON route. They no longer redirect to /backend/api/source-map.
The develop-docs service must deploy before this change is live.

Risk

A wrong path matcher can still send /api/source-map to /backend/api/source-map. A matcher that is too wide can stop redirects for other /api URLs. Those requests would then 404 or hit a JSON handler by mistake. Broken redirects affect every request on this deploy.

Intended effect

The source-map route must return JSON with status 200. Absence looks like this: GET /api/source-map spans stay at zero, and fetches still land on HTML for /backend/api/source-map.

Signal Baseline Rule Source
GET /api/source-map spans 0 spans in 2026-09-23T12:34:45Z to 2026-09-30T12:34:45Z Rise above zero with status 200. Absent if still zero and HTML remains Sentry project develop-docs, spans, query has:http.url AND http.url:*api/source-map*
/api/source-map returns HTML instead of JSON Live GET follows a redirect to 404 HTML at /backend/api/source-map at 2026-09-30T12:34:45Z HTML must stay at zero. The route must return JSON 200 Fixes issues/19514

Regression watch

This diff can break other /api documentation redirects. It can also raise page errors if the matcher fails to load.

Signal Baseline Rule Source
Spans whose URL contains /backend/api middleware GET 2200, /:path*? 517, GET develop.sentry.dev 77, total 2795 in 2026-09-23T12:34:45Z to 2026-09-30T12:34:45Z. Catch-all share 18-19% (517/2795) Hold that volume and share. Escalate if total falls near zero Sentry project develop-docs, spans, query has:http.url http.url:*backend/api*
Error events Sampled hours 0-5 events/hour. 46 events in 2026-09-29T12:34:45Z to 2026-09-30T12:34:45Z. 275 events in 2026-09-23T12:34:45Z to 2026-09-30T12:34:45Z Hold 0-5 events/hour. Escalate when hours stay above 5 Sentry project develop-docs, errors, empty query, count per hour
http.server status mix 13 404 and 49 200, 404 share 21%, 0 5xx in 2026-09-29T12:34:45Z to 2026-09-30T12:34:45Z 404 share must not rise above 21%. 5xx must stay at zero Sentry project develop-docs, spans, query span.op:http.server has:http.status_code
Pageload and navigation spans pageload 1000, navigation 1400 in 2026-09-29T12:34:45Z to 2026-09-30T12:34:45Z Hold this volume. Escalate if both fall sharply Sentry project develop-docs, spans, query span.op:pageload OR span.op:navigation

Not observable

GitHub Actions lint-404 output is not connected. The JSON body shape is not in traces. Confirm JSON through status 200 on GET /api/source-map.

@sansynx

sansynx commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

the branch is up to date. could you approve the pending workflows and authorize the Vercel preview when you review this?

This branch has not been deployed

No deployments
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.

lint-404 fails for develop-docs builds with false-positive docs.sentry.io links

2 participants