Commit Graph

219 Commits

Author SHA1 Message Date
Levi van Noort 702a8a83a0 test: add assertion for action execution logs content in SitesCustomServerTest 2026-05-11 10:30:08 +02:00
Levi van Noort fe5e5b8891 refactor: enhance execution log checks in SitesCustomServerTest 2026-05-11 10:17:55 +02:00
Matej Bačo 15f21daa2b Add tests 2026-05-05 16:45:09 +02:00
Torsten Dittmann dfbf45f4cc Merge branch '1.9.x' into feat-out-of-order-chunk-uploads 2026-04-29 15:03:33 +04:00
Matej Bačo 980762fc3e Rename from dynamic key to ephemeral key (api keys) 2026-04-28 17:18:06 +02:00
Torsten Dittmann 2f2da98cca fix: adjust out-of-order test expectations and chunk sizes
- Functions/Sites: lower minimum chunk requirement from 3 to 2
- Sites: use random_bytes instead of str_repeat for non-compressible test data
- Remove assertions on sourceChunksTotal/Uploaded from response body (not in response model)
2026-04-27 17:46:20 +04:00
Torsten Dittmann 49d2db65e6 feat: support out-of-order chunked uploads
- Add APP_LIMIT_UPLOAD_CHUNK_SIZE constant (5MB) matching official SDKs
- Replace dynamic chunk calculation with fixed 5MB chunk math in all upload endpoints
- Remove -1 last-chunk sentinel that broke when last chunk arrived first
- Fix duplicate-retry guards: return existing resource instead of erroring for chunked uploads
- Add out-of-order e2e tests for Storage, Functions, and Sites
- Upgrade utopia-php/storage to 2.0.0 for device-level out-of-order assembly support
2026-04-27 17:15:00 +04:00
Chirag Aggarwal 838dbc52e3 Merge branch '1.9.x' into t3code/sentry-bug-fix 2026-04-22 16:23:25 +05:30
Chirag Aggarwal e7d9ef74c4 Fix deployment single chunk content range
Fixes CLOUD-3JN6
2026-04-22 16:05:12 +05:30
Chirag Aggarwal d2230f8fe7 chore: bump PHPStan to level 4 and fix all new errors
Raises `phpstan.neon` level from 3 to 4 and fixes the 549 new errors
that level 4 surfaces across 157 files. Fixes are root-cause — no
`@phpstan-ignore`, no `@var` casts, no baseline entries, no widened
types. A handful of latent bugs were fixed along the way:

- `app/controllers/general.php`: path-traversal guard was negating
  `\substr(...)` before the strict comparison (`!\substr(...) === $base`
  was always `false === $base`). Rewritten as `\substr(...) !== $base`.
- `src/Appwrite/Platform/Modules/Databases/Http/Databases/Logs/XList.php`
  and `.../TablesDB/Logs/XList.php`: were importing the raw Matomo
  `DeviceDetector` (whose `getDevice()` returns `?int`) but treating the
  result as an array with `deviceName/deviceBrand/deviceModel` keys.
  Swapped to `Appwrite\Detector\Detector`, matching the wrapper already
  used a few lines below for `$os`/`$client`.
- `src/Appwrite/Platform/Modules/Functions/Workers/Builds.php`: a match
  key was checking `$resourceKey === 'functions'` when `$resourceKey`
  is `'functionId'|'siteId'` — always false. Switched to the intended
  `$resource->getCollection() === 'functions'` check.
- `src/Appwrite/OpenSSL/OpenSSL.php`: `encrypt()` return type tightened
  to `string|false` to match `openssl_encrypt`; this lets callers'
  `=== false` error handling remain meaningful.
- `app/controllers/api/messaging.php`: removed a dead
  `array_key_exists('from', [])` branch in the Msg91 provider (empty
  array literal; branch was unreachable).

Large cleanup categories across the 549 fixes:
- Removed redundant `?? default` on array offsets and expressions that
  PHPStan now knows are non-nullable.
- Removed unreachable statements (mostly `return;` after `throw` or
  `markTestSkipped()`).
- Removed redundant `is_array`/`is_string`/`is_bool`/`instanceof` checks
  on already-narrowed types.
- Added `default =>` arms (or throwing arms) to non-exhaustive matches
  on `string`/`mixed` input.
- Removed dead `$document === false` branches where method return types
  were tightened to non-nullable `Document`.
- Removed unused properties (`$version` on Etsy/Zoom OAuth2, `$paths` on
  Installer State, `$source` on MigrationsWorker, `$account2` on two
  GraphQL auth tests), unused traits (`ApiVectorsDB`, `DatabaseFixture`),
  and an unused `cleanupStaleExecutions` task method.
