Repository navigation
feat: Add federated content script. Resolve graphql routes. - #47934
jeremenichelli merged 3 commits into
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
6 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughGraphQL documentation is configured as federated content fetched from GitHub, transformed into local MDX files during docs builds, and served through shared guide utilities with custom edit-link frontmatter support. ChangesFederated GraphQL guides
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DocsBuild
participant FederatedFetcher
participant GitHub
participant LocalGuideContent
participant GraphQLRoute
DocsBuild->>FederatedFetcher: run build:federated-content
FederatedFetcher->>GitHub: fetch mapped GraphQL Markdown
GitHub-->>FederatedFetcher: return source content
FederatedFetcher->>LocalGuideContent: write transformed .mdx files
GraphQLRoute->>LocalGuideContent: retrieve graphql-prefixed guide slug
LocalGuideContent-->>GraphQLRoute: return guide data and edit link
GraphQLRoute-->>DocsBuild: render GuideTemplate
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
awaseem
left a comment
There was a problem hiding this comment.
Minor notes: Would be cool to unit test the behaviour of reading from source and the pipeline to markdown. can be a good fast follow
@awaseem happy to add tests once we settle the approach across various routes. That said, most of the thing is external libraries plus fetching, so there's not a lot to unit test.
@czenko yes, in the old approach we use to run a
Not only out of scope but out of our control given it's a federated page. We should probably invest in improving the authoring process for external documentation we import (cc @awaseem) |
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/docs/scripts/federated-content/fetch-federated-content.ts`:
- Around line 81-83: Update the catch block in fetch-federated-content to
construct the Error with an options object containing the caught err as cause,
preserving the existing descriptive message and original error context.
- Around line 141-143: Update the fetchFederatedContent() rejection handler to
re-throw the original error directly instead of wrapping it with Error(error),
preserving its type and stack trace.
🪄 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: 91ae9107-d4bc-4fa3-ac6d-14c0db0b6cf0
📒 Files selected for processing (8)
apps/docs/.gitignoreapps/docs/app/guides/graphql/[[...slug]]/page.tsxapps/docs/features/docs/GuidesMdx.utils.tsxapps/docs/lib/docs.tsapps/docs/package.jsonapps/docs/scripts/federated-content/fetch-federated-content.tsapps/docs/scripts/federated-content/sources/graphql.tsapps/docs/scripts/federated-content/types.ts
czenko
left a comment
There was a problem hiding this comment.
See the broken images are fixed in md and on web. Verified that the content is equivalent.
Braintrust eval report
|

I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Setting this as draft since I didn't have time to manually test this post deployment. I still encourage review and testing.
Main change. Created a generic federated content script to extract external content into static files we can process and manipulate to bring feature parity with other routes. Route used for testing:
docs/guides/graphql.How to test:
.mdto each route, the server should return a markdown version of each page.Summary by CodeRabbit
New Features
Improvements
Chores