Conversation
…nstaller # Conflicts: # src/Appwrite/Platform/Tasks/Install.php
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughReplaced AGENTS.md with new Appwrite-focused project/module and HTTP action documentation. Installer flow: Install.php centralizes completion via an Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Appwrite/Platform/Tasks/Install.php (1)
777-791:⚠️ Potential issue | 🔴 CriticalRemove the unsupported
ipfield from the Growth API payload or update the API.The Growth API analytics endpoint does not accept an
ipfield in the payload. Sending this field will either fail silently or cause errors. Either remove the field from the payload or coordinate an API update to support it.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/Install.php` around lines 777 - 791, The Growth API payload in src/Appwrite/Platform/Tasks/Install.php currently includes an unsupported 'ip' field built from $hostIp inside the $payload array; remove the 'ip' => (...) entry from the $payload construction (or alternatively coordinate updating the Growth API) so the sent payload no longer contains the 'ip' key — update the code that builds $payload in the Install task where $hostIp is computed and referenced to omit the 'ip' element.
🧹 Nitpick comments (2)
AGENTS.md (1)
44-52: Add language specifier to fenced code block.The code block showing module structure should have a language identifier for consistency and to satisfy markdown linting rules. Since this is a directory structure, use
textorplaintext.📝 Suggested fix
-``` +```text Module.php -- registers all services for the module Services/Http.php -- registers HTTP endpoints Services/Workers.php -- registers background workers Services/Tasks.php -- registers CLI tasks Http/{Service}/ -- endpoint actions (Create.php, Get.php, Update.php, Delete.php, XList.php) Workers/ -- worker implementations Tasks/ -- CLI task implementations🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@AGENTS.md` around lines 44 - 52, The fenced code block that lists the module structure lacks a language specifier; update the opening triple-backtick to include a plaintext identifier (e.g., ```text) so the block becomes a labeled plaintext code fence containing the listed lines (Module.php, Services/Http.php, Services/Workers.php, Services/Tasks.php, Http/{Service}/, Workers/, Tasks/).src/Appwrite/Platform/Tasks/Install.php (1)
639-646: Swallowing all exceptions from$onCompletemay hide legitimate errors.While silently catching
\Throwableprevents completion callbacks from breaking the installation flow, it also suppresses any diagnostic information. Consider logging the exception for debugging purposes.📝 Suggested improvement
if ($onComplete) { try { $onComplete(); - } catch (\Throwable) { + } catch (\Throwable $e) { + // Log for debugging but don't fail installation + error_log('onComplete callback failed: ' . $e->getMessage()); } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/Install.php` around lines 639 - 646, The current catch block around $onComplete() swallows all throwables; change it to catch (\Throwable $e) and log the exception before continuing so errors aren't hidden—use the existing logger (e.g. $this->logger or the available logging instance) to call ->error(...) including $e->getMessage() and $e->getTraceAsString() (or pass $e as context) inside the catch, then continue without rethrowing to preserve the current flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/Appwrite/Platform/Tasks/Install.php`:
- Around line 777-791: The Growth API payload in
src/Appwrite/Platform/Tasks/Install.php currently includes an unsupported 'ip'
field built from $hostIp inside the $payload array; remove the 'ip' => (...)
entry from the $payload construction (or alternatively coordinate updating the
Growth API) so the sent payload no longer contains the 'ip' key — update the
code that builds $payload in the Install task where $hostIp is computed and
referenced to omit the 'ip' element.
---
Nitpick comments:
In `@AGENTS.md`:
- Around line 44-52: The fenced code block that lists the module structure lacks
a language specifier; update the opening triple-backtick to include a plaintext
identifier (e.g., ```text) so the block becomes a labeled plaintext code fence
containing the listed lines (Module.php, Services/Http.php,
Services/Workers.php, Services/Tasks.php, Http/{Service}/, Workers/, Tasks/).
In `@src/Appwrite/Platform/Tasks/Install.php`:
- Around line 639-646: The current catch block around $onComplete() swallows all
throwables; change it to catch (\Throwable $e) and log the exception before
continuing so errors aren't hidden—use the existing logger (e.g. $this->logger
or the available logging instance) to call ->error(...) including
$e->getMessage() and $e->getTraceAsString() (or pass $e as context) inside the
catch, then continue without rethrowing to preserve the current flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ebb3edb3-46d3-4644-a4db-7e43d804557c
📒 Files selected for processing (4)
AGENTS.mdsrc/Appwrite/Platform/Installer/Http/Installer/Install.phpsrc/Appwrite/Platform/Installer/Server.phpsrc/Appwrite/Platform/Tasks/Install.php
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
RealtimeConsoleClientTest::testCreateDeployment |
1 | 2.11s | Logs |
UsageTest::testVectorsDBStats |
1 | 10.11s | Logs |
Commit 8b7459f - 2 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.53s | Logs |
AuthTest::testInvalidAuth |
1 | 0ms | Logs |
Commit fe6f79c - 3 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.09s | Logs |
LegacyCustomClientTest::testAttributeResponseModels |
1 | 242.90s | Logs |
LegacyCustomServerTest::testCreatedBefore |
1 | 240.38s | Logs |
Commit 4e32497 - 21 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.34s | Logs |
LegacyConsoleClientTest::testListDocumentsWithCache |
1 | 1.91s | Logs |
LegacyCustomClientTest::testTimeout |
1 | 125.55s | Logs |
LegacyCustomServerTest::testListAttributes |
1 | 240.71s | Logs |
LegacyCustomServerTest::testCreateDocument |
1 | 17ms | Logs |
LegacyCustomServerTest::testListDocuments |
1 | 17ms | Logs |
LegacyCustomServerTest::testListDocumentsWithCache |
1 | 14ms | Logs |
LegacyCustomServerTest::testListDocumentsCacheBustedByAttributeChange |
1 | 12ms | Logs |
LegacyCustomServerTest::testGetDocument |
1 | 13ms | Logs |
LegacyCustomServerTest::testGetDocumentWithQueries |
1 | 14ms | Logs |
LegacyCustomServerTest::testQueryBySequenceType |
1 | 14ms | Logs |
LegacyCustomServerTest::testListDocumentsAfterPagination |
1 | 14ms | Logs |
LegacyCustomServerTest::testListDocumentsBeforePagination |
1 | 13ms | Logs |
LegacyCustomServerTest::testListDocumentsLimitAndOffset |
1 | 13ms | Logs |
LegacyCustomServerTest::testDocumentsListQueries |
1 | 14ms | Logs |
LegacyCustomServerTest::testUpdateDocument |
1 | 13ms | Logs |
LegacyCustomServerTest::testDeleteDocument |
1 | 15ms | Logs |
LegacyCustomServerTest::testDefaultPermissions |
1 | 12ms | Logs |
LegacyCustomServerTest::testPersistentCreatedAt |
1 | 15ms | Logs |
LegacyCustomServerTest::testNotSearch |
1 | 6ms | Logs |
LegacyTransactionsCustomClientTest::testPartialFailureRollback |
1 | 240.40s | Logs |
Commit 7e49cf0 - 2 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.09s | Logs |
RealtimeConsoleClientTest::testCreateDeployment |
1 | 2.12s | Logs |
Note: Flaky test results are tracked for the last 5 commits
Greptile SummaryThis PR fixes several bugs in the web installer flow, primarily around coroutine support and SSE stream timing. The core change moves completion signaling (SSE Key changes:
Confidence Score: 5/5Safe to merge — no new P0/P1 issues introduced; all meaningful concerns were raised in prior review threads. All changed files are in the installer path only (no production API surface affected). The No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Revert "(fix): increase GraphQL schema p..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/Appwrite/Platform/Tasks/Install.php (1)
775-789: Minor:gethostbyname()never returnsfalse.The function returns the unmodified hostname on failure rather than
false. The check$hostIp !== $domainis sufficient.🔧 Simplified check
$hostIp = `@gethostbyname`($domain); ... -'hostIp' => ($hostIp !== false && $hostIp !== $domain) ? $hostIp : null, +'hostIp' => ($hostIp !== $domain) ? $hostIp : null,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/Install.php` around lines 775 - 789, The check for DNS resolution uses gethostbyname($domain) which never returns false, so update the condition that sets 'hostIp' in the payload (in Install.php where $hostIp is assigned and used) to only test whether $hostIp differs from $domain; remove the redundant !== false check and set hostIp to null when $hostIp === $domain, i.e. replace the current ($hostIp !== false && $hostIp !== $domain) logic with a single ($hostIp !== $domain) check so unresolved hostnames yield null.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/Appwrite/Platform/Tasks/Install.php`:
- Around line 775-789: The check for DNS resolution uses gethostbyname($domain)
which never returns false, so update the condition that sets 'hostIp' in the
payload (in Install.php where $hostIp is assigned and used) to only test whether
$hostIp differs from $domain; remove the redundant !== false check and set
hostIp to null when $hostIp === $domain, i.e. replace the current ($hostIp !==
false && $hostIp !== $domain) logic with a single ($hostIp !== $domain) check so
unresolved hostnames yield null.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8bfedd10-96c4-43d4-8666-30706e9feb66
📒 Files selected for processing (1)
src/Appwrite/Platform/Tasks/Install.php
✨ Benchmark results
⚡ Benchmark Comparison
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/Appwrite/Platform/Tasks/Install.php (2)
775-789: The!== falsecheck is unnecessary forgethostbyname().PHP's
gethostbyname()returns the original hostname string on failure, neverfalse. The check$hostIp !== falseis always true.♻️ Simplified condition
$hostIp = `@gethostbyname`($domain); $payload = [ ... - 'ip' => ($hostIp !== false && $hostIp !== $domain) ? $hostIp : null, + 'ip' => ($hostIp !== $domain) ? $hostIp : null, ... ];🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/Install.php` around lines 775 - 789, The ip assignment logic uses gethostbyname($domain) and checks "$hostIp !== false", but gethostbyname never returns false (it returns the original hostname on failure), so update the condition that builds the payload 'ip' field in Install:: (variable $hostIp and the payload array) to only check that $hostIp is not equal to the original $domain (or is a valid IP) — remove the redundant !== false check and use a single clear test like ($hostIp !== $domain) or PHP's filter_var($hostIp, FILTER_VALIDATE_IP) to set the 'ip' value or null.
639-656: Silently swallowing exceptions in$onCompletemay hide lock-release failures.Per the context,
$onCompletecontains critical logic including$state->updateGlobalLock(). If the lock update fails, the exception is caught and ignored, potentially leaving the installer in a locked state for subsequent runs.Consider logging the exception or at least preserving it for debugging:
💡 Proposed enhancement to log swallowed exceptions
if ($onComplete) { try { $onComplete(); } catch (\Throwable) { + // Lock update or response finalization failed - log for debugging + // Consider: Console::warning('onComplete callback failed: ' . $e->getMessage()); } }The coroutine-wrapped tracking logic is correct —
go()is only called when inside a Swoole context (Coroutine::getCid() !== -1), otherwise tracking runs synchronously.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Appwrite/Platform/Tasks/Install.php` around lines 639 - 656, The current try/catch around invoking the $onComplete callback swallows all exceptions (which may include failures from $state->updateGlobalLock()), so update the catch to record the error instead of ignoring it: catch the Throwable as $e and log it (e.g. via $this->logger->error(...) or a suitable logger/error_log) with context indicating it occurred in the $onComplete callback and include $e->getMessage() and stack trace; alternatively rethrow or store the exception for higher-level handling—locate the invocation of $onComplete in Install.php and update that try/catch accordingly (leave the coroutine handling and trackSelfHostedInstall calls unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/Appwrite/Platform/Tasks/Install.php`:
- Around line 775-789: The ip assignment logic uses gethostbyname($domain) and
checks "$hostIp !== false", but gethostbyname never returns false (it returns
the original hostname on failure), so update the condition that builds the
payload 'ip' field in Install:: (variable $hostIp and the payload array) to only
check that $hostIp is not equal to the original $domain (or is a valid IP) —
remove the redundant !== false check and use a single clear test like ($hostIp
!== $domain) or PHP's filter_var($hostIp, FILTER_VALIDATE_IP) to set the 'ip'
value or null.
- Around line 639-656: The current try/catch around invoking the $onComplete
callback swallows all exceptions (which may include failures from
$state->updateGlobalLock()), so update the catch to record the error instead of
ignoring it: catch the Throwable as $e and log it (e.g. via
$this->logger->error(...) or a suitable logger/error_log) with context
indicating it occurred in the $onComplete callback and include $e->getMessage()
and stack trace; alternatively rethrow or store the exception for higher-level
handling—locate the invocation of $onComplete in Install.php and update that
try/catch accordingly (leave the coroutine handling and trackSelfHostedInstall
calls unchanged).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5ed736f4-c240-4241-90cf-b14bcd81f1ee
📒 Files selected for processing (4)
app/views/install/installer/css/styles.cssapp/views/install/installer/templates/steps/step-4.phtmlapp/views/install/installer/templates/steps/step-5.phtmlsrc/Appwrite/Platform/Tasks/Install.php
✅ Files skipped from review due to trivial changes (3)
- app/views/install/installer/templates/steps/step-5.phtml
- app/views/install/installer/css/styles.css
- app/views/install/installer/templates/steps/step-4.phtml
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…xpectations" This reverts commit 4e32497.
|
Found 1 test failure on Blacksmith runners: Failure
|
What does this PR do?
(Provide a description of what this PR does and why it's needed.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)
Related PRs and Issues
Checklist