Conversation
Add Console PHP SDK entry to the console platform SDK registry, enabling SDK generation for the console PHP target.
📝 WalkthroughWalkthroughA new PHP SDK configuration entry is added to Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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: 1
🧹 Nitpick comments (1)
app/config/sdks.php (1)
307-311: Consider addingrepoBranchto align with other console SDK entries that have valid git remotes.Every other console SDK that has a real
gitUrl(cli,markdown,agent-skills) also declares arepoBranchpointing to the repo's default branch (masterormain).gitBranch: 'dev'appears to be the working/source branch, whilerepoBranchis the upstream branch used for push/deploy. Ifsdk-for-console-php's default branch ismain, omittingrepoBranchmay cause the SDK publish step to push to the wrong branch.💡 Suggested addition
'gitBranch' => 'dev', + 'repoBranch' => 'main', 'changelog' => \realpath(__DIR__ . '/../../docs/sdks/console-php/CHANGELOG.md'),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/config/sdks.php` around lines 307 - 311, Add a repoBranch key for the sdk entry that has 'gitUrl' => 'git@github.com:appwrite/sdk-for-console-php.git' (currently has 'gitBranch' => 'dev') so the upstream default branch is explicitly declared; update the sdk array for 'sdk-for-console-php' to include 'repoBranch' set to the repository's default (e.g., 'main' or 'master') to match other console SDK entries and prevent publish/push from targeting the working 'gitBranch'.
🤖 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`:
- Line 306: The 'source' entry uses realpath(__DIR__ . '/../sdks/console-php')
and returns false because the sdks/console-php directory is missing; either
create/commit that directory or update the config to validate the path: check
is_dir() or realpath() for the console-php SDK and if the entry is enabled
(enabled: true) throw or log a clear error (or set source to null/false only for
intentionally disabled SDKs like objective-c), so consumers never receive a
false value for a supposedly enabled SDK.
---
Nitpick comments:
In `@app/config/sdks.php`:
- Around line 307-311: Add a repoBranch key for the sdk entry that has 'gitUrl'
=> 'git@github.com:appwrite/sdk-for-console-php.git' (currently has 'gitBranch'
=> 'dev') so the upstream default branch is explicitly declared; update the sdk
array for 'sdk-for-console-php' to include 'repoBranch' set to the repository's
default (e.g., 'main' or 'master') to match other console SDK entries and
prevent publish/push from targeting the working 'gitBranch'.
| 'hidden' => true, | ||
| 'family' => APP_SDK_PLATFORM_CONSOLE, | ||
| 'prism' => 'php', | ||
| 'source' => \realpath(__DIR__ . '/../sdks/console-php'), |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the source directory and changelog file referenced by the new Console PHP SDK entry exist.
echo "=== Checking source directory ==="
fd -t d 'console-php' app/sdks 2>/dev/null || echo "Directory not found"
echo ""
echo "=== Checking changelog file ==="
fd -t f 'CHANGELOG.md' docs/sdks/console-php 2>/dev/null || echo "File not found"
echo ""
echo "=== Listing app/sdks directory ==="
ls -la app/sdks 2>/dev/null | head -20 || echo "Directory app/sdks not found"
echo ""
echo "=== Listing docs/sdks directory ==="
ls -la docs/sdks 2>/dev/null | head -20 || echo "Directory docs/sdks not found or is empty"
echo ""
echo "=== Checking GitHub repo URL availability ==="
curl -o /dev/null -s -w "HTTP Status: %{http_code}\n" https://github.com/appwrite/sdk-for-console-php 2>/dev/null || echo "Could not reach GitHub"Repository: appwrite/appwrite
Length of output: 1392
Missing SDK source directory will cause realpath() to return false on an enabled entry.
The app/sdks/console-php directory does not exist. Since realpath() returns false for non-existent paths and this entry is enabled: true, the source field will be silently set to false rather than a valid path. Any code consuming source will receive false instead of a string, causing misconfiguration during SDK generation—unlike explicitly-disabled SDKs (e.g., objective-c) where source => false is intentional. The directory must be created or committed before this configuration is loaded in production.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/config/sdks.php` at line 306, The 'source' entry uses realpath(__DIR__ .
'/../sdks/console-php') and returns false because the sdks/console-php directory
is missing; either create/commit that directory or update the config to validate
the path: check is_dir() or realpath() for the console-php SDK and if the entry
is enabled (enabled: true) throw or log a clear error (or set source to
null/false only for intentionally disabled SDKs like objective-c), so consumers
never receive a false value for a supposedly enabled SDK.
✨ Benchmark results
⚡ Benchmark Comparison
|
Summary
app/config/sdks.phpdocs/sdks/console-php/CHANGELOG.mdfor the new SDKconsole phptarget viadocker compose exec appwrite sdks --platform=console --sdk=phpTest plan
docker compose exec appwrite sdks --platform=console --sdk=php --version=1.8.xand verify SDK generates successfully