feat(ai): expose Prisma changelog to AI tools with machine-readable endpoint#7889
Conversation
Adds /changelog.md — a clean markdown index of all Prisma changelog entries that AI tools can fetch to check for recent breaking changes before implementing Prisma features. Updates site llms.txt and llms-full.txt to reference the changelog and include guidance to verify against it. Updates docs llms.txt with the same guidance and adds the changelog as the first entry in common queries. Closes DR-8494 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis pull request adds a machine-readable Prisma changelog endpoint at ChangesChangelog Machine-Readable Endpoint and LLMS Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/site/src/app/changelog.md/route.ts`:
- Around line 15-23: The Promise.all mapping over entries makes a single
getReleaseNotePreview rejection fatal; update the entriesWithPreview creation
(the entries.map async callback that computes summary) to catch errors from
getReleaseNotePreview for each entry and handle them locally (e.g., return null
or a safe fallback summary) so one failing getReleaseNotePreview call won’t
reject the entire Promise.all; specifically wrap the await
getReleaseNotePreview(entry.slugs[0]) in a try/catch inside the async mapper and
use the caught error to set summary to null (and optionally log the error) while
still returning { entry, summary }.
In `@apps/site/src/app/llms-content.ts`:
- Line 240: The code in buildLlmsFullContent hardcodes a production URL for
fetching the changelog, bypassing the environment-aware baseUrl; update
buildLlmsFullContent to use the existing baseUrl (or a passed-in baseUrl
parameter) when constructing the fetch URL instead of the literal
"https://www.prisma.io/changelog.md" so preview/test runs use the same domain
logic as the rest of the function and avoid mixed-domain outputs.
🪄 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: 15df2454-9ac0-46be-9e4c-ff6af68202b7
📒 Files selected for processing (4)
apps/docs/src/app/llms.txt/route.tsapps/docs/src/lib/llms.tsapps/site/src/app/changelog.md/route.tsapps/site/src/app/llms-content.ts
| const entriesWithPreview = await Promise.all( | ||
| entries.map(async (entry) => { | ||
| const summary = | ||
| entry.data.summary ?? | ||
| entry.data.description ?? | ||
| (entry.slugs[0] ? await getReleaseNotePreview(entry.slugs[0]) : null); | ||
| return { entry, summary }; | ||
| }), | ||
| ); |
There was a problem hiding this comment.
Make per-entry preview failures non-fatal.
A rejection from one getReleaseNotePreview(...) call (Line 20) will reject the whole Promise.all and fail /changelog.md for all entries. Handle errors per entry so one bad note doesn’t take down the feed.
💡 Suggested fix
- const entriesWithPreview = await Promise.all(
- entries.map(async (entry) => {
- const summary =
- entry.data.summary ??
- entry.data.description ??
- (entry.slugs[0] ? await getReleaseNotePreview(entry.slugs[0]) : null);
- return { entry, summary };
- }),
- );
+ const entriesWithPreview = await Promise.all(
+ entries.map(async (entry) => {
+ const preview =
+ entry.slugs[0]
+ ? await getReleaseNotePreview(entry.slugs[0]).catch(() => null)
+ : null;
+ const summary = entry.data.summary ?? entry.data.description ?? preview;
+ return { entry, summary };
+ }),
+ );📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const entriesWithPreview = await Promise.all( | |
| entries.map(async (entry) => { | |
| const summary = | |
| entry.data.summary ?? | |
| entry.data.description ?? | |
| (entry.slugs[0] ? await getReleaseNotePreview(entry.slugs[0]) : null); | |
| return { entry, summary }; | |
| }), | |
| ); | |
| const entriesWithPreview = await Promise.all( | |
| entries.map(async (entry) => { | |
| const preview = | |
| entry.slugs[0] | |
| ? await getReleaseNotePreview(entry.slugs[0]).catch(() => null) | |
| : null; | |
| const summary = entry.data.summary ?? entry.data.description ?? preview; | |
| return { entry, summary }; | |
| }), | |
| ); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/site/src/app/changelog.md/route.ts` around lines 15 - 23, The
Promise.all mapping over entries makes a single getReleaseNotePreview rejection
fatal; update the entriesWithPreview creation (the entries.map async callback
that computes summary) to catch errors from getReleaseNotePreview for each entry
and handle them locally (e.g., return null or a safe fallback summary) so one
failing getReleaseNotePreview call won’t reject the entire Promise.all;
specifically wrap the await getReleaseNotePreview(entry.slugs[0]) in a try/catch
inside the async mapper and use the caught error to set summary to null (and
optionally log the error) while still returning { entry, summary }.
|
|
||
| IMPORTANT: Prisma changes frequently. Before implementing any Prisma feature, fetch the changelog to check for breaking changes or API updates. Do not rely solely on training data for Prisma APIs, configuration, or conventions — these can change between versions. | ||
|
|
||
| How to use: fetch https://www.prisma.io/changelog.md for a machine-readable index, then look up the relevant topic in the current documentation at https://www.prisma.io/docs. |
There was a problem hiding this comment.
Avoid hardcoded production URLs in buildLlmsFullContent.
Line 240 bypasses baseUrl, so preview/test outputs become mixed-domain while the rest of this function stays environment-aware.
💡 Suggested fix
-How to use: fetch https://www.prisma.io/changelog.md for a machine-readable index, then look up the relevant topic in the current documentation at https://www.prisma.io/docs.
+How to use: fetch ${toAbsoluteUrl(baseUrl, "/changelog.md")} for a machine-readable index, then look up the relevant topic in the current documentation at ${toAbsoluteUrl(baseUrl, "/docs")}.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/site/src/app/llms-content.ts` at line 240, The code in
buildLlmsFullContent hardcodes a production URL for fetching the changelog,
bypassing the environment-aware baseUrl; update buildLlmsFullContent to use the
existing baseUrl (or a passed-in baseUrl parameter) when constructing the fetch
URL instead of the literal "https://www.prisma.io/changelog.md" so preview/test
runs use the same domain logic as the rest of the function and avoid
mixed-domain outputs.
|
Superseded by cleaner branch. |
Summary
/changelog.md— a new machine-readable markdown endpoint in the site app that lists all Prisma changelog entries (version, date, tags, summary, URL) in reverse chronological order, with AI-guidance at the top directing tools to check it before implementing Prisma featuresllms.txtandllms-full.txtto include the changelog in key pages and add a note about checking it for breaking changesllms.txtto include the changelog guidance note as a blockquote at the top, and adds "Check the Prisma changelog" as the first entry in common queries pointing to the machine-readable endpointWhy
The Prisma changelog at
/changelogis a stylized React page — not ideal for AI crawlers. This addschangelog.mdas a clean, crawlable markdown index that AI tools canfetchto check for recent breaking changes before implementing any Prisma feature.Test plan
curl https://www.prisma.io/changelog.mdreturns a clean markdown index of all entries with correct dates, tags, summarieshttps://www.prisma.io/llms.txtincludes the changelog entry and the machine-readable linkhttps://www.prisma.io/llms-full.txtincludes the Changelog section with IMPORTANT guidancehttps://www.prisma.io/docs/llms.txtshows changelog guidance at the top and in common queriesCloses DR-8494
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation