Repository navigation
[codex] Update reference specs and markdown generation - #2834
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 0 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis pull request updates the devDependency reference for Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Greptile SummaryThis PR hardens reference page loading in local development by bumping
Confidence Score: 5/5Safe to merge — all changes are focused dev-environment hardening with no risk to production behaviour No P0 or P1 issues found. The only finding is a pre-existing missing default case in getExamples that is already handled gracefully by the surrounding null-guard, making it purely cosmetic. All logic changes are correct and well-targeted. src/routes/docs/references/[version]/[platform]/[service]/specs.ts — minor: getExamples switch has no default/cloud case Important Files Changed
Reviews (1): Last reviewed commit: "Update reference specs and markdown gene..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/routes/docs/references/[version]/[platform]/[service]/specs.ts (2)
93-150: This version switch is another sync point.
getExamples()now has to stay in sync withsrc/lib/utils/references.ts:5-24. A sharedRecord<Exclude<Version, 'cloud'>, ...>would let the compiler catch the next version bump instead of relying on another manual switch update.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/routes/docs/references/`[version]/[platform]/[service]/specs.ts around lines 93 - 150, The getExamples function uses a manual switch per version; instead export a single source-of-truth (e.g., a Record or array) from src/lib/utils/references.ts (reference the exported symbol you add, e.g., VERSIONS or VERSION_MAP) and replace the switch in getExamples(version: string) with a lookup against that exported record to build the import.meta.glob path(s) programmatically; this way the compiler will surface missing versions and you only update one Record (the symbol exported from src/lib/utils/references.ts) instead of editing getExamples and the other file separately.
410-417: Prefer a 404 over a generic error for missing spec loaders.Line 413 throws a plain
Error, so a bad{version}/{platform}docs URL will read as a 500 unless something upstream converts it. If a missing loader here means “reference not found,” using SvelteKit’serror(404, ...)would keep this aligned withgetSchema().📦 Possible adjustment
const loader = Object.entries(specs).find(([key]) => key.endsWith(`/${filename}`))?.[1]; if (!loader) { - throw new Error(`Missing OpenAPI spec loader for ${filename}`); + error(404, { message: 'Not found' }); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/routes/docs/references/`[version]/[platform]/[service]/specs.ts around lines 410 - 417, Replace the generic throw with SvelteKit's 404 helper: import error from '@sveltejs/kit' (or add it to existing imports) and change the existing "throw new Error(`Missing OpenAPI spec loader for ${filename}`)" to "throw error(404, `Missing OpenAPI spec loader for ${filename}`)"; keep the surrounding loader lookup and the subsequent loading/return logic (the loader variable and the loaded/default branching) unchanged so the function behavior is identical except for returning a 404 when the spec loader is missing, matching getSchema().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/routes/docs/references/`[version]/[platform]/[service]/specs.ts:
- Around line 93-150: The getExamples function uses a manual switch per version;
instead export a single source-of-truth (e.g., a Record or array) from
src/lib/utils/references.ts (reference the exported symbol you add, e.g.,
VERSIONS or VERSION_MAP) and replace the switch in getExamples(version: string)
with a lookup against that exported record to build the import.meta.glob path(s)
programmatically; this way the compiler will surface missing versions and you
only update one Record (the symbol exported from src/lib/utils/references.ts)
instead of editing getExamples and the other file separately.
- Around line 410-417: Replace the generic throw with SvelteKit's 404 helper:
import error from '@sveltejs/kit' (or add it to existing imports) and change the
existing "throw new Error(`Missing OpenAPI spec loader for ${filename}`)" to
"throw error(404, `Missing OpenAPI spec loader for ${filename}`)"; keep the
surrounding loader lookup and the subsequent loading/return logic (the loader
variable and the loaded/default branching) unchanged so the function behavior is
identical except for returning a 404 when the spec loader is missing, matching
getSchema().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 69886fb6-0dad-476d-ba54-4eac4d35e975
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
package.jsonsrc/lib/server/markdown-generators.tssrc/lib/system.tssrc/lib/utils/references.tssrc/routes/docs/references/[version]/[platform]/[service]/specs.ts
Summary
This PR updates the website references stack to use a newer
@appwrite.io/specsrevision and hardens reference markdown generation in development.What changed
@appwrite.io/specsinpackage.jsonandbun.lock1.9.xto the references version list and example loadersrc/lib/system.tstolerate a missing optionalPUBLIC_ARENA_ENDPOINTexport in dev[version]Why
There were two related failures in local development:
PUBLIC_ARENA_ENDPOINTwas unset because$env/static/publicdid not export that namegetApiImpact
1.9.xreference assets are available after the specs bumpValidation
curl http://127.0.0.1:4173/docs/references/cloud/client-web/account.mdNotes
gh auth statusis currently invalid in this environment, so the PR was created through the GitHub connector instead of the CLI.Summary by CodeRabbit
New Features
Documentation
Chores