Skip to content

feat: add console PHP SDK configuration#11361

Open
premtsd-code wants to merge 1 commit into1.8.xfrom
feat-add-console-php-sdk-config
Open

feat: add console PHP SDK configuration#11361
premtsd-code wants to merge 1 commit into1.8.xfrom
feat-add-console-php-sdk-config

Conversation

@premtsd-code
Copy link

Summary

  • Add Console PHP SDK entry to the console platform SDK registry in app/config/sdks.php
  • Add docs/sdks/console-php/CHANGELOG.md for the new SDK
  • Enables SDK generation for the console php target via docker compose exec appwrite sdks --platform=console --sdk=php

Test plan

  • Run docker compose exec appwrite sdks --platform=console --sdk=php --version=1.8.x and verify SDK generates successfully
  • Verify existing SDK generation for other platforms is unaffected

Add Console PHP SDK entry to the console platform SDK registry,
enabling SDK generation for the console PHP target.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

Walkthrough

A new PHP SDK configuration entry is added to app/config/sdks.php under the Console platform SDKs list. The entry includes metadata (name "Console PHP", version "0.0.1", URLs, package information), PHP-specific configuration (composer vendor and package identifiers, prism type), repository details (GitHub URL, branch information), source directory path, and changelog reference location. The entry is enabled and marked as hidden. No existing logic or control flow is altered.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat: add console PHP SDK configuration' accurately describes the main change—adding a new Console PHP SDK entry to the configuration file.
Description check ✅ Passed The pull request description clearly relates to the changeset by explaining the addition of Console PHP SDK configuration, the changelog file, and SDK generation capabilities.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-add-console-php-sdk-config

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
libecpg 18.1-r0 CVE-2026-2004 HIGH
libecpg 18.1-r0 CVE-2026-2005 HIGH
libecpg 18.1-r0 CVE-2026-2006 HIGH
libecpg 18.1-r0 CVE-2026-2007 HIGH
libecpg-dev 18.1-r0 CVE-2026-2004 HIGH
libecpg-dev 18.1-r0 CVE-2026-2005 HIGH
libecpg-dev 18.1-r0 CVE-2026-2006 HIGH
libecpg-dev 18.1-r0 CVE-2026-2007 HIGH
libpq 18.1-r0 CVE-2026-2004 HIGH
libpq 18.1-r0 CVE-2026-2005 HIGH
libpq 18.1-r0 CVE-2026-2006 HIGH
libpq 18.1-r0 CVE-2026-2007 HIGH
libpq-dev 18.1-r0 CVE-2026-2004 HIGH
libpq-dev 18.1-r0 CVE-2026-2005 HIGH
libpq-dev 18.1-r0 CVE-2026-2006 HIGH
libpq-dev 18.1-r0 CVE-2026-2007 HIGH
postgresql18-dev 18.1-r0 CVE-2026-2004 HIGH
postgresql18-dev 18.1-r0 CVE-2026-2005 HIGH
postgresql18-dev 18.1-r0 CVE-2026-2006 HIGH
postgresql18-dev 18.1-r0 CVE-2026-2007 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/config/sdks.php (1)

307-311: Consider adding repoBranch to 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 a repoBranch pointing to the repo's default branch (master or main). gitBranch: 'dev' appears to be the working/source branch, while repoBranch is the upstream branch used for push/deploy. If sdk-for-console-php's default branch is main, omitting repoBranch may 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'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.

@github-actions
Copy link

✨ Benchmark results

  • Requests per second: 1,706
  • Requests with 200 status code: 307,130
  • P99 latency: 0.095827363

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,706 1,017
200 307,130 183,154
P99 0.095827363 0.230872516

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant