[codex] Move static SDKs off platform specs#11664
Conversation
📝 WalkthroughWalkthroughThis change introduces a new SDK platform called "static" to replace the Markdown SDK support within the console platform. The update adds a new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Additional notesThe changes involve coordination across three files: constant definition, configuration restructuring, and task logic updates. The key complexity lies in the conditional spec handling logic in 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Greptile SummaryThis PR cleanly decouples
Confidence Score: 5/5Safe to merge — all changes are well-scoped, the new static platform path is logically correct, and no existing generation flows are affected. All findings are P2: the No files require special attention; the minor Important Files Changed
|
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.04s | Logs |
LegacyConsoleClientTest::testUpsertDocument |
1 | 245.61s | Logs |
LegacyConsoleClientTest::testOneToManyRelationship |
1 | 240.90s | Logs |
LegacyCustomClientTest::testListDocumentsWithCache |
1 | 415ms | Logs |
LegacyCustomServerTest::testListDocumentsWithCache |
1 | 864ms | Logs |
LegacyTransactionsCustomServerTest::testUpdateDocument |
1 | 240.59s | Logs |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/config/sdks.php (1)
267-267:⚠️ Potential issue | 🟡 MinorUse canonical browser URLs in
url.In
src/Appwrite/Platform/Tasks/SDKs.php, Line 205 builds release links from{$language['url']}/releases, and Line 472 exposesurlas the public repo link. Keeping the clone suffix here produces non-canonical...git/releasesURLs in generated output. Keep.gitonly ingitUrl.💡 Suggested fix
- 'url' => 'https://github.com/appwrite/agent-skills.git', + 'url' => 'https://github.com/appwrite/agent-skills', - 'url' => 'https://github.com/appwrite/cursor-plugin.git', + 'url' => 'https://github.com/appwrite/cursor-plugin',Also applies to: 287-287
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/config/sdks.php` at line 267, The repo URL entries include the ".git" clone suffix which causes non-canonical release and public links; update the SDKs configuration so the 'url' values are the browser-facing repository URLs (remove the trailing ".git") while keeping the cloneable address only in 'gitUrl' (leave 'gitUrl' with ".git"); locate the SDKs class that builds release links (the SDKs task that concatenates "{$language['url']}/releases") and replace the '.git' suffixed 'url' entries (e.g., the 'url' keys currently ending with ".git") with their canonical browser equivalents, ensuring any code that expects the clone URL uses 'gitUrl' instead.
🧹 Nitpick comments (1)
src/Appwrite/Platform/Tasks/SDKs.php (1)
177-178: Let the platform provide the default spec format.
staticis now modeled as a platform, but this still defaults per SDK toswagger2. If a future entry is added underAPP_SDK_PLATFORM_STATICwithout its own'spec' => 'static', Lines 184-187 will start looking forswagger2-{$version}-static.json. Reading$platform['spec']first would remove that drift.♻️ Suggested direction
- $specFormat = $language['spec'] ?? 'swagger2'; + $specFormat = $language['spec'] ?? $platform['spec'] ?? 'swagger2';Then set
'spec' => 'static'once on theAPP_SDK_PLATFORM_STATICblock inapp/config/sdks.php.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/SDKs.php` around lines 177 - 178, Currently $spec is defaulted from $language['spec'] to 'swagger2' causing platform-level spec (e.g., $platform['spec']) to be ignored; change the lookup to prefer $platform['spec'] first, then $language['spec'], then fallback to 'swagger2' so platforms like APP_SDK_PLATFORM_STATIC can supply 'static' as the default. Update the code that sets $spec (refer to the variables $platform and $language inside the SDK generation flow in SDKs.php) to check $platform['spec'] ?? $language['spec'] ?? 'swagger2' and keep the rest of the logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 450-460: The code instantiates a missing class StaticSpec when
specFormat === 'static' (inside the SDK construction near SDK, specFormat and
Swagger2 usage); this will cause a fatal error because Appwrite\Spec\StaticSpec
is not provided by the current dependencies. Fix by replacing the StaticSpec
instantiation with an available spec implementation or implement a local
StaticSpec class: either update dependency to a version that provides
Appwrite\Spec\StaticSpec and update imports, or create a new
Appwrite\Spec\StaticSpec class locally (matching the constructor signature used
here: title, description, version, licenseName, licenseURL) and import it where
SDK is constructed so the ternary branch uses a valid class when specFormat ===
'static'.
---
Outside diff comments:
In `@app/config/sdks.php`:
- Line 267: The repo URL entries include the ".git" clone suffix which causes
non-canonical release and public links; update the SDKs configuration so the
'url' values are the browser-facing repository URLs (remove the trailing ".git")
while keeping the cloneable address only in 'gitUrl' (leave 'gitUrl' with
".git"); locate the SDKs class that builds release links (the SDKs task that
concatenates "{$language['url']}/releases") and replace the '.git' suffixed
'url' entries (e.g., the 'url' keys currently ending with ".git") with their
canonical browser equivalents, ensuring any code that expects the clone URL uses
'gitUrl' instead.
---
Nitpick comments:
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 177-178: Currently $spec is defaulted from $language['spec'] to
'swagger2' causing platform-level spec (e.g., $platform['spec']) to be ignored;
change the lookup to prefer $platform['spec'] first, then $language['spec'],
then fallback to 'swagger2' so platforms like APP_SDK_PLATFORM_STATIC can supply
'static' as the default. Update the code that sets $spec (refer to the variables
$platform and $language inside the SDK generation flow in SDKs.php) to check
$platform['spec'] ?? $language['spec'] ?? 'swagger2' and keep the rest of the
logic unchanged.
🪄 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: 870c898f-bef2-4557-8a00-9706e305e2e0
⛔ Files ignored due to path filters (2)
composer.lockis excluded by!**/*.lockdocs/sdks/markdown/CHANGELOG.mdis excluded by!docs/sdks/**
📒 Files selected for processing (3)
app/config/sdks.phpapp/init/constants.phpsrc/Appwrite/Platform/Tasks/SDKs.php
✨ Benchmark results
⚡ Benchmark Comparison
|
Summary
This updates SDK generation so
agent-skillsandcursor-pluginno longer depend on platform Swagger specs.What changed
staticSDK platform and movedagent-skillsandcursor-plugininto itapp/config/sdks.phpand useStaticSpeclatestexample runs end cleanlycomposer.lockupdate forutopia-php/dns1.6.5->1.6.6Why
agent-skillsandcursor-plugindo not use the platform-specific generated specs, so keeping them tied to console Swagger generation was unnecessary. Moving them to a static platform removes that dependency and makes the generation path clearer.Impact
php app/cli.php sdks --platform=static --sdk=agent-skills --version=latest --git=no --mode=examplesnow works without requiring generated Swagger filesphp app/cli.php sdks --platform=static --sdk=cursor-plugin --version=latest --git=no --mode=examplesnow works the same wayValidation
php -l app/init/constants.phpphp -l app/config/sdks.phpphp -l src/Appwrite/Platform/Tasks/SDKs.phpphp app/cli.php sdks --platform=static --sdk=agent-skills --version=latest --git=no --mode=examplesphp app/cli.php sdks --platform=static --sdk=cursor-plugin --version=latest --git=no --mode=examplesphp app/cli.php sdks --platform=console --sdk=cli --version=latest --git=no --mode=examples