Fix concepts redirect destinations#7836
Fix concepts redirect destinations#7836mhessdev wants to merge 1 commit intocodex/seo-docs-remediation-setup-prismafrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe PR updates Vercel redirect rules in the documentation configuration to reorganize Prisma/ORM documentation paths. Legacy redirect targets are remapped from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/docs/vercel.json (1)
2989-2989: Heads-up: same four topics now have split redirect destinations — possibly intentional, worth a sanity pass.These four entries now route the legacy
/docs/concepts/components/prisma-client/{custom-validation,computed-fields,custom-models,case-sensitivity}paths to versioned/docs/v6/orm/prisma-client/queries/<topic>pages, which matches what the PR description says (topics that only exist in v6).However, the file already contains four sibling rules (lines 1101–1118) that send the current-shape sources
/docs/orm/prisma-client/queries/{case-sensitivity,computed-fields,custom-models,custom-validation}to the broad CRUD hub/docs/orm/prisma-client/queries/crudinstead of the same v6 pages. The result: a search hit on the legacy concepts URL takes the user to the dedicated v6 doc, but a hit on the newer-shape URL takes them to a generic hub and they have to hunt for the topic.Not blocking, since the PR scope is explicitly the concepts/reference family, but worth either (a) aligning the four
/docs/orm/prisma-client/queries/*entries to the same/docs/v6/...destinations in a follow-up, or (b) leaving a TODO so it doesn't get forgotten. If you want, I can open a follow-up issue to track it.Also applies to: 2994-2994, 3004-3004, 3009-3009
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/docs/vercel.json` at line 2989, The four existing redirect rules that map "/docs/orm/prisma-client/queries/{case-sensitivity,computed-fields,custom-models,custom-validation}" to the CRUD hub ("/docs/orm/prisma-client/queries/crud") should be aligned with the new legacy redirects that point to "/docs/v6/orm/prisma-client/queries/<topic>"; update those four entries so their "destination" values match "/docs/v6/orm/prisma-client/queries/case-sensitivity", "/docs/v6/orm/prisma-client/queries/computed-fields", "/docs/v6/orm/prisma-client/queries/custom-models", and "/docs/v6/orm/prisma-client/queries/custom-validation" respectively, or if you prefer not to change behavior now, add a clear TODO comment next to the existing "/docs/orm/prisma-client/queries/crud" rules referencing the new v6 destinations so this alignment is tracked for a follow-up.
🤖 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`:
- Line 1795: The redirect entries in vercel.json contain anchor fragments that
don't exist on the target MDX pages (e.g., the destination string
"/docs/orm/prisma-client/queries/aggregation-grouping-summarizing#select-distinct"),
so update either the redirects or the MDX headings: locate the redirect lines in
vercel.json and either remove or correct the fragment parts to match the actual
page URLs, or add matching heading slugs/explicit IDs in the target MDX files
(e.g., aggregation-grouping-summarizing.mdx, prisma-client-reference.mdx,
prisma-schema-reference.mdx, models.mdx, relations/index.mdx, sql-server.mdx,
cli/index.mdx, relation-queries.mdx) by renaming headings or adding HTML
anchors/MDX id attributes so each fragment like "#select-distinct", "#group-by",
"#prismaclient", etc. exactly matches the redirect fragment.
---
Nitpick comments:
In `@apps/docs/vercel.json`:
- Line 2989: The four existing redirect rules that map
"/docs/orm/prisma-client/queries/{case-sensitivity,computed-fields,custom-models,custom-validation}"
to the CRUD hub ("/docs/orm/prisma-client/queries/crud") should be aligned with
the new legacy redirects that point to
"/docs/v6/orm/prisma-client/queries/<topic>"; update those four entries so their
"destination" values match
"/docs/v6/orm/prisma-client/queries/case-sensitivity",
"/docs/v6/orm/prisma-client/queries/computed-fields",
"/docs/v6/orm/prisma-client/queries/custom-models", and
"/docs/v6/orm/prisma-client/queries/custom-validation" respectively, or if you
prefer not to change behavior now, add a clear TODO comment next to the existing
"/docs/orm/prisma-client/queries/crud" rules referencing the new v6 destinations
so this alignment is tracked for a follow-up.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6c344b31-2c9a-4c2a-abc8-b61a73730207
📒 Files selected for processing (1)
apps/docs/vercel.json
| { | ||
| "source": "/docs/concepts/components/prisma-client/distinct", | ||
| "destination": "/docs/concepts/components/prisma-client/aggregation-grouping-summarizing#select-distinct", | ||
| "destination": "/docs/orm/prisma-client/queries/aggregation-grouping-summarizing#select-distinct", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that anchor slugs referenced by the new redirect destinations
# resolve to a heading on the target MDX page.
set -u
# Pairs of: <relative-mdx-glob> <expected-anchor-slug>
pairs=(
"orm/prisma-client/queries/aggregation-grouping-summarizing" "select-distinct"
"orm/prisma-client/queries/aggregation-grouping-summarizing" "group-by"
"orm/reference/prisma-client-reference" "prismaclient"
"orm/reference/prisma-client-reference" "utility-types"
"orm/reference/prisma-schema-reference" "model-field-scalar-types"
"orm/prisma-schema/data-model/models" "native-types-mapping"
"orm/prisma-schema/data-model/models" "defining-a-unique-field"
"orm/prisma-schema/data-model/relations" "relational-databases"
"orm/core-concepts/supported-databases/sql-server" "connection-details"
"orm/core-concepts/supported-databases/sql-server" "local-setup"
"cli" "installation"
"orm/prisma-client/queries/relation-queries" "filter-on-presence-of-related-records"
)
# Convert a heading line ("## Foo Bar (baz)") to a github-style slug.
slugify() {
printf '%s' "$1" \
| sed -E 's/^#+[[:space:]]*//' \
| tr '[:upper:]' '[:lower:]' \
| sed -E 's/[^a-z0-9[:space:]-]//g' \
| sed -E 's/[[:space:]]+/-/g'
}
for ((i=0; i<${`#pairs`[@]}; i+=2)); do
page="${pairs[i]}"
anchor="${pairs[i+1]}"
# Find the MDX file for this logical page.
file="$(fd -t f -e mdx -e md . apps/docs/content/docs 2>/dev/null \
| rg -F "/${page}." | head -n1)"
if [[ -z "${file:-}" ]]; then
file="$(fd -t f -e mdx -e md . apps/docs/content/docs 2>/dev/null \
| rg -F "/${page}/index." | head -n1)"
fi
if [[ -z "${file:-}" ]]; then
echo "MISSING PAGE: ${page} (anchor #${anchor})"
continue
fi
# Collect every heading slug from the file.
found=0
while IFS= read -r line; do
slug="$(slugify "$line")"
if [[ "$slug" == "$anchor" ]]; then
found=1; break
fi
done < <(rg -N '^#{1,6}[[:space:]]' "$file")
if [[ "$found" -eq 1 ]]; then
echo "OK: ${page} #${anchor}"
else
echo "MISSING: ${page} #${anchor} (file: ${file})"
fi
doneRepository: prisma/web
Length of output: 2533
Anchor fragments in these redirect destinations don't exist on their target pages—all 12 will land users at the top of the page instead of the intended section.
The verification found that none of these heading anchors are present in the target MDX files:
aggregation-grouping-summarizing.mdx— missing#select-distinct,#group-byprisma-client-reference.mdx— missing#prismaclient,#utility-typesprisma-schema-reference.mdx— missing#model-field-scalar-typesmodels.mdx— missing#native-types-mapping,#defining-a-unique-fieldrelations/index.mdx— missing#relational-databasessql-server.mdx— missing#connection-details,#local-setupcli/index.mdx— missing#installationrelation-queries.mdx— missing#filter-on-presence-of-related-records
This defeats the intent of the redirect—users get a 200 response but land in the wrong place. Either the heading slugs need to be renamed to match these anchors, or the redirect destinations need to be adjusted to match the actual page structure. This needs to be resolved before merge.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/docs/vercel.json` at line 1795, The redirect entries in vercel.json
contain anchor fragments that don't exist on the target MDX pages (e.g., the
destination string
"/docs/orm/prisma-client/queries/aggregation-grouping-summarizing#select-distinct"),
so update either the redirects or the MDX headings: locate the redirect lines in
vercel.json and either remove or correct the fragment parts to match the actual
page URLs, or add matching heading slugs/explicit IDs in the target MDX files
(e.g., aggregation-grouping-summarizing.mdx, prisma-client-reference.mdx,
prisma-schema-reference.mdx, models.mdx, relations/index.mdx, sql-server.mdx,
cli/index.mdx, relation-queries.mdx) by renaming headings or adding HTML
anchors/MDX id attributes so each fragment like "#select-distinct", "#group-by",
"#prismaclient", etc. exactly matches the redirect fragment.
ArthurGamby
left a comment
There was a problem hiding this comment.
QA two links also, it works. I checked the anchor issue pointed by CodeRabbit, it's a false alarm, it works.
Summary
Verification
Summary by CodeRabbit