Skip to content

Feat: Custom start commands#10842

Merged
Meldiron merged 4 commits intofeat-1.8.x-new-schemafrom
feat-custom-start-commands
Nov 24, 2025
Merged

Feat: Custom start commands#10842
Meldiron merged 4 commits intofeat-1.8.x-new-schemafrom
feat-custom-start-commands

Conversation

@Meldiron
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds custom start commands, for sites only right now

Test Plan

New tests

Related PRs and Issues

x

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 19, 2025

📝 Walkthrough

Walkthrough

This pull request introduces support for custom start commands across Functions and Sites deployments. The feature adds a new startCommand field to the database schema for deployments, exposes it as a public API parameter for site creation and updates, propagates it through deployment creation workflows (including template, duplicate, and standard deployments), and implements logic to prepend a directory-change instruction when executing the custom start command. The change includes a new end-to-end test with an Astro site sample that demonstrates the feature.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Schema consistency: Verify that startCommand is correctly added to all three collection contexts in app/config/collections/projects.php (sites, deployments, deployments alternate) with matching field configurations
  • Command execution logic: Review the conditional prepending of cd /usr/local/server/src/function/ && in Functions/Http/Executions/Create.php and src/Appwrite/Platform/Workers/Functions.php to ensure proper shell escaping and correct precedence relative to other command transformations
  • API parameter propagation: Verify that startCommand parameter flows correctly through all deployment creation paths (Functions/Http/Deployments/Create.php, Duplicate/Create.php, Template/Create.php, Sites equivalents, and Sites/Http/Sites/Create.php/Update.php)
  • Update signature changes: Check that the new $startCommand parameter in Sites/Http/Sites/Update.php::action() is properly integrated with the comparison logic for determining if a redeploy is required
  • Test coverage: Ensure the new test method testSiteCustomStartCommand() in SitesCustomServerTest.php adequately exercises the custom start command path and that test fixtures are properly configured

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.76% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Feat: Custom start commands' directly and clearly describes the main feature addition in the changeset: introducing custom start command functionality.
Description check ✅ Passed The description is related to the changeset; it explains that the PR adds custom start commands for sites with new tests included, which aligns with the code changes shown.
✨ 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-custom-start-commands

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
Copy Markdown

github-actions bot commented Nov 19, 2025

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
imagemagick 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-c++ 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-dev 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-heic 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-jpeg 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-jxl 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-libs 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-openexr 7.1.2.3-r0 CVE-2025-62171 HIGH
imagemagick-webp 7.1.2.3-r0 CVE-2025-62171 HIGH
libecpg 17.6-r0 CVE-2025-12818 HIGH
libecpg-dev 17.6-r0 CVE-2025-12818 HIGH
libpq 17.6-r0 CVE-2025-12818 HIGH
libpq-dev 17.6-r0 CVE-2025-12818 HIGH
libxml2 2.13.8-r0 CVE-2025-49794 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49796 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49795 HIGH
libxml2 2.13.8-r0 CVE-2025-6021 HIGH
postgresql17-dev 17.6-r0 CVE-2025-12818 HIGH
github.com/containerd/containerd/v2 v2.0.2 CVE-2024-25621 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH
golang.org/x/oauth2 v0.24.0 CVE-2025-22868 HIGH
stdlib 1.22.10 CVE-2025-47907 HIGH
stdlib 1.22.10 CVE-2025-58183 HIGH
stdlib 1.22.10 CVE-2025-58186 HIGH
stdlib 1.22.10 CVE-2025-58187 HIGH
stdlib 1.22.10 CVE-2025-58188 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

Copy link
Copy Markdown
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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/controllers/api/vcs.php (1)

1781-1829: createGitDeployments call uses outdated signature (runtime fatal)

The $createGitDeployments closure now expects many more parameters (providerBranchUrl, repo metadata, commit details, etc.), but this call still passes only the older subset:

$createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerCommitHash, $providerPullRequestId, true, $dbForPlatform, $queueForBuilds, $getProjectDB, $request);

This will throw an argument count error as soon as this endpoint is exercised.

You need to either (a) extend this endpoint to derive the additional metadata from $pullRequestResponse (similar to the webhook EVENT_PULL_REQUEST path above) and pass them through, or (b) refactor createGitDeployments so the new parameters are optional/defaulted and compatible with this call site.

A sketch using the same pattern as the webhook handler:

-        $providerBranch = \explode(':', $pullRequestResponse['head']['label'])[1] ?? '';
-        $providerCommitHash = $pullRequestResponse['head']['sha'] ?? '';
-
-        $createGitDeployments($github, $providerInstallationId, $repositories, $providerBranch, $providerCommitHash, $providerPullRequestId, true, $dbForPlatform, $queueForBuilds, $getProjectDB, $request);
+        $providerBranch = \explode(':', $pullRequestResponse['head']['label'])[1] ?? '';
+        $providerCommitHash = $pullRequestResponse['head']['sha'] ?? '';
+
+        // Derive these similarly to the webhook EVENT_PULL_REQUEST logic above:
+        $providerRepositoryName = /* from $pullRequestResponse or $repositoryName */;
+        $providerRepositoryOwner = /* from $pullRequestResponse or $owner */;
+        $providerRepositoryUrl  = /* https://github.com/$providerRepositoryOwner/$providerRepositoryName */;
+        $providerBranchUrl      = /* $providerRepositoryUrl . '/tree/' . $providerBranch */;
+        $providerCommitAuthor   = /* from $github->getCommit(...) if needed */;
+        $providerCommitAuthorUrl = /* from commit details or payload */;
+        $providerCommitMessage  = /* from commit details or payload */;
+        $providerCommitUrl      = /* from commit details or payload */;
+
+        $createGitDeployments(
+            $github,
+            $providerInstallationId,
+            $repositories,
+            $providerBranch,
+            $providerBranchUrl,
+            $providerRepositoryName,
+            $providerRepositoryUrl,
+            $providerRepositoryOwner,
+            $providerCommitHash,
+            $providerCommitAuthor,
+            $providerCommitAuthorUrl,
+            $providerCommitMessage,
+            $providerCommitUrl,
+            $providerPullRequestId,
+            true,
+            $dbForPlatform,
+            $queueForBuilds,
+            $getProjectDB,
+            $request
+        );

Adjust the /* ... */ placeholders to match however your GitHub adapter structures the PR and commit data.

🧹 Nitpick comments (2)
src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php (1)

398-402: Deployment-level startCommand override is wired correctly

Using the runtime’s startCommand as a default and overriding with deployment.startCommand (with a cd /usr/local/server/src/function/ && prefix) is consistent and keeps backward compatibility; only minor nit is the duplicated getAttribute call, which could be hoisted into a local variable if you ever touch this again.

tests/resources/sites/astro-custom-start-command/custom-server.js (1)

12-14: Misleading catch-all error handler.

The catch-all middleware returns a 500 status code for all unmatched requests, which typically indicates a server error. However, this handler will also catch legitimate 404 (Not Found) cases. For a test fixture, this might be intentional, but it's worth noting that a more accurate implementation would use a 404 status code for unmatched routes.

If this behavior is intentional for testing error handling, consider adding a comment. Otherwise, consider this alternative:

 app.use((_req, res) => {
-  res.status(500).send('Custom error');
+  res.status(404).send('Not found');
 });
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4616a2e and f907f76.

