Update appwrite/appwrite SDK to ^27.0.0#18
Conversation
Bumps the Appwrite PHP SDK from ^12.0.0 to ^27.0.0 to keep the playground current with upstream (appwrite/appwrite#12895). The v27 SDK hydrates API responses into typed readonly Model objects instead of associative arrays, so the playground now reads returned IDs via property access (`$response->id`) rather than array access (`$response['$id']`). The SDK also requires PHP >=8.2, so the composer constraint and the Dockerfile base image are updated accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Greptile SummaryThis PR upgrades the Appwrite PHP SDK from
Confidence Score: 4/5Safe to merge; the property-access migration is mechanically correct for SDK 27 and no logic is altered beyond the response-field accessor pattern. The cloud function in createFunction() still targets the PHP 8.0 runtime, which is EOL and may no longer be available in the Appwrite server version this SDK targets. If that runtime was retired, the function creation step will fail at runtime. The Dockerfile also switches from a pinned image tag to a floating one, making future builds less reproducible. Both are non-blocking quality concerns with no impact on the core migration logic. playground.php (Runtime::PHP80 usage) and Dockerfile (floating image tag) deserve a second look before merging. Important Files Changed
|
| RUN composer install --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader | ||
|
|
||
| FROM php:8.1.11-alpine3.16 | ||
| FROM php:8.3-alpine |
There was a problem hiding this comment.
The previous base image was pinned to an exact patch version (
php:8.1.11-alpine3.16), making builds fully reproducible. The new tag php:8.3-alpine is a floating tag that silently picks up new PHP 8.3 patch releases and Alpine upgrades. A minor PHP patch could introduce a behavioural change that’s hard to trace back to the image. Pinning to a specific release (e.g. php:8.3.22-alpine3.22) preserves reproducibility.
| FROM php:8.3-alpine | |
| FROM php:8.3.22-alpine3.22 |
Prompt To Fix With AI
This is a comment left during a code review.
Path: Dockerfile
Line: 8
Comment:
The previous base image was pinned to an exact patch version (`php:8.1.11-alpine3.16`), making builds fully reproducible. The new tag `php:8.3-alpine` is a floating tag that silently picks up new PHP 8.3 patch releases and Alpine upgrades. A minor PHP patch could introduce a behavioural change that’s hard to trace back to the image. Pinning to a specific release (e.g. `php:8.3.22-alpine3.22`) preserves reproducibility.
```suggestion
FROM php:8.3.22-alpine3.22
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
What & why
A dependency update in appwrite/appwrite#12895 prompted keeping this playground current with the upstream Appwrite PHP SDK.
The linked upstream PR is a test-only reliability fix (it hardens a flaky realtime execution test) with no public API changes. The substantive work here is bumping the SDK to the latest release and adapting the playground to the SDK's response-model changes that have landed since
^12.0.0.Changes
composer.json— bumpappwrite/appwritefrom^12.0.0to^27.0.0, and the PHP constraint from>=8.0to>=8.2(required by SDK 27).playground.php— SDK 27 hydrates API responses into typed readonly Model objects instead of associative arrays, so returned IDs are now read via property access ($response->id) instead of array access ($response['$id']). Six call sites updated (database, collection, bucket, file, function, async execution).Dockerfile— base image bumped fromphp:8.1.11-alpine3.16tophp:8.3-alpineto satisfy the SDK's PHP>=8.2requirement.Validation
composer installresolves cleanly toappwrite/appwrite 27.0.0.php -lpasses onplayground.phpandglobal.inc.php.Databases,Storage,Users,Functions, plus theRuntime/ExecutionMethodenums).🤖 Generated with Claude Code