Commit Graph
32460 Commits
Author SHA1 Message Date
loks0nandClaude Opus 4.6 9dc000d0c5 Replace region check with project ID check for execution logging
Switch from checking _APP_REGION !== 'nyc' to checking project ID
to disable execution logging for a specific project.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 18:47:07 +00:00
Luke B. SilverandGitHub feabee38e7 Merge pull request #11320 from appwrite/feat-spans
feat: spans
2026-02-13 14:46:12 +00:00
loks0nandClaude Opus 4.6 a44a22ce04 Update utopia-php/span to 1.1.* with pretty exporter and instrument HTTP lifecycle
- Add utopia-php/span 1.1.* direct dependency, bump utopia-php/dns to 1.6.*
- Create shared app/init/span.php for span storage and pretty exporter setup
- Instrument HTTP request lifecycle with spans (method, path, response code)
- Add database.setup and http.server.start spans
- Replace old Console error logs with Span::error() in general controller

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:56:59 +00:00
Jake BarnbyandClaude Opus 4.6 ab19a73b33 fix: adjust messaging scheduledAt timings for CI reliability
Set initial schedule to 20s and reschedule to 10s to balance between:
- Not being picked up by scheduler before reschedule (3-4s interval)
- Providing enough margin (6s) after scheduledAt for processing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 02:00:09 +13:00
Damodar Lohani 5d5fd370c6 fix: cast Redis ping response to boolean 2026-02-13 11:32:46 +00:00
Jake BarnbyandClaude Opus 4.6 ecf0b4a1dd fix: change $sequence to string type to support MongoDB UUID7 values
The Document and Row response models were casting $sequence to (int),
which destroyed UUID7 values on MongoDB. On MongoDB, $sequence is the
internal _id field which is a UUID7 string, not an auto-increment integer.
The (int) cast converted UUID7 values like "019c56a9-df6d-73fa-8d48-..."
to 19, making $sequence queries fail validation with 400.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:29:38 +13:00
Jake BarnbyandClaude Opus 4.6 7708f13ebd fix: revert database package, add debug output for $sequence query failures
- Revert utopia-php/database to 5.1.2 (the Sequence validator fix
  incorrectly assumed $sequence is always integer, but on MongoDB
  internal collections it uses UUID7)
- Revert Base.php change
- Add detailed error messages to testGetDocumentWithQueries and
  testGetRowWithQueries to capture actual $sequence values and API
  error responses for debugging
- Keep Messaging scheduledAt fix (30s initial, 15s rescheduled)
- Keep Functions auth retry improvement (10 retries with project refresh)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:09:31 +13:00
Jake BarnbyandClaude Opus 4.6 f7ba5e39b7 fix: update Sequence validator, fix messaging race condition, improve auth retry
- Update utopia-php/database to fix Sequence validator rejecting integer
  $sequence values on MongoDB (VAR_UUID7) adapters
- Fix Base.php Filter constructor passing APP_DATABASE_QUERY_MAX_VALUES
  as $idAttributeType instead of the correct Database::VAR_INTEGER
- Fix Messaging testUpdateScheduledAt race condition by increasing
  initial scheduledAt from 3s to 30s so scheduler doesn't fire before
  the PATCH update processes
- Improve Functions callWithAuthRetry to refresh project credentials
  after 4 consecutive 401 failures and increase max retries to 10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 23:54:39 +13:00
Matej BačoandGitHub b4421e6709 Merge pull request #11313 from appwrite/chore-customizable-screenshot-router
Chore: configurable _APP_WORKER_SCREENSHOTS_ROUTER
2026-02-13 10:09:02 +01:00
Jake BarnbyandClaude Opus 4.6 5cf272b21a fix: add $sequence to SELECT query in testGetDocumentWithQueries
The SELECT query didn't include $sequence, so accessing
$response['body']['$sequence'] returned null. The subsequent
Query::equal('$sequence', [null.'']) produced an empty string
which is invalid for the integer $sequence field, causing 400.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:02:09 +13:00
Jake BarnbyandClaude Opus 4.6 991af09fdf fix: improve auth retry resilience for MongoDB CI stability
- Increase callWithAuthRetry from 5 to 8 retries with capped delay (50s total)
- Increase ProjectCustom retries from 3 to 5 with 1s delays
- Fix swapped assertEquals parameters in FunctionsBase for clearer errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:46:24 +13:00
Damodar LohaniandGitHub 265c5143b0 Merge branch '1.8.x' into chore-tests 2026-02-13 13:14:56 +05:45
Jake BarnbyandGitHub b7ce686d73 Merge branch '1.8.x' into feat-mongodb 2026-02-13 07:18:26 +00:00
Jake BarnbyandClaude Opus 4.6 5df786b5ad fix: add retry logic for 401 errors and explicit site deployment activation
- Add retry logic with delays for transient 401 auth errors during project
  setup in ProjectCustom::getProject() (cherry-pick from feat-db-tests)
- Replace 10-minute activation polling in SitesBase with 30-second auto-activation
  wait followed by explicit PATCH /sites/:siteId/deployment fallback to prevent
  test suite timeouts when the build worker is slow to auto-activate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 20:05:49 +13:00
Jake BarnbyandGitHub 77fd2c1f24 Merge pull request #11311 from appwrite/check-client-queries-strings 2026-02-13 06:29:10 +00:00
fogelito 17ae01c70c Merge branch '1.8.x' of https://github.com/appwrite/appwrite into check-client-queries-strings 2026-02-13 07:55:10 +02:00
Jake Barnby 57e7f57056 Revert "Revert removals"
This reverts commit 005a3f4775.
2026-02-13 18:00:10 +13:00
Jake Barnby 005a3f4775 Revert removals 2026-02-13 17:52:50 +13:00
Jake BarnbyandGitHub 75ac4e4447 Merge branch '1.8.x' into feat-db-tests 2026-02-13 04:00:43 +00:00
Jake Barnby dbf3b52d4c Update lock 2026-02-13 16:12:43 +13:00
Jake BarnbyandGitHub 9c40d0c6f8 Merge pull request #11317 from appwrite/copilot/sub-pr-11312 2026-02-13 03:02:25 +00:00
Jake BarnbyandGitHub 2b536078bb Merge branch '1.8.x' into feat-mongodb 2026-02-13 02:19:37 +00:00
copilot-swe-agent[bot]andabnegate 3d58ed10dc Use explicit empty strings for environment variables
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-13 02:06:37 +00:00
copilot-swe-agent[bot]andabnegate 0a79370e1c Use GitHub Actions env config instead of sed commands
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-13 02:05:30 +00:00
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