Commit Graph

32166 Commits

Author SHA1 Message Date
Jake Barnby efb523dab4 fix: add retry logic to setupFunction for flaky 401 auth errors
All 15 FunctionsCustomServerTest failures originate from setupFunction()
getting a transient 401 when the API key lookup fails under CI load.
Retry up to 3 times with a 2s delay on 401 responses.

Remove the per-method #[Retry] on testScopes since the root fix is now
in setupFunction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 09:53:14 +13:00
Jake Barnby aa369dc371 fix: increase Sites activation timeout to 600s and add retry to testScopes
MongoDB CI builds take longer to process the deployment queue, causing
testSiteDomainReclaiming to timeout at 400s. Increase to 600s.

testScopes has an intermittent 401 auth failure - add #[Retry(count: 3)]
for resilience.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 09:16:27 +13: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 8b822cd97c fix: Add missing _APP_DB_ADAPTER env var to worker-executions, worker-screenshots, and task-interval
The default for _APP_DB_ADAPTER was changed from 'mariadb' to 'mongodb' in
registers.php. Services without this env var default to the MongoDB adapter,
causing MariaDB/PostgreSQL function executions to get stuck in 'waiting'
status because the worker-executions service cannot connect to the database.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 07:53:16 +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
Jake Barnby 6f56c9c2ee fix: Gate spatial index null tests on adapter capability
PostgreSQL supports spatial indexes on nullable columns and required
spatial attributes on existing data, unlike MariaDB. Expose
supportForSpatialIndexNull console variable and condition test
assertions accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 06:22:53 +13:00
Jake Barnby e3a39499f2 fix: Patch PostgreSQL boolean type mismatch in batch inserts
The SQL adapter's createDocuments() unconditionally casts boolean values to
integers (line 2518 in SQL.php), but PostgreSQL rejects int values for native
BOOLEAN columns. The single-document path already has an instanceof check to
preserve booleans for Postgres, but createDocuments() was missed.

This patch applies the same fix via a PHP script run during Docker build.
Fixes 26 test failures across PostgreSQL Legacy, TablesDB, and GraphQL suites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:44:58 +13:00
Jake Barnby e3c58a8c05 fix: Correct test capability gates and GraphQL dependencies
- Change spatial test gates from getSupportForRelationships() to
  getSupportForSpatials() in both Legacy and TablesDB DatabasesBase
- Add both relationship AND spatial gates for spatial relationship tests
- Add missing @depends for float, email, and datetime attributes/columns
  in GraphQL Server tests to ensure schema is complete before document/row
  creation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:06:48 +13:00
Jake Barnby 74b4c44bde fix: Gate relationship test on adapter support in TablesDB
MongoDB doesn't support relationships, so testInvalidRelationshipDocumentId
returns 400 instead of 202. Skip the test when the adapter lacks support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:59:00 +13:00
Jake Barnby 9b2dd958b5 fix: Use correct capability check for partial fulltext search in Users test
PostgreSQL's ts_vector/ts_query doesn't support partial word matching
(searching "man" won't find "manchester"), unlike MariaDB's LIKE-based
search. The test used getSupportForRelationships() as a proxy for this
capability, which was wrong for PostgreSQL (supports relationships but
not partial fulltext search).

Add supportForFulltextWildcard to console variables endpoint and use
it in the Users test instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:56:39 +13:00
Jake Barnby b952bf7978 fix: Use custom PostgreSQL image with required extensions (PostGIS, pgvector)
The Postgres adapter in utopia-php/database requires PostGIS, pgvector,
and pg_trgm extensions. The plain postgres:18 image lacked these, causing
"collation utf8_ci_ai does not exist" errors (CREATE EXTENSION failed
before the collation could be created).

Switch to postgres:17 with a custom Dockerfile that installs the required
extensions, matching the approach used by utopia-php/database's own tests.
Also reverts the volume mount to /var/lib/postgresql/data (correct for v17).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:25:35 +13:00
Jake Barnby 490b9f844f fix: Update PostgreSQL volume mount for postgres:18 compatibility
PostgreSQL 18+ stores data in major-version-specific subdirectories under
/var/lib/postgresql instead of directly in /var/lib/postgresql/data. The
old mount path caused the container to crash immediately on startup with
a migration error, which was the actual root cause of all PostgreSQL CI
failures (the container was dead so Docker DNS couldn't resolve its name).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:14:45 +13:00
Jake Barnby eaff193055 fix: Resolve PostgreSQL DNS failure by routing through Docker's embedded DNS
The appwrite container's `dns: 172.16.238.100` (CoreDNS) bypassed Docker's
embedded DNS, preventing resolution of service names like `postgresql`.
CoreDNS only handles custom test domains and forwards unknown queries to
Cloudflare, which can't resolve Docker service names.

Fix: Add 127.0.0.11 (Docker embedded DNS) as primary resolver and configure
CoreDNS to forward unknown queries to Docker DNS with Cloudflare as fallback.
Bind CoreDNS to its static IP to avoid port conflict with Docker's DNS proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:02:31 +13:00
fogelito b2aa2cc247 typo 2026-02-12 16:36:37 +02:00
Jake Barnby 61e69027a3 debug: Include error message in database connection retry log
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 03:34:22 +13:00
Jake Barnby fc893e1c7e fix: Add connect_timeout to PostgreSQL DSN and add server logs to CI
PDO ATTR_TIMEOUT does not control connection timeout for the pgsql driver.
Without connect_timeout in the DSN, the PDO constructor blocks indefinitely
if PostgreSQL isn't ready, which blocks the Swoole master process event loop
(since coroutine hooks are not enabled in http.php) and prevents all HTTP
request dispatching.

Also add appwrite server logs to CI failure output for debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 03:17:48 +13:00
fogelito 5756b58d4d $tableId 2026-02-12 15:59:34 +02:00
fogelito 2cb98a87c8 tablesdb 2026-02-12 15:58:39 +02:00
fogelito ecd575aec3 Merge branch '1.8.x' of https://github.com/appwrite/appwrite into check-client-queries-strings 2026-02-12 15:55:12 +02:00
Jake Barnby 9b5695a21b fix: Use simple list form for worker-executions depends_on
Docker Compose doesn't support variable interpolation in depends_on map
keys (expanded form with condition). Use simple list form like all other
services.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 02:53:32 +13:00
fogelito db6a3342c0 fix tests 2026-02-12 15:52:39 +02:00
Jake Barnby c9aa80473d fix: Correct import ordering for WhiteList in teams controller
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 02:47:45 +13:00
Jake Barnby 462ce71512 fix: Replace hardcoded mariadb dependencies with dynamic DB host in docker-compose
Four services (worker-screenshots, worker-executions, task-maintenance,
task-interval) had hardcoded `depends_on: mariadb` instead of using
`${_APP_DB_HOST:-mongodb}` like all other services. This caused ALL
PostgreSQL E2E tests to fail because those services couldn't start.

Also fix Storage test assertion that incorrectly used
getSupportForRelationships() as proxy for max UID length - the UID
validator always limits to 36 chars regardless of adapter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 02:44:49 +13:00
Jake Barnby 0e6fa7f300 fix: Add missing WhiteList import in teams controller
The WhiteList validator was used at lines 486 and 1090 but never imported,
causing a "Class not found" error and 500 response instead of proper validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 02:36:29 +13:00
Jake Barnby cee77d0564 Merge branch '1.8.x' into feat-mongodb 2026-02-12 12:42:54 +00:00
Jake Barnby 2869d057f9 fix: Populate console variables with actual database adapter capabilities
The console variables endpoint was using model defaults (all true) for
supportForRelationships, supportForOperators, supportForSpatials, and
maxIndexLength instead of reading from the actual database adapter.
This caused tests to run unsupported operations on MongoDB.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:41:03 +13:00
Chirag Aggarwal afbad9db0f Merge pull request #11285 from appwrite/release-agent-skills
feat: appwrite agent skills
2026-02-12 18:00:48 +05:30
Chirag Aggarwal eb5d7875e4 composer 2026-02-12 17:39:44 +05:30
Chirag Aggarwal 8645a17323 Merge branch '1.8.x' into release-agent-skills 2026-02-12 17:39:33 +05:30
Jake Barnby f13f80b2a3 fix: Handle unlimited attribute limit for MongoDB in subQueryAttributes filter
MongoDB adapter returns 0 from getLimitForAttributes() meaning unlimited,
but Query::limit(0) fails validation since minimum valid limit is 1.
Fall back to APP_LIMIT_SUBQUERY (1000) when adapter reports unlimited.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 00:55:05 +13:00
Chirag Aggarwal efaf44c677 changes 2026-02-12 17:24:16 +05:30
Matej Bačo 54b2d2fe22 Merge branch '1.8.x' into chore-customizable-screenshot-router 2026-02-12 12:50:59 +01:00
Matej Bačo 2ec259d433 Introduce _APP_WORKER_SCREENSHOTS_ROUTER 2026-02-12 12:50:39 +01:00
fogelito fc03476246 fix to String 2026-02-12 13:50:22 +02:00
Jake Barnby ccb8b9eb6f Revert "fix: Set MariaDB adapter for non-adapter-specific CI tests"
This reverts commit 17d9a72922.
2026-02-13 00:35:56 +13:00
Jake Barnby 17d9a72922 fix: Set MariaDB adapter for non-adapter-specific CI tests
The .env defaults were changed to mongodb, but tests that don't
explicitly set a DB adapter (general, shared mode, abuse, screenshots)
were implicitly using the default. These tests need MariaDB since
shared tables mode is not supported with MongoDB yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 00:34:38 +13:00
fogelito c7965e931f fix testConsoleAvailabilityEndpoint 2026-02-12 13:13:05 +02:00
fogelito 536f09e5b8 fix rules 2026-02-12 13:10:53 +02:00
Jake Barnby d3e6c48a59 fix: Add missing Authorization parameter to Columns XList action
The TablesDB Columns XList::action() method was missing the
Authorization $authorization parameter that exists in the parent
Attributes XList class, causing a PHP fatal error that prevented
the appwrite service from starting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:57:51 +13:00
Jake Barnby 638778413d Fix workflows 2026-02-12 23:44:45 +13:00
Jake Barnby 6a005c06b1 Format 2026-02-12 23:40:51 +13:00
Jake Barnby 5590f0bcd0 Merge remote-tracking branch 'origin/1.8.x' into feat-mongodb
# Conflicts:
#	.env
#	.github/workflows/tests.yml
#	app/controllers/api/projects.php
#	app/controllers/api/teams.php
#	app/init/registers.php
#	app/views/install/compose.phtml
#	composer.json
#	composer.lock
#	docker-compose.yml
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Create.php
#	src/Appwrite/Platform/Tasks/Install.php
#	src/Appwrite/Platform/Tasks/Upgrade.php
#	tests/e2e/Services/Databases/Legacy/DatabasesBase.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
2026-02-12 23:35:21 +13:00
fogelito baa97e199e Merge branch '1.8.x' of https://github.com/appwrite/appwrite into check-client-queries-strings 2026-02-12 12:20:41 +02:00
fogelito 4ef8222294 Check strings 2026-02-12 12:18:03 +02:00
Chirag Aggarwal a4a062afb4 Merge pull request #11307 from appwrite/sync-specs-and-release-sdks
chore: release sdks to fix createMembership roles param
2026-02-12 15:33:21 +05:30
Jake Barnby 408f65bf64 Merge branch '1.8.x' into feat-db-tests 2026-02-12 09:14:57 +00:00
Matej Bačo 6944fa7520 Merge pull request #11302 from appwrite/feat-team-sequence
Feat: team sequence
2026-02-12 10:14:36 +01:00
Chirag Aggarwal 2bad5d8918 Merge pull request #11309 from appwrite/fix/static-files-worker-init
Fix static asset 404s by initializing Files per worker
2026-02-12 13:42:29 +05:30
Chirag Aggarwal 886528bb29 Merge pull request #11306 from appwrite/feat/messaging-spans 2026-02-12 13:13:35 +05:30