Conversation
📝 WalkthroughWalkthroughThis PR updates SDK version literals in app/config/platforms.php:
It also extends src/Appwrite/Platform/Tasks/SDKs.php by adding a new CLI option/parameter Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 2 inconclusive)
✨ 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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
composer.lockis excluded by!**/*.lockdocs/sdks/apple/CHANGELOG.mdis excluded by!docs/sdks/**docs/sdks/cli/CHANGELOG.mdis excluded by!docs/sdks/**docs/sdks/flutter/CHANGELOG.mdis excluded by!docs/sdks/**docs/sdks/python/CHANGELOG.mdis excluded by!docs/sdks/**
📒 Files selected for processing (1)
app/config/platforms.php(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Setup & Build Appwrite Image
- GitHub Check: Setup & Build Appwrite Image
- GitHub Check: scan
✨ Benchmark results
⚡ Benchmark Comparison
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (7)
composer.lockis excluded by!**/*.lockdocs/examples/1.8.x/console-cli/examples/migrations/create-csv-export.mdis excluded by!docs/examples/**docs/examples/1.8.x/console-cli/examples/migrations/create-csv-import.mdis excluded by!docs/examples/**docs/sdks/apple/CHANGELOG.mdis excluded by!docs/sdks/**docs/sdks/cli/CHANGELOG.mdis excluded by!docs/sdks/**docs/sdks/flutter/CHANGELOG.mdis excluded by!docs/sdks/**docs/sdks/python/CHANGELOG.mdis excluded by!docs/sdks/**
📒 Files selected for processing (2)
app/config/platforms.php(4 hunks)src/Appwrite/Platform/Tasks/SDKs.php(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- app/config/platforms.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: E2E Service Test (VCS)
- GitHub Check: E2E Service Test (Projects)
- GitHub Check: E2E Service Test (Tokens)
- GitHub Check: E2E Service Test (Sites)
- GitHub Check: E2E Service Test (Storage)
- GitHub Check: E2E Service Test (Health)
- GitHub Check: E2E Service Test (Locale)
- GitHub Check: E2E Service Test (Teams)
- GitHub Check: E2E Service Test (FunctionsSchedule)
- GitHub Check: E2E Service Test (Databases/Legacy)
- GitHub Check: E2E Service Test (Databases/TablesDB)
- GitHub Check: E2E Service Test (Console)
- GitHub Check: E2E Service Test (Functions)
- GitHub Check: E2E Service Test (Account)
- GitHub Check: E2E Service Test (Site Screenshots)
- GitHub Check: E2E Service Test (Dev Keys)
- GitHub Check: Unit Test
- GitHub Check: E2E General Test
- GitHub Check: Benchmark
- GitHub Check: scan
| if (!$sdks) { | ||
| $selectedPlatform ??= Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):'); | ||
| $selectedSDK ??= \strtolower(Console::confirm('Choose SDK ("*" for all):')); | ||
| } else { | ||
| $sdks = explode(',', $sdks); | ||
| } |
There was a problem hiding this comment.
Normalize --sdks input so filtered runs actually execute
Right now we keep raw tokens from explode(',', $sdks). If a user runs --sdks cli, python (note the space) or uses capitalisation (--sdks Flutter), the resulting entries are ' python'/'Flutter'. Both fail the subsequent in_array($language['key'], $sdks) check because the platform keys are lowercase without leading spaces, so nothing gets generated. The interactive path still lowercases via strtolower, so this is a regression for the new CLI flag. Please trim and lowercase the parsed tokens (and drop empties) before using them.
- $sdks = explode(',', $sdks);
+ $sdks = array_values(array_filter(array_map(
+ static fn(string $sdk): string => strtolower(trim($sdk)),
+ explode(',', $sdks)
+ )));📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (!$sdks) { | |
| $selectedPlatform ??= Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):'); | |
| $selectedSDK ??= \strtolower(Console::confirm('Choose SDK ("*" for all):')); | |
| } else { | |
| $sdks = explode(',', $sdks); | |
| } | |
| if (!$sdks) { | |
| $selectedPlatform ??= Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):'); | |
| $selectedSDK ??= \strtolower(Console::confirm('Choose SDK ("*" for all):')); | |
| } else { | |
| $sdks = array_values(array_filter(array_map( | |
| static fn(string $sdk): string => strtolower(trim($sdk)), | |
| explode(',', $sdks) | |
| ))); | |
| } |
🤖 Prompt for AI Agents
In src/Appwrite/Platform/Tasks/SDKs.php around lines 57 to 62, the parsed --sdks
tokens from explode(',', $sdks) are not normalized so values with spaces or
capitalization won't match platform keys; replace the current explode with a
pipeline that explodes on comma, trims each token, lowercases each token, and
filters out empty strings (e.g. explode -> array_map('trim', ...) ->
array_map('strtolower', ...) -> array_filter(...)), then assign the resulting
array back to $sdks so subsequent in_array checks work correctly.
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
docs/sdks/cli/CHANGELOG.mdis excluded by!docs/sdks/**
📒 Files selected for processing (1)
app/config/platforms.php(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: Benchmark
- GitHub Check: E2E Service Test (Projects)
- GitHub Check: E2E Service Test (GraphQL)
- GitHub Check: E2E Service Test (Messaging)
- GitHub Check: E2E Service Test (Migrations)
- GitHub Check: E2E Service Test (Tokens)
- GitHub Check: E2E Service Test (FunctionsSchedule)
- GitHub Check: E2E Service Test (Locale)
- GitHub Check: E2E Service Test (Functions)
- GitHub Check: E2E Service Test (Sites)
- GitHub Check: E2E Service Test (Storage)
- GitHub Check: E2E Service Test (Health)
- GitHub Check: E2E Service Test (Databases/Legacy)
- GitHub Check: E2E Service Test (Databases/TablesDB)
- GitHub Check: E2E Service Test (Console)
- GitHub Check: E2E Service Test (Account)
- GitHub Check: E2E Service Test (Dev Keys)
- GitHub Check: E2E Service Test (Site Screenshots)
- GitHub Check: E2E General Test
- GitHub Check: scan
No description provided.