chore(docs): add more urls for redirects#7539
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughRewrote the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
🍈 Lychee Link Check Report3666 links: ❌ Errors
Full Statistics Table
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
apps/docs/vercel.json (3)
4725-4729: This rule creates a redirect chain — flatten the existing upstream rule instead.Existing rule (line ~3188) already redirects:
/docs/concepts/components/prisma-client/working-with-prismaclient/instantiate-prisma-client → /docs/orm/prisma-client/setup-and-configuration/instantiate-prisma-clientThis new rule then redirects that intermediate URL onward:
/docs/orm/prisma-client/setup-and-configuration/instantiate-prisma-client → /docs/orm/prisma-client/setup-and-configuration/introductionUsers arriving from the original concepts URL now take two hops before reaching the final page. For
permanent: true(308) redirects, the second hop gets cached after the first visit, but the upstream rule is now permanently pointing at a dead-end URL. Update the upstream rule'sdestinationto point directly to/docs/orm/prisma-client/setup-and-configuration/introductionand you can remove the new intermediate rule entirely.♻️ Suggested fix: flatten the chain
Update the upstream rule (line ~3188) directly, so the intermediate URL is no longer needed:
{ "source": "/docs/concepts/components/prisma-client/working-with-prismaclient/instantiate-prisma-client", - "destination": "/docs/orm/prisma-client/setup-and-configuration/instantiate-prisma-client", + "destination": "/docs/orm/prisma-client/setup-and-configuration/introduction", "permanent": true },Then remove the newly added intermediate rule (lines 4725–4729).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/vercel.json` around lines 4725 - 4729, There’s a redirect chain: the existing rule whose source is "/docs/concepts/components/prisma-client/working-with-prismaclient/instantiate-prisma-client" should be updated to point directly to "/docs/orm/prisma-client/setup-and-configuration/introduction" (replace its current destination), and then remove the newly added intermediate rule whose source is "/docs/orm/prisma-client/setup-and-configuration/instantiate-prisma-client" (the one that redirects to "/docs/orm/prisma-client/setup-and-configuration/introduction") so the chain is flattened.
4955-4959: Redirecting the metrics URL to logging creates two-hop chains for existing upstream rules.Two existing rules already send traffic to
/docs/orm/prisma-client/observability-and-logging/metricsas their destination (lines ~3519 and ~3873):/docs/concepts/components/prisma-client/metrics → ...metrics /docs/guides/performance-and-optimization/metrics → ...metricsAdding this new rule makes that intermediate URL itself a redirect source, turning both into 2-hop chains:
old-URL → /docs/orm/.../metrics → /docs/orm/.../loggingAdditionally, redirecting a
metricsURL unconditionally tologgingmay surprise users who specifically bookmarked or linked to the metrics documentation. If the metrics page has been merged into the logging page, the upstream rules should be updated to point directly to/docs/orm/prisma-client/observability-and-logging/logging.♻️ Suggested fix: flatten both upstream rules
Update the two upstream rules and remove this intermediate entry:
{ "source": "/docs/concepts/components/prisma-client/metrics", - "destination": "/docs/orm/prisma-client/observability-and-logging/metrics", + "destination": "/docs/orm/prisma-client/observability-and-logging/logging", "permanent": true },{ "source": "/docs/guides/performance-and-optimization/metrics", - "destination": "/docs/orm/prisma-client/observability-and-logging/metrics", + "destination": "/docs/orm/prisma-client/observability-and-logging/logging", "permanent": true },Then remove lines 4955–4959.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/vercel.json` around lines 4955 - 4959, This redirect creates two-hop chains because existing rules use "/docs/orm/prisma-client/observability-and-logging/metrics" as their destination; update those upstream rules (the ones routing to "/docs/concepts/components/prisma-client/metrics" and "/docs/guides/performance-and-optimization/metrics") to point directly to "/docs/orm/prisma-client/observability-and-logging/logging" and then remove the intermediate redirect entry that maps "/docs/orm/prisma-client/observability-and-logging/metrics" → "/docs/orm/prisma-client/observability-and-logging/logging".
4660-5239: Monitor the total redirect count — the Vercel 2048-route limit is now meaningfully within range.You can define up to 2048 routes in the Vercel configuration. This PR adds a significant batch of entries. The file currently contains well over 1,000 redirect rules (5,240 lines ÷ ~5 lines per entry ≈ 1,050+ rules). If growth continues at this pace, you will hit the hard limit within a few more similar batches.
When that limit is reached, you can use bulk redirects, or look at Edge Middleware or a Serverless Function as alternatives. Consider tracking the count as a CI gate (e.g.,
jq '.redirects | length' apps/docs/vercel.json) so the team knows when to migrate to a more scalable solution before hitting the ceiling.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/vercel.json` around lines 4660 - 5239, The vercel redirects array now contains a very large number of individual entries (many objects with "source"/"destination"/"permanent") and risks exceeding Vercel's 2048-route limit; update the PR to (1) add a CI check that counts items in the redirects array (e.g., run jq '.redirects | length' in CI and fail or warn above a threshold), (2) reduce the number of top-level objects by collapsing repetitive patterns into bulk redirects or wildcard rules where possible (consolidate similar "source" patterns), or (3) migrate large/complex mappings to Edge Middleware or a Serverless Function and replace those entries with a single redirect; locate the redirects array and the individual redirect objects (look for objects containing "source", "destination", "permanent") and implement the CI gate and consolidation/migration changes accordingly.
🤖 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/vercel.json`:
- Around line 5125-5129: Add an inline comment in apps/docs/vercel.json near the
redirect entries that maps
"/docs/orm/more/deployment-guides/deploying-to-firebase" ->
"/docs/orm/prisma-client/deployment/serverless/deploy-to-azure-functions" and
"/docs/orm/more/deployment/deployment-guides/deploying-to-digitalocean" ->
"/docs/orm/prisma-client/deployment/deploy-to-render" explaining these are
intentional consolidations (legacy Firebase and DigitalOcean guides deprecated
in favor of platform-neutral or representative deployment guides) so future
maintainers don't revert them; place the comment immediately above or beside the
two redirect objects and keep it brief and clear.
---
Nitpick comments:
In `@apps/docs/vercel.json`:
- Around line 4725-4729: There’s a redirect chain: the existing rule whose
source is
"/docs/concepts/components/prisma-client/working-with-prismaclient/instantiate-prisma-client"
should be updated to point directly to
"/docs/orm/prisma-client/setup-and-configuration/introduction" (replace its
current destination), and then remove the newly added intermediate rule whose
source is
"/docs/orm/prisma-client/setup-and-configuration/instantiate-prisma-client" (the
one that redirects to
"/docs/orm/prisma-client/setup-and-configuration/introduction") so the chain is
flattened.
- Around line 4955-4959: This redirect creates two-hop chains because existing
rules use "/docs/orm/prisma-client/observability-and-logging/metrics" as their
destination; update those upstream rules (the ones routing to
"/docs/concepts/components/prisma-client/metrics" and
"/docs/guides/performance-and-optimization/metrics") to point directly to
"/docs/orm/prisma-client/observability-and-logging/logging" and then remove the
intermediate redirect entry that maps
"/docs/orm/prisma-client/observability-and-logging/metrics" →
"/docs/orm/prisma-client/observability-and-logging/logging".
- Around line 4660-5239: The vercel redirects array now contains a very large
number of individual entries (many objects with
"source"/"destination"/"permanent") and risks exceeding Vercel's 2048-route
limit; update the PR to (1) add a CI check that counts items in the redirects
array (e.g., run jq '.redirects | length' in CI and fail or warn above a
threshold), (2) reduce the number of top-level objects by collapsing repetitive
patterns into bulk redirects or wildcard rules where possible (consolidate
similar "source" patterns), or (3) migrate large/complex mappings to Edge
Middleware or a Serverless Function and replace those entries with a single
redirect; locate the redirects array and the individual redirect objects (look
for objects containing "source", "destination", "permanent") and implement the
CI gate and consolidation/migration changes accordingly.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/vercel.json`:
- Around line 4955-4958: Several redirect entries create 2‑hop chains (e.g., the
rule with source "/docs/orm/prisma-client/observability-and-logging/metrics"
pointing to "/docs/orm/prisma-client/observability-and-logging/logging" being
used as an intermediate); find redirect objects whose "destination" value also
appears as a "source" elsewhere and update the old entries so their
"destination" points directly to the final target (for example, change the rule
that originally pointed to
"/docs/orm/prisma-client/observability-and-logging/metrics" to point straight to
"/docs/orm/prisma-client/observability-and-logging/logging"); perform this
systematically across the file (search for source/destination string matches
such as the metrics→logging, client-extensions/middleware chain, and
instantiate-prisma-client chain) so no entry's destination is another redirect
source.
---
Duplicate comments:
In `@apps/docs/vercel.json`:
- Around line 5160-5163: The redirect mapping from
"/docs/orm/more/deployment/deployment-guides/deploying-to-digitalocean" to the
Render page "/docs/orm/prisma-client/deployment/traditional/deploy-to-render"
will confuse users expecting DigitalOcean content; either update the redirect to
point to a DigitalOcean-specific page or add an explicit deprecation/
consolidation landing page and redirect there, and if the consolidation is
intentional, add a short note to the PR description (or a nearby repo-maintainer
note) stating that the DigitalOcean guide was deprecated and intentionally
mapped to the Render deployment page; reference the redirect entry with the
exact source and destination strings when making the change.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/vercel.json`:
- Around line 5215-5219: The redirect list currently maps the misspelled path
"/docs/ai/promt" to "/docs/ai/prompts/prisma-7" but omits the correct singular
"/docs/ai/prompt"; add a new redirect object for source "/docs/ai/prompt" with
destination "/docs/ai/prompts/prisma-7" and "permanent": true so both the
misspelling and the grammatically correct singular form route to the same page.
- Around line 4649-5219: The redirect list contains a duplicate "source":
"/docs/guides/bun" (two entries at indices referenced in the review) with
conflicting "permanent" values; remove the later duplicate entry that redirects
"/docs/guides/bun" to "/docs/guides/runtimes/bun" (the one missing the
"permanent" field) so only the canonical entry with "permanent": true remains,
ensuring the single redirect for the source "/docs/guides/bun" is permanent.
- Around line 5071-5073: The redirect from the source path
"/docs/guides/deployment/deploying-to-cloud/cloud-functions" currently points to
the Cloudflare Workers page and is semantically misleading; update the
"destination" for that "source" entry (the JSON object containing the source
string) to a neutral deployment overview (for example
"/docs/orm/prisma-client/deployment/edge/overview" or your general serverless
landing page) or remove the redirect if you want no automatic mapping, ensuring
users looking for Google Cloud Functions aren’t sent to Cloudflare Workers.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/vercel.json`:
- Around line 4935-4938: The redirect entry has a garbled "source" string
("/docs/orm/prisma-client/setup-and-configuration/eprisma.config.tsrror-formatting")
that appears to be a paste collision; either remove this redirect or correct the
"source" to the intended slug (likely
"/docs/orm/prisma-client/setup-and-configuration/error-formatting" or the
specific malformed path seen in server logs) while leaving "destination" as
"/docs/orm/prisma-client/setup-and-configuration/error-formatting"; if the
malformed slug was intentionally added to catch a real 404, verify the exact
garbled slug in server logs and update the "source" to that exact string.
- Around line 4650-5213: The vercel.json contains >1,024 redirect entries
(currently 1,052) and must be reduced to at most 1,024; remove/consolidate
redundant redirects and migrate the overflow (~28 entries) to Edge
Middleware/Edge Config or pattern-based redirects. Fix the garbled redirect
source string "eprisma.config.tsrror-formatting" to the intended source (split
into the correct
"/docs/orm/prisma-client/setup-and-configuration/prisma.config.ts" and
"/docs/orm/prisma-client/setup-and-configuration/error-formatting" targets) so
the redirect maps correctly. Stop redirecting image asset URLs (e.g.
"/docs/social/docs-social.png" and
"/docs/img/guides/prisma-bun-cover-image.png") to HTML pages—either remove those
redirect entries or serve them via the static assets bucket or a dedicated
static redirect rule so <img> tags still receive image responses. After edits,
re-count redirects to ensure total <= 1,024 and deploy the migrated redirects
via Edge Middleware/Edge Config for the moved entries.
---
Duplicate comments:
In `@apps/docs/vercel.json`:
- Around line 4643-4645: There is a duplicate redirect entry for the source
"/docs/guides/bun"; remove the later object (the one lacking the "permanent"
property) so only the canonical redirect that includes `"permanent": true`
remains; locate the duplicate by searching for the source string
"/docs/guides/bun" and keep the entry that has `"permanent": true`, deleting the
other entry to avoid conflicting temporary vs permanent behavior.
- Around line 5210-5213: Add a redirect entry for the correctly spelled route by
duplicating the existing mapping for "/docs/ai/promt": add an object with
"source": "/docs/ai/prompt", "destination": "/docs/ai/prompts/prisma-7",
"permanent": true so the singular correct URL resolves to the same destination
as the misspelled "/docs/ai/promt".
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@apps/docs/vercel.json`:
- Around line 4939-4942: The redirect entry contains a garbled source slug
"/docs/orm/prisma-client/setup-and-configuration/eprisma.config.tsrror-formatting";
remove this accidental redirect or replace the source with the intended correct
slug (verify using server logs if this was real 404 traffic) so it no longer
maps the malformed path to "error-formatting"; update or delete the object
containing the "source" property with that exact garbled string to resolve the
duplicate/malformed entry.
- Around line 5214-5217: The redirect currently mapping the misspelled "source":
"/docs/ai/promt" to "destination": "/docs/ai/prompts/prisma-7" fixes the typo
but leaves the correct singular path "/docs/ai/prompt" returning 404; add a new
redirect entry with "source": "/docs/ai/prompt" pointing to the same
"destination": "/docs/ai/prompts/prisma-7" (or the intended canonical page) so
both the typo and the grammatically correct singular URL are covered by
redirects.
- Around line 4889-4892: The redirect entries mapping the image sources
"/docs/social/docs-social.png" and "/docs/img/guides/prisma-bun-cover-image.png"
to HTML routes must be changed so browsers request the actual image bytes
instead of an HTML page; update the redirect rules in vercel.json to point those
"source" entries to the static CDN/static bucket (or your site’s /static asset
path) where the PNGs live (e.g., replace the "destination" values that point to
"/docs" and "/docs/guides/runtimes/bun" with the corresponding CDN/static URLs
or internal /static paths), ensuring they return image content rather than HTML.
- Around line 4649-5217: The redirects array in vercel.json exceeds Vercel's
1,024-entry hard limit and contains problematic entries (image-to-HTML redirects
like "docs/social/docs-social.png", a garbled source
"eprisma.config.tsrror-formatting", and likely typos like "docs/ai/promt"),
causing deploy failures or silent truncation; open the redirects array and run
the provided jq/bash check to confirm the count, then reduce entries to <=1024
by removing or consolidating obsolete redirects, eliminating image-to-HTML
redirects (e.g., remove "docs/social/docs-social.png" mapping), fix or delete
the garbled source ("eprisma.config.tsrror-formatting") and misspellings (e.g.,
"docs/ai/promt"), and ensure there are no duplicate .redirects[].source or
redirect chains (source → destination where destination is also a source);
re-run the script to verify total <=1024, no duplicates, no chains, and that
PNG/image sources are gone before merging.
Summary by CodeRabbit