Skip to content

Comments

fix(): further validate 404 reports#7543

Merged
mhartington merged 2 commits intomainfrom
404-reports
Feb 23, 2026
Merged

fix(): further validate 404 reports#7543
mhartington merged 2 commits intomainfrom
404-reports

Conversation

@mhartington
Copy link
Member

@mhartington mhartington commented Feb 21, 2026

Summary by CodeRabbit

  • Chores

    • Reformatted redirect entries for consistency; removed one image redirect mapping
    • Added an external-link linting task and script to catch broken links
  • Documentation

    • Updated several troubleshooting and integration links to the new issue tracker
    • Removed the Fig subsection from the editor setup guidance

@vercel
Copy link

vercel bot commented Feb 21, 2026

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

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Feb 23, 2026 1:44pm
docs Ready Ready Preview, Comment Feb 23, 2026 1:44pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

Walkthrough

Reformats Vercel redirects (mostly stylistic) and removes one redirect. Updates several docs links (switches issue links to prisma/web), removes Fig subsection from editor-setup pages, and adds a new external link linter script plus npm/turbo scripts to run it.

Changes

Cohort / File(s) Summary
Vercel config
apps/docs/vercel.json
Reformatted many redirect entries from single-line to expanded objects; removed one redirect for /docs/img/guides/prisma-bun-cover-image.png. Mostly structural/formatting changes; verify removed mapping is intentional.
Docs — issue link updates
apps/docs/content/docs.v6/(index)/prisma-orm/add-to-existing-project/mongodb.mdx, apps/docs/content/docs.v6/(index)/prisma-orm/quickstart/mongodb.mdx, apps/docs/content/docs.v6/orm/prisma-client/.../databases-connections/index.mdx, apps/docs/content/docs.v6/orm/more/ai-tools/chatgpt.mdx, apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mongodb.mdx, apps/docs/content/docs/(index)/prisma-orm/quickstart/mongodb.mdx, apps/docs/content/docs/ai/tools/chatgpt.mdx
Replaced several references to the docs issue tracker with links to the web issue tracker (URL changes only).
Docs — Fig subsection removals
apps/docs/content/docs.v6/orm/more/dev-environment/editor-setup.mdx, apps/docs/content/docs/orm/more/dev-environment/editor-setup.mdx
Removed the "Fig" subsection and its brew install snippet; left the inshellisense content. Review to ensure no missing cross-references.
Lint script & runner changes
apps/docs/scripts/lint-external-links.ts, apps/docs/package.json, package.json, turbo.json
Added a new TypeScript script to find and validate external links in docs, added lint:external-links npm scripts in both app and repo package.json, and registered the task in turbo.json. Inspect timeouts, concurrency defaults, and exit-code behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix(): further validate 404 reports' is vague and doesn't clearly convey what was actually changed in the changeset. Clarify the title to reflect the actual primary changes: either focus on the link validation script being added, the redirect updates in vercel.json, or the documentation URL changes being made across multiple files.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2026

🍈 Lychee Link Check Report

3664 links: ✅ 2996 OK | 🚫 2 errors | 🔀 0 redirects | 👻 664 excluded

❌ Errors

./apps/docs/content/docs.v6/guides/vercel-app-deployment.mdx

./apps/docs/content/docs/guides/integrations/vercel-deployment.mdx


Full Statistics Table
Status Count
✅ Successful 2996
🔀 Redirected 0
👻 Excluded 664
🚫 Errors 2
⛔ Unsupported 2
⏳ Timeouts 0
❓ Unknown 0

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 21, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
apps/docs/scripts/lint-external-links.ts (3)

28-28: MARKDOWN_IMAGE_REGEX is defined but never used — dead code.

The constant is declared and its lastIndex is reset in collectFileLinks (line 126), but it's never passed to a while((match = ...) !== null) exec loop. Image links are already excluded by (a) the (?<!!) negative lookbehind in MARKDOWN_LINK_REGEX and (b) the isImageUrl() guard inside each loop. The definition and the lastIndex reset can both be removed.

