Add Cursor Plugin SDK support#11371
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new CursorPlugin SDK entry to app/config/sdks.php with full metadata (key "cursor-plugin", name, version, URL, flags, family/prism, source, git details, repoBranch, changelog). Updates src/Appwrite/Platform/Tasks/SDKs.php to include "cursor-plugin" in the supported SDKs list and to instantiate CursorPlugin in the SDK generation flow when that language key is used. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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 |
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
app/config/sdks.php (1)
292-310: SDK entry structure is correct; consider markingbeta: truefor an initial 0.1.0 release.The structure mirrors the
agent-skillsentry precisely, and therealpath-basedsource/changelogvalues degrade gracefully when the paths don't exist yet. One minor point: other SDKs at comparable early maturity —react-native,go,dotnet— all carry'beta' => true. Setting'beta' => falsefor a first0.1.0release is slightly inconsistent with that convention.🔧 Optional suggestion
- 'beta' => false, + 'beta' => true,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/config/sdks.php` around lines 292 - 310, The SDK entry for the cursor plugin sets 'beta' => false but should follow the convention of early 0.1.0 SDKs by marking it as beta; update the entry where 'key' => 'cursor-plugin' (or the array with 'name' => 'CursorPlugin' and 'version' => '0.1.0') to set 'beta' => true so it matches other early-maturity SDKs like 'react-native', 'go', and 'dotnet'.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@composer.json`:
- Line 93: Replace the mutable dev branch pin in require-dev for
appwrite/sdk-generator (the entry "appwrite/sdk-generator": "dev-cursor-plugin")
with a stable version constraint (or revert to "*" temporarily) so CI and
contributor installs don't track a live branch; update the composer.json
require-dev entry for appwrite/sdk-generator to a fixed released tag or "*" and
ensure composer.lock is regenerated (run composer update for that package)
before merging.
In `@src/Appwrite/Platform/Tasks/SDKs.php`:
- Around line 7-8: The import statements in SDKs.php are out-of-order: move the
use of CursorPlugin so imports are alphabetized per PSR-12; specifically ensure
the sequence places Apple first, then CLI, then CursorPlugin, then Dart (i.e.,
move use Appwrite\SDK\Language\CursorPlugin to be after the CLI import and
before the Dart import) and adjust any surrounding use lines so all SDK language
imports are in strict alphabetical order.
---
Nitpick comments:
In `@app/config/sdks.php`:
- Around line 292-310: The SDK entry for the cursor plugin sets 'beta' => false
but should follow the convention of early 0.1.0 SDKs by marking it as beta;
update the entry where 'key' => 'cursor-plugin' (or the array with 'name' =>
'CursorPlugin' and 'version' => '0.1.0') to set 'beta' => true so it matches
other early-maturity SDKs like 'react-native', 'go', and 'dotnet'.
✨ Benchmark results
⚡ Benchmark Comparison
|
# Conflicts: # composer.lock # src/Appwrite/Platform/Tasks/SDKs.php
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/config/sdks.php`:
- Around line 303-309: The config entries for the SDK use the 'source' key
pointing to "console-cursor-plugin" and the 'changelog' key pointing to a
cursor-plugin CHANGELOG.md but those targets do not exist so realpath() returns
false; fix by creating the missing SDK source directory named
console-cursor-plugin (with the expected package files) and adding a docs
CHANGELOG.md for cursor-plugin (at the same repo/name used in the config) so
both 'source' and 'changelog' resolve to real paths, or if the intended names
differ, update the 'source' and 'changelog' values in the sdks.php entry for
cursor-plugin to match the actual directory and file names.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
composer.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
app/config/sdks.php
| 'source' => \realpath(__DIR__ . '/../sdks/console-cursor-plugin'), | ||
| 'gitUrl' => '[email protected]:appwrite/cursor-plugin.git', | ||
| 'gitRepoName' => 'cursor-plugin', | ||
| 'gitUserName' => 'appwrite', | ||
| 'gitBranch' => 'dev', | ||
| 'repoBranch' => 'main', | ||
| 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/cursor-plugin/CHANGELOG.md'), |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Checking cursor-plugin config block and referenced paths ==="
rg -n -C2 "cursor-plugin|console-cursor-plugin|docs/sdks/cursor-plugin/CHANGELOG.md" app/config/sdks.php || echo "No matches found"
echo
echo "=== Path existence checks ==="
if [ -d "app/sdks/console-cursor-plugin" ]; then
echo "✓ EXISTS: app/sdks/console-cursor-plugin"
else
echo "✗ MISSING: app/sdks/console-cursor-plugin"
fi
if [ -f "docs/sdks/cursor-plugin/CHANGELOG.md" ]; then
echo "✓ EXISTS: docs/sdks/cursor-plugin/CHANGELOG.md"
else
echo "✗ MISSING: docs/sdks/cursor-plugin/CHANGELOG.md"
fi
echo
echo "=== Listing relevant directories ==="
echo "Contents of app/sdks/:"
ls -la app/sdks/ 2>/dev/null | head -20 || echo "app/sdks/ not found or empty"
echo
echo "Contents of docs/sdks/:"
ls -la docs/sdks/ 2>/dev/null | head -20 || echo "docs/sdks/ not found or empty"Repository: appwrite/appwrite
Length of output: 2398
Both SDK asset paths are missing and will cause realpath() to return false.
Lines 303 and 309 reference paths that do not exist:
app/sdks/console-cursor-plugin— directory missingdocs/sdks/cursor-plugin/CHANGELOG.md— directory and file missing
These missing paths will cause SDK generation and documentation steps to fail. Create both the source directory and CHANGELOG file before merging.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/config/sdks.php` around lines 303 - 309, The config entries for the SDK
use the 'source' key pointing to "console-cursor-plugin" and the 'changelog' key
pointing to a cursor-plugin CHANGELOG.md but those targets do not exist so
realpath() returns false; fix by creating the missing SDK source directory named
console-cursor-plugin (with the expected package files) and adding a docs
CHANGELOG.md for cursor-plugin (at the same repo/name used in the config) so
both 'source' and 'changelog' resolve to real paths, or if the intended names
differ, update the 'source' and 'changelog' values in the sdks.php entry for
cursor-plugin to match the actual directory and file names.
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testDatabaseStatsCollectionsAPI |
1 | 10.02s | Logs |
LegacyCustomClientTest::testInvalidDocumentStructure |
1 | 241.03s | Logs |
TablesDBConsoleClientTest::testCreateIndexes |
1 | 241.87s | Logs |
TablesDBCustomClientTest::testUpdatePermissionsWithEmptyPayload |
1 | 240.23s | Logs |
TablesDBCustomServerTest::testDecrementAttribute |
1 | 240.52s | Logs |
LegacyACIDTest::testConsistency |
1 | 240.74s | Logs |
Commit c1e2d45 - 4 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testDatabaseStatsCollectionsAPI |
1 | 10.17s | Logs |
LegacyCustomServerTest::testInvalidDocumentStructure |
1 | 241.07s | Logs |
TablesDBCustomClientTest::testInvalidDocumentStructure |
1 | 240.72s | Logs |
TablesDBCustomClientTest::testUpdatePermissionsWithEmptyPayload |
1 | 240.29s | Logs |
# Conflicts: # composer.lock
Summary
app/config/sdks.php$supportedSDKSallowlist and switch statement inSDKs.phpappwrite/sdk-generatortodev-cursor-pluginbranch in composerTest plan
docker compose exec appwrite sdks cursor-pluginand verify it generates successfully