- Replaced `assertTrue(true)` and redundant `assertIsArray`/`assertIsString`/
  `assertNotNull` assertions with `addToAssertionCount(1)` or
  `assertNotEmpty` where the runtime type was already known.
2026-04-19 17:31:20 +05:30
Hemachandar 6b573524e7 fix: Ensure rules are deleted properly (#11575)
* fix: Ensure rules are deleted properly

* tests
2026-03-18 19:02:03 +05:30
Matej Bačo 975a38bf43 Speed-up deployments in tests 2026-03-15 16:39:12 +00:00
Matej Bačo d8954f424c Fix specs tests 2026-03-09 15:09:57 +01:00
Matej Bačo c20dfc7063 PR simplification 2026-03-09 11:51:32 +01:00
Matej Bačo 248b3c8b32 Revert "Revert "Features with schema changes"" 2026-03-04 14:31:27 +01:00
Matej Bačo f8b31e7db7 Revert "Features with schema changes" 2026-03-04 14:31:05 +01:00
Matej Bačo 1f5fd919c9 Merge branch '1.8.x' into feat-1.8.x-new-schema 2026-03-04 14:13:01 +01:00
Jake Barnby bada1a7c05 Timing updates 2026-02-24 14:00:07 +13:00
Jake Barnby 48698f40ba fix: add polling and delay for testSSRLogs logging config propagation
After setting logging=false, the site runtime may not immediately pick up
the config change. Add a 5s delay and poll for the NEW log entry (filtering
out the old one by $id) to avoid picking up stale log entries with content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 03:12:44 +13:00
Jake Barnby 31f4260908 fix: increase database worker count and test resilience for parallel execution
Parallel test execution via ParaTest creates more queue load than a single
database worker can handle, causing attributes to get stuck at 'processing'.
Increase _APP_WORKERS_NUM to 4 to match parallelism, increase WebSocket
timeout from 15s to 30s, and add retry logic for proxy requests in Sites tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:16:40 +13:00
Jake Barnby b645721e14 fix: resolve CI failures from 1.8.x merge
- Remove unused WhiteList import in teams.php (linter fix)
- Add missing $teamId and $newTeam params to setupProject() in ProjectsBase.php (fixes 401 errors in all Projects tests)
- Filter execution logs by requestPath in testSSRLogs to avoid picking up screenshot worker executions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 02:46:23 +13:00
Jake Barnby 64a368ba3d Merge remote-tracking branch 'origin/feat-db-tests' into feat-mongodb
# Conflicts:
#	.github/workflows/tests.yml
#	src/Appwrite/Utopia/Response.php
#	src/Appwrite/Utopia/Response/Model/AttributeList.php
#	tests/e2e/Client.php
#	tests/e2e/Scopes/ProjectCustom.php
#	tests/e2e/Services/Databases/DatabasesBase.php
#	tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php
#	tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php
#	tests/e2e/Services/Databases/Legacy/DatabasesStringTypesTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesCustomClientTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php
#	tests/e2e/Services/Databases/Transactions/TransactionsBase.php
#	tests/e2e/Services/GraphQL/Legacy/DatabaseServerTest.php
#	tests/e2e/Services/GraphQL/TablesDB/DatabaseServerTest.php
#	tests/e2e/Services/Messaging/MessagingBase.php
#	tests/e2e/Services/Sites/SitesBase.php
#	tests/e2e/Services/Sites/SitesCustomServerTest.php
2026-02-18 03:27:23 +13:00
Jake Barnby b7ce686d73 Merge branch '1.8.x' into feat-mongodb 2026-02-13 07:18:26 +00:00
Jake Barnby a13b9c0a88 fix: Increase Sites deployment activation timeouts and fix race condition
- Increase activation timeout in SitesBase setupDeployment from 200s to 400s
- Add assertEventually for deploymentId check in testCreateDeployment to handle
  the race condition where build worker sets deployment status to 'ready' before
  setting site.deploymentId
- Increase build ready timeouts from 50s to 300s in testCreateDeployment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 08:37:14 +13:00
Jake Barnby f0e6105ba0 fix: Use Docker Compose profiles to isolate database containers in CI
- Add profiles to database services (mariadb, mongodb, postgresql) so only
  the needed database starts per CI job, freeing resources for the executor
- Increase Sites deployment activation timeouts from 50-100s to 200s for
  MongoDB compatibility
- Increase SSR logs polling timeout from 30s to 120s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 07:27:21 +13:00
Jake Barnby 25a9aa1805 fix: Fix Sites test SSR logs timing and PostgreSQL search stop word
- Add polling for SSR execution logs instead of immediate access
- Change testListSites framework from 'other' to 'analog' because
  PostgreSQL treats 'other' as a fulltext stop word

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 06:36:51 +13:00
fogelito c7965e931f fix testConsoleAvailabilityEndpoint 2026-02-12 13:13:05 +02:00
Jake Barnby 7d5f6c9bf3 Merge remote-tracking branch 'origin/1.8.x' into feat-db-tests
# Conflicts:
#	.github/workflows/tests.yml
#	composer.lock
#	tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
#	tests/e2e/Services/Teams/TeamsCustomClientTest.php
2026-02-12 12:34:42 +13:00
Chirag Aggarwal 2d05d608f4 Upgrade utopia-php dependencies and fix namespace changes
- Upgrade utopia-php/cli from 0.15 to 0.22
- Upgrade utopia-php/analytics from 0.10 to 0.15
- Upgrade utopia-php/orchestration from 0.9 to 0.19
- Use dev branches for utopia-php/framework and utopia-php/platform
- Remove utopia-php/swoole dependency (merged into framework)
- Migrate Utopia\CLI\Console to Utopia\Console across all files
- Migrate Utopia\Http to Utopia\Http\Http namespace
- Migrate Utopia\Swoole\Files to Utopia\Http\Files (now instance-based)
- Convert static CLI::setResource() calls to instance-based Dependency API
- Fix StatsResources task named parameter mismatch
2026-02-10 10:34:24 +05:30
Jake Barnby 2da4211f69 fix: Make E2E tests parallel-safe for functional mode
- Fix missing return statement in DatabasesBase::testListDocuments
- Rewrite DatabasesStringTypesTest with project-keyed setup cache
- Use assertGreaterThanOrEqual in Functions testListDeployments
- Clean up OIDC provider after Account OAuth2 test
- Key all GraphQL static caches by project ID with unique IDs
- Replace sleep() with assertEventually in Realtime tests
- Increase Messaging scheduled message timeout to 180s
- Increase Sites deployment timeouts to 120s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 13:25:19 +13:00
Jake Barnby 2a4ef06355 fix: Make Sites tests parallel-safe for --functional mode
Add search filters to isolate test data in testListSites to prevent
count assertions from failing when other test methods create sites
during parallel execution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 17:24:57 +13:00
Jake Barnby d4694ff8af Merge remote-tracking branch 'origin/1.8.x' into feat-db-tests
# Conflicts:
#	composer.json
#	composer.lock
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
#	tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
#	tests/e2e/Services/Realtime/RealtimeCustomClientTest.php
2026-02-04 19:49:09 +13:00
Matej Bačo 150c9033cc Support arrays in domains env variables 2026-01-30 16:20:46 +01:00
ArnabChatterjee20k e82345be40 updated tests 2026-01-29 14:22:08 +05:30
Jake Barnby bb09abc087 Update CTA check 2026-01-14 01:23:48 +13:00
Matej Bačo 226bb6b830 AI core review changes 2026-01-05 10:32:03 +01:00
Matej Bačo 51e03353dd Merge branch '1.8.x' into feat-1.8.x-new-schema 2025-12-31 15:13:35 +01:00
Matej Bačo bd2db5e249 AI review fixes 2025-12-15 19:45:57 +01:00
Matej Bačo 6cbc79026f Finish site tests for auto deletion 2025-12-15 18:55:34 +01:00
loks0n f765eb92e7 feat: cors service 2025-12-11 09:01:31 +00:00
Hemachandar fd466dfcea Revert "Update deploymentId in sites rule for first deployment" 2025-11-27 16:31:14 +05:30
Hemachandar c713357131 Merge branch '1.8.x' into ser-550 2025-11-25 13:23:09 +05:30
Matej Bačo 914723c53a Merge branch '1.8.x' into feat-1.8.x-new-schema 2025-11-24 19:10:44 +01:00
Matej Bačo d99a52741d Merge branch 'feat-1.8.x-new-schema' into feat-custom-start-commands 2025-11-24 15:41:52 +01:00
Chirag Aggarwal b905686c0e fix typo 2025-11-21 10:28:02 +05:30
Matej Bačo 63f6840d1b Finish implementation, update tests 2025-11-20 17:39:19 +01:00
Matej Bačo 62173b8f61 WIP: Separate specifications 2025-11-20 13:56:54 +01:00
Matej Bačo 7f3c0c9c03 AI review fixes 2025-11-19 16:38:47 +01:00
Matej Bačo f907f76eb5 Custom start command implementation 2025-11-19 15:27:54 +01:00
Hemachandar 9f7e3146a4 feedback 2025-11-18 20:08:43 +05:30