🧹 Proposed cleanup
-const MARKDOWN_IMAGE_REGEX = /!\[[^\]]*]\(([^)\n]+)\)/g;
 const MARKDOWN_LINK_REGEX = /(?<!!)\[[^\]]*]\(([^)\n]+)\)/g;
-  MARKDOWN_IMAGE_REGEX.lastIndex = 0;
   MARKDOWN_LINK_REGEX.lastIndex = 0;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/scripts/lint-external-links.ts` at line 28, Remove the unused
MARKDOWN_IMAGE_REGEX definition and its lastIndex reset in collectFileLinks:
delete the const MARKDOWN_IMAGE_REGEX = /!\[[^\]]*]\(([^)\n]+)\)/g declaration
and remove any code that resets MARKDOWN_IMAGE_REGEX.lastIndex (referenced in
collectFileLinks), since image links are already excluded by MARKDOWN_LINK_REGEX
and isImageUrl guards.

195-196: || response.status === 429 in the retry guard is always covered by >= 400.

Since 429 ≥ 400 is unconditionally true, the second clause is a no-op. The intent (retry all 4xx/5xx responses from HEAD with GET) is already expressed by >= 400 alone.

🧹 Proposed cleanup
-    if (response.status >= 400 || response.status === 429) {
+    if (response.status >= 400) {
       response = await fetchWithTimeout(url, { method: "GET", headers: BROWSER_HEADERS });
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/scripts/lint-external-links.ts` around lines 195 - 196, The
conditional that checks "if (response.status >= 400 || response.status === 429)"
is redundant because 429 is already >= 400; update the retry guard by removing
the redundant "|| response.status === 429" clause so it simply checks
"response.status >= 400" before calling fetchWithTimeout(url, { method: "GET",
headers: BROWSER_HEADERS }); reference the existing variables/identifiers
"response", "fetchWithTimeout", and "BROWSER_HEADERS" when making the change.

240-299: Consider CI impact: this script makes live external HTTP requests on every run.

A few operational implications worth keeping in mind as this gets wired into the lint pipeline:

  • No result caching. Every invocation re-fetches all unique URLs. For a large doc corpus, this adds meaningful CI wall-clock time.
  • No per-domain throttling. MAX_CONCURRENCY = 15 is a global cap, but all 15 slots can hit the same host simultaneously (e.g., github.com), which increases 429 risk. Since ACCEPTED_STATUSES includes 429 this won't cause false failures, but it means broken links on rate-limited hosts will silently pass.
  • Flakiness surface. Transient network errors or upstream outages will fail the lint step with no retry. Consider whether this task should be allowed to fail without blocking the PR, or whether a simple retry count (--retry n) would help.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/scripts/lint-external-links.ts` around lines 240 - 299, The script
performs live HTTP checks in main() with runWithConcurrency capped by
MAX_CONCURRENCY and uses checkUrl/ACCEPTED_STATUSES; to reduce CI impact add (1)
an optional local cache layer (e.g., cache file keyed by URL + TTL) to skip
re-fetching recent results, (2) per-host rate limiting or concurrency
partitioning so runWithConcurrency does not schedule all slots against the same
domain, (3) a retry mechanism in checkUrl with configurable --retry N and
backoff for transient failures, and (4) a CLI flag (e.g., --non-blocking) so
failures don’t break CI; implement these as configurable options and ensure
main() reads flags to enable caching, retries, per-host limits, and non-blocking
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/docs/content/docs/`(index)/prisma-orm/quickstart/mongodb.mdx:
- Line 326: The GitHub issue link referenced in the sentence about "Empty
database name" may be incorrect or unverified; confirm that
https://github.com/prisma/web/issues/5562 is the intended target and resolves to
the correct Prisma issue, and if not replace it with the correct issue/URL or
remove the link, updating the sentence in the MongoDB quickstart content (the
paragraph containing "Empty database name" in mongodb.mdx) to point to the
validated issue or to an appropriate official Prisma docs page; ensure the final
text and link are accurate and consistent with the referenced occurrence in
add-to-existing-project/mongodb.mdx.