⛔ Files ignored due to path filters (1)
  • tests/resources/sites/astro-custom-start-command/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (24)
  • app/config/collections/projects.php (3 hunks)
  • app/controllers/api/vcs.php (1 hunks)
  • app/controllers/general.php (1 hunks)
  • src/Appwrite/Platform/Modules/Compute/Base.php (2 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php (2 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php (2 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php (3 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php (3 hunks)
  • src/Appwrite/Platform/Workers/Functions.php (1 hunks)
  • src/Appwrite/Utopia/Response/Model/Func.php (1 hunks)
  • src/Appwrite/Utopia/Response/Model/Site.php (1 hunks)
  • tests/e2e/Services/Sites/SitesCustomServerTest.php (1 hunks)
  • tests/resources/sites/astro-custom-start-command/.gitignore (1 hunks)
  • tests/resources/sites/astro-custom-start-command/astro.config.mjs (1 hunks)
  • tests/resources/sites/astro-custom-start-command/custom-server.js (1 hunks)
  • tests/resources/sites/astro-custom-start-command/package.json (1 hunks)
  • tests/resources/sites/astro-custom-start-command/src/pages/index.astro (1 hunks)
  • tests/resources/sites/astro-custom-start-command/src/pages/ssr.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (5)
src/Appwrite/Utopia/Response/Model/Func.php (1)
src/Appwrite/Utopia/Response/Model.php (1)
  • addRule (90-102)
src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php (1)
src/Appwrite/GraphQL/Types/Mapper.php (1)
  • param (255-363)
tests/e2e/Services/Sites/SitesCustomServerTest.php (2)
tests/e2e/Services/Sites/SitesBase.php (6)
  • setupSite (21-34)
  • setupSiteDomain (369-387)
  • setupDeployment (36-83)
  • packageSite (239-251)
  • getSiteDomain (389-410)
  • cleanupSite (85-94)
tests/e2e/Client.php (2)
  • Client (8-342)
  • setEndpoint (140-145)
src/Appwrite/Utopia/Response/Model/Site.php (1)
src/Appwrite/Utopia/Response/Model.php (1)
  • addRule (90-102)
src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php (1)
src/Appwrite/GraphQL/Types/Mapper.php (1)
  • param (255-363)
⏰ 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
🔇 Additional comments (19)
tests/resources/sites/astro-custom-start-command/.gitignore (1)

1-24: .gitignore patterns are appropriate for the Astro test fixture

Covers build output, dependencies, logs, env files, and local OS/IDE artifacts; nothing concerning here.

app/config/collections/projects.php (3)

768-779: Function collection gains startCommand in a schema-consistent way

The functions.startCommand attribute mirrors the nearby entrypoint/commands fields (string, large size, optional, scalar). The comment noting it’s currently unused by runtimes is helpful and harmless.


1050-1060: Site collection startCommand field matches existing command fields

Defining sites.startCommand as an optional long string right after installCommand/buildCommand keeps the schema coherent and enables site-level start command configuration without impacting existing data.


1383-1393: Deployment-level startCommand field is aligned with build metadata

Adding deployments.startCommand next to buildCommands/buildOutput is consistent with how deployment configuration is stored, and matches how other modules now read startCommand from deployments.

app/controllers/api/vcs.php (1)

295-309: Persisting startCommand into VCS-created deployments looks correct

Threading $resource->getAttribute('startCommand', '') into the deployments created from VCS repositories keeps these flows consistent with other deployment-creation paths that now carry startCommand.

src/Appwrite/Platform/Modules/Sites/Http/Deployments/Duplicate/Create.php (1)

104-134: Duplicate site deployments correctly carry over startCommand

Using $site->getAttribute('startCommand', '') when creating the duplicate deployment keeps custom start commands in sync with current site configuration, just like outputDirectory and adapter.

src/Appwrite/Platform/Modules/Functions/Http/Deployments/Duplicate/Create.php (1)

101-115: Function duplicate deployments now include startCommand

Populating startCommand from the function when duplicating a deployment aligns with how entrypoint and commands are taken, so any future function-level custom start commands won’t be lost on rebuild.

src/Appwrite/Utopia/Response/Model/Site.php (1)

128-133: API model exposes startCommand with sensible defaults

The new startCommand rule (string, empty default, example command) fits cleanly alongside installCommand/buildCommand and makes the feature visible in the public Site model without changing existing behavior.

src/Appwrite/Platform/Modules/Compute/Base.php (2)

97-128: VCS function redeploys preserve startCommand

Including 'startCommand' => $function->getAttribute('startCommand', '') in the deployment document ensures redeploys triggered via VCS keep any configured start command in sync with the function.


195-228: VCS site redeploys also persist startCommand

Adding startCommand alongside buildCommands/buildOutput for site deployments keeps the VCS redeploy path aligned with the rest of the site deployment stack and with the new schema fields.

tests/resources/sites/astro-custom-start-command/src/pages/index.astro (1)

1-16: LGTM! Simple test resource page.

This is a straightforward Astro page serving as a test fixture for the custom start command feature. The minimal structure is appropriate for testing purposes.

tests/resources/sites/astro-custom-start-command/astro.config.mjs (1)

1-10: LGTM! Appropriate Astro configuration for custom server test.

This Astro configuration correctly sets up the Node adapter in middleware mode, which is necessary for the custom Express server implementation in custom-server.js. The middleware mode allows the SSR handler to be mounted as Express middleware, enabling the custom routes and error handling in the test fixture.

src/Appwrite/Platform/Modules/Sites/Http/Deployments/Template/Create.php (1)

166-166: Code is correct — startCommand is properly populated during site lifecycle.

Verification confirms that the startCommand attribute is appropriately initialized and maintained:

  • Site creation (Sites/Create.php line 155) stores the user-provided startCommand
  • Site updates (Sites/Update.php line 259) properly update the field
  • Line 166 in the reviewed file correctly reads the attribute with an empty string fallback

The implementation follows the established pattern across all deployment creation flows and safely handles the optional nature of this field.

tests/resources/sites/astro-custom-start-command/src/pages/ssr.js (1)

1-5: SSR route implementation matches Astro patterns and test needs

prerender = false and the GET handler returning a dynamic "SSR OK (timestamp)" response look correct and align with the e2e test assertions.

tests/resources/sites/astro-custom-start-command/package.json (1)

1-18: Package definition is consistent with the Astro custom start-command fixture

Scripts and dependencies match the e2e usage (build, copy custom-server.js, and produce a production-only install). No issues spotted for this test resource.

src/Appwrite/Platform/Modules/Functions/Http/Deployments/Template/Create.php (1)

145-165: Propagating startCommand into template deployments is consistent

Including:

'startCommand' => $function->getAttribute('startCommand', ''),

in the deployment document keeps template deployments aligned with the function’s configured start command and mirrors other deployment flows. No additional changes needed here.

src/Appwrite/Platform/Modules/Functions/Http/Deployments/Create.php (1)

233-253: startCommand wiring for function deployments covers both full and chunked uploads

Adding:

'startCommand' => $function->getAttribute('startCommand', ''),

to both the completed-upload and initial-chunk deployment creation blocks ensures every new deployment consistently snapshots the function’s start command. This matches how buildCommands is handled and looks correct.

Also applies to: 272-293

src/Appwrite/Platform/Modules/Sites/Http/Deployments/Create.php (1)

243-265: Site deployments now correctly snapshot startCommand

The added lines:

'startCommand' => $site->getAttribute('startCommand', ''),

in both deployment creation branches ensure each deployment carries the site’s configured start command, regardless of whether the upload is single-shot or chunked. This is consistent with how build commands and adapter metadata are stored.

Also applies to: 310-333

src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php (1)

72-72: startCommand is correctly threaded through site creation

The new startCommand parameter:

->param('startCommand', '', new Text(8192, 0), 'Custom start command. Leave empty to use default.', true)

and its use in action() and the created sites document:

'startCommand' => $startCommand,

cleanly extend the site creation API and persist the value expected by the deployments module. This is consistent with the update and deployment flows.

Also applies to: 105-105, 143-170

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 19, 2025

✨ Benchmark results

  • Requests per second: 1,148
  • Requests with 200 status code: 206,729
  • P99 latency: 0.169321627

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,148 1,155
200 206,729 207,890
P99 0.169321627 0.180095803

Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (1)
tests/e2e/Services/Sites/SitesCustomServerTest.php (1)

2960-2969: Remove redundant domain assignment.

Line 2960 assigns $domain from setupSiteDomain(), but line 2969 immediately overwrites it with getSiteDomain(). While the setupSiteDomain() call is needed for its side effect (creating the domain rule), the assignment to $domain is unnecessary.

Apply this diff:

-        $domain = $this->setupSiteDomain($siteId);
+        $this->setupSiteDomain($siteId);
 
         $deploymentId = $this->setupDeployment($siteId, [
             'code' => $this->packageSite('astro-custom-start-command'),
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f907f76 and 7f3c0c9.

📒 Files selected for processing (3)
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php (4 hunks)
  • src/Appwrite/Utopia/Response/Model/Func.php (1 hunks)
  • tests/e2e/Services/Sites/SitesCustomServerTest.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
tests/e2e/Services/Sites/SitesCustomServerTest.php (2)
tests/e2e/Services/Sites/SitesBase.php (6)
  • setupSite (21-34)
  • setupSiteDomain (369-387)
  • setupDeployment (36-83)
  • packageSite (239-251)
  • getSiteDomain (389-410)
  • cleanupSite (85-94)
tests/e2e/Client.php (2)
  • Client (8-342)
  • setEndpoint (140-145)
src/Appwrite/Utopia/Response/Model/Func.php (1)
src/Appwrite/Utopia/Response/Model.php (1)
  • addRule (90-102)
src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php (1)
src/Appwrite/GraphQL/Types/Mapper.php (1)
  • param (255-363)
⏰ 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 (Webhooks)
  • GitHub Check: E2E Service Test (Sites)
  • GitHub Check: E2E Service Test (Messaging)
  • GitHub Check: E2E Service Test (Teams)
  • GitHub Check: E2E Service Test (Users)
  • GitHub Check: E2E Service Test (Projects)
  • GitHub Check: E2E Service Test (Tokens)
  • GitHub Check: E2E Service Test (Storage)
  • GitHub Check: E2E Service Test (Proxy)
  • GitHub Check: E2E Service Test (Locale)
  • GitHub Check: E2E Service Test (Health)
  • GitHub Check: E2E Service Test (Functions)
  • GitHub Check: E2E Service Test (Realtime)
  • GitHub Check: E2E Service Test (Console)
  • GitHub Check: E2E Service Test (Account)
  • GitHub Check: E2E Service Test (Site Screenshots)
  • GitHub Check: E2E Service Test (Dev Keys)
  • GitHub Check: E2E General Test
  • GitHub Check: Benchmark
  • GitHub Check: scan
🔇 Additional comments (2)
src/Appwrite/Utopia/Response/Model/Func.php (1)

143-148: LGTM! The description has been corrected.

The startCommand rule is properly implemented and the description now correctly references "function runtime" instead of "site runtime". The field follows the same pattern as other command-related fields in the model.

src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php (1)

76-76: LGTM! The startCommand parameter is fully integrated.

The startCommand field has been properly added to:

  • API parameter definition (line 76)
  • Action method signature (line 113)
  • Live state change detection (line 231)
  • Document persistence (line 260)

The past review concern about including startCommand in the live change detection has been addressed. Changes to the start command will now correctly mark the site as not live, requiring a redeploy.

Also applies to: 113-113, 231-231, 260-260

Copy link
Copy Markdown
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: 0

♻️ Duplicate comments (2)
src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php (1)

351-351: startCommand attribute is never set on function documents.

This issue was already identified in a previous review. The function creation logic (lines 213-243) does not include a startCommand field, and the function creation endpoint does not accept it as a parameter (lines 79-111). Therefore, $function->getAttribute('startCommand', '') will always return an empty string.

As noted in the previous review, either add startCommand as an optional parameter to the function create/update endpoints, or remove this line if the feature is not intended for Functions.

tests/e2e/Services/Sites/SitesCustomServerTest.php (1)

2987-2996: Remove redundant domain assignment.

Line 2987 calls setupSiteDomain($siteId) and assigns to $domain, but line 2996 immediately overwrites it with getSiteDomain($siteId). The first assignment is unnecessary.

Apply this diff:

-        $domain = $this->setupSiteDomain($siteId);
+        $this->setupSiteDomain($siteId);
 
         $deploymentId = $this->setupDeployment($siteId, [
             'code' => $this->packageSite('astro-custom-start-command'),
             'activate' => 'true'
         ]);
 
         $this->assertNotEmpty($deploymentId);
 
         $domain = $this->getSiteDomain($siteId);
🧹 Nitpick comments (1)
tests/e2e/Services/Sites/SitesCustomServerTest.php (1)

3007-3011: Consider more robust assertions for SSR validation.

The test validates server-side rendering by comparing two responses and asserting they differ (due to Date.now()). While this works, it could theoretically fail if both requests complete within the same millisecond.

As an alternative, you could assert the presence of expected substrings like "SSR OK (" rather than relying on inequality, which would be more deterministic while still confirming SSR functionality.

Also applies to: 3016-3020

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f3c0c9 and d99a527.

📒 Files selected for processing (9)
  • app/config/collections/projects.php (3 hunks)
  • app/controllers/general.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Functions/Http/Functions/Create.php (1 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php (3 hunks)
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php (4 hunks)
  • src/Appwrite/Platform/Workers/Functions.php (1 hunks)
  • src/Appwrite/Utopia/Response/Model/Site.php (1 hunks)
  • tests/e2e/Services/Sites/SitesCustomServerTest.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php
  • app/controllers/general.php
  • src/Appwrite/Platform/Workers/Functions.php
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Create.php
  • src/Appwrite/Platform/Modules/Sites/Http/Sites/Update.php
  • app/config/collections/projects.php
🧰 Additional context used
🧬 Code graph analysis (2)
src/Appwrite/Utopia/Response/Model/Site.php (1)
src/Appwrite/Utopia/Response/Model.php (1)
  • addRule (90-102)
tests/e2e/Services/Sites/SitesCustomServerTest.php (2)
tests/e2e/Services/Sites/SitesBase.php (6)
  • setupSite (21-34)
  • setupSiteDomain (369-387)
  • setupDeployment (36-83)
  • packageSite (239-251)
  • getSiteDomain (389-410)
  • cleanupSite (85-94)
tests/e2e/Client.php (2)
  • Client (8-342)
  • setEndpoint (140-145)
⏰ 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: Benchmark
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan
🔇 Additional comments (2)
src/Appwrite/Utopia/Response/Model/Site.php (1)

128-133: LGTM! Clean addition following existing patterns.

The startCommand field is well-structured and consistent with sibling fields (installCommand, buildCommand). Verification confirms input validation is in place at the controller/API layer using the Text(8192, 0) validator, identical to the existing command fields.

tests/e2e/Services/Sites/SitesCustomServerTest.php (1)

2970-2970: Address the question about function tests.

A previous reviewer asked whether tests for functions should be added. Since this PR adds custom start command support for sites (and possibly functions), but this test file is specifically SitesCustomServerTest, a separate test for functions would belong in a different test file (e.g., FunctionsCustomServerTest or similar).

If custom start commands are also supported for functions in this PR, please confirm that corresponding function tests exist in the appropriate test file.

@Meldiron Meldiron mentioned this pull request Nov 24, 2025
2 tasks
@Meldiron Meldiron merged commit db965f8 into feat-1.8.x-new-schema Nov 24, 2025
39 checks passed
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.

2 participants