Commit Graph
32354 Commits
Author SHA1 Message Date
copilot-swe-agent[bot] 2ee38ff45d Initial plan 2026-02-13 02:01:54 +00:00
Luke B. SilverandGitHub 16537996e8 Merge pull request #11315 from appwrite/refactor-ci
refactor: ci
2026-02-13 01:44:31 +00:00
Jake Barnby 3b8ab19fa0 Merge branch 'feat-mongodb' of github.com:appwrite/appwrite into feat-mongodb 2026-02-13 14:42:47 +13:00
Jake Barnby af7862bbbd Remove invalid patch 2026-02-13 14:42:37 +13:00
Jake BarnbyandGitHub 1dcee3edbf Fxx variables 2026-02-13 01:40:37 +00:00
Jake BarnbyandGitHub 1274d56234 Update src/Appwrite/Auth/OAuth2/Mock.php 2026-02-13 14:34:31 +13:00
Jake BarnbyandGitHub c8db0c6dcc Apply suggestions from code review 2026-02-13 14:34:02 +13:00
loks0nandClaude Opus 4.6 78e63085cf Update PHPStan 1.8→1.12, pin composer images to 2.8
PHPStan 1.8 triggers deprecation warnings on the PHP version shipped
with composer:2.8. Upgrading to 1.12 resolves the compatibility issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 01:16:35 +00:00
loks0nandClaude Opus 4.6 4326600751 Refactor CI workflows: add COMPOSE_FILE env, add build targets, bump action versions, pin composer
- Add COMPOSE_FILE=docker-compose.yml to tests, benchmark, and sdk-preview to prevent loading overrides in CI
- Add target: development to tests/benchmark builds, target: production to pr-scan/nightly builds
- Bump actions/checkout v4→v6, docker/build-push-action v4/v5→v6, actions/upload-artifact v4→v6, actions/github-script v7→v8
- Pin composer images to 2.8 in linter and static-analysis workflows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 00:56:03 +00:00
Jake BarnbyandClaude Opus 4.6 52606f352c fix: handle 401 in assertEventually and increase curl timeout to 30s
- setupDeployment's assertEventually callbacks now handle 401 responses
  gracefully instead of crashing with "Undefined array key"
- Increase Client curl timeout from 15s to 30s for slow CI runners
  (testDeleteScheduledExecution and testGetScreenshotWithPermissions
  were hitting the 15s limit)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:37:07 +13:00
Jake BarnbyandClaude Opus 4.6 37b857903a fix: add callWithAuthRetry to FunctionsBase for transient 401s
Extract retry logic into a reusable callWithAuthRetry helper with
exponential backoff (5 retries, 2/4/6/8s delays). Apply to both
setupFunction and setupDeployment.

Previous fix only retried setupFunction, but 401 can hit any API call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:07:26 +13:00
Jake BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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 BarnbyandGitHub cee77d0564 Merge branch '1.8.x' into feat-mongodb 2026-02-12 12:42:54 +00:00
Jake BarnbyandClaude Opus 4.6 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 AggarwalandGitHub 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 BarnbyandClaude Opus 4.6 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 BarnbyandClaude Opus 4.6 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