---

Nitpick comments:
In `@apps/docs/scripts/lint-external-links.ts`:
- Line 28: Remove the unused MARKDOWN_IMAGE_REGEX definition and its lastIndex
reset in collectFileLinks: delete the const MARKDOWN_IMAGE_REGEX =
/!\[[^\]]*]\(([^)\n]+)\)/g declaration and remove any code that resets
MARKDOWN_IMAGE_REGEX.lastIndex (referenced in collectFileLinks), since image
links are already excluded by MARKDOWN_LINK_REGEX and isImageUrl guards.
- Around line 195-196: The conditional that checks "if (response.status >= 400
|| response.status === 429)" is redundant because 429 is already >= 400; update
the retry guard by removing the redundant "|| response.status === 429" clause so
it simply checks "response.status >= 400" before calling fetchWithTimeout(url, {
method: "GET", headers: BROWSER_HEADERS }); reference the existing
variables/identifiers "response", "fetchWithTimeout", and "BROWSER_HEADERS" when
making the change.
- Around line 240-299: The script performs live HTTP checks in main() with
runWithConcurrency capped by MAX_CONCURRENCY and uses
checkUrl/ACCEPTED_STATUSES; to reduce CI impact add (1) an optional local cache
layer (e.g., cache file keyed by URL + TTL) to skip re-fetching recent results,
(2) per-host rate limiting or concurrency partitioning so runWithConcurrency
does not schedule all slots against the same domain, (3) a retry mechanism in
checkUrl with configurable --retry N and backoff for transient failures, and (4)
a CLI flag (e.g., --non-blocking) so failures don’t break CI; implement these as
configurable options and ensure main() reads flags to enable caching, retries,
per-host limits, and non-blocking behavior.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bdca239 and e2c29e1.

📒 Files selected for processing (13)
  • apps/docs/content/docs.v6/(index)/prisma-orm/add-to-existing-project/mongodb.mdx
  • apps/docs/content/docs.v6/(index)/prisma-orm/quickstart/mongodb.mdx
  • apps/docs/content/docs.v6/orm/more/ai-tools/chatgpt.mdx
  • apps/docs/content/docs.v6/orm/more/dev-environment/editor-setup.mdx
  • apps/docs/content/docs.v6/orm/prisma-client/setup-and-configuration/databases-connections/index.mdx
  • apps/docs/content/docs/(index)/prisma-orm/add-to-existing-project/mongodb.mdx
  • apps/docs/content/docs/(index)/prisma-orm/quickstart/mongodb.mdx
  • apps/docs/content/docs/ai/tools/chatgpt.mdx
  • apps/docs/content/docs/orm/more/dev-environment/editor-setup.mdx
  • apps/docs/package.json
  • apps/docs/scripts/lint-external-links.ts
  • package.json
  • turbo.json
💤 Files with no reviewable changes (2)
  • apps/docs/content/docs.v6/orm/more/dev-environment/editor-setup.mdx
  • apps/docs/content/docs/orm/more/dev-environment/editor-setup.mdx
✅ Files skipped from review due to trivial changes (3)
  • apps/docs/content/docs.v6/orm/more/ai-tools/chatgpt.mdx
  • apps/docs/content/docs.v6/(index)/prisma-orm/quickstart/mongodb.mdx
  • apps/docs/content/docs.v6/(index)/prisma-orm/add-to-existing-project/mongodb.mdx

@mhartington mhartington merged commit f5a0ec0 into main Feb 23, 2026
8 of 11 checks passed
@mhartington mhartington deleted the 404-reports branch February 23, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant