Commit Graph
17344 Commits
Author SHA1 Message Date
Jake BarnbyandClaude Opus 4.7 7af9c7b19a fix(redis): drop unreachable default arm in resource match
PHPStan narrowed $dsnScheme to literal 'redis' after the other arms
were ruled out, making the default arm dead code.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 08:54:45 +12:00
Jake Barnby 8a7528c8a0 Merge remote-tracking branch 'origin/feat-memory-adapter-tests' into feat-memory-adapter-tests 2026-05-01 08:35:27 +12:00
Jake BarnbyandClaude Opus 4.7 6b0ddd79a3 chore(redis): strengthen warning on database-pool redis scheme
Stage-5 re-review C-Re2 outcome: the C8 decision was that Redis stays
on logs/console only, NOT on documentsdb/vectorsdb/database. However,
.github/workflows/ci.yml currently runs a Redis matrix entry with
_APP_DB_ADAPTER=redis that flows through the database pool.

Removing 'redis' from the database pool schemes here would break that
CI matrix entry. Per the fixup spec, do not remove it until the matrix
is reframed (point Redis at logs/console only) or dropped (rely on the
utopia-php/database adapter trait suite for coverage).

This commit replaces the soft NOTE with a loud WARNING that:
  - states unambiguously that Redis is logs/console only;
  - explains why 'redis' is still listed on the database pool today;
  - documents the two paths to remove it (CI reframe or matrix drop);
  - reaffirms that documentsdb/vectorsdb must NEVER allow 'redis'.

documentsdb and vectorsdb schemes were already redis-free; verified.

CONFLICT FLAGGED: this is the deviation called out in the fixup spec.
The C-Re2 fix cannot be completed in this pass without breaking CI.
Follow-up work: decide between reframing the CI matrix or dropping the
Redis matrix entry, then drop 'redis' from the 'database' and 'console'
pool schemes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 23:51:22 +12:00
Jake Barnby f0ad1b5b80 Merge branch '1.9.x' into feat-memory-adapter-tests 2026-04-30 23:42:34 +12:00
Jake BarnbyandClaude Opus 4.7 16e7284f33 fix(redis): scope to logs/console only; restore matrix generator
C8: Add a comment block above the connection pool definitions warning
that the `redis` scheme on the `database` and `logs` pools is for the
test matrix only — operators who set `_APP_DB_ADAPTER=redis` in
production will lose data on cache eviction or process restart.
Redis stays OFF the `documentsdb` and `vectorsdb` pools, which have
stricter durability and indexing requirements that the in-memory
Utopia Redis adapter does not provide.

M12: Restore the matrix-generator logic that picks the per-PR matrix
based on whether `composer.lock` changed `utopia-php/database`. PRs
that bump the database package run the full Mariadb+Postgres+Mongo+
Redis matrix in both dedicated and shared modes; everything else
runs the SQLite+Redis short matrix in shared mode. The previous
"TEMP — revert before merge" early `return` short-circuited that
logic and forced every PR through the short matrix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 23:37:46 +12:00
Jake BarnbyandClaude Opus 4.7 95e5a6e365 feat: wire Redis adapter as test backend (compose + registers + ci)
Wires the new Redis database adapter through the Appwrite stack:
- registers.php: add 'redis' to schemes for console/database/logs pools,
  add an explicit redis resource arm honouring the optional db segment,
  and dispatch to Utopia\Database\Adapter\Redis in the database match
- composer.json: switch utopia-php/database constraint to
  dev-feat-redis-adapter to pick up the new adapter (lockfile bump
  follows after the database PR is pushed to origin)
- docker-compose.yml: add a dedicated redis-mirror service with
  noeviction policy and AOF persistence so the database backend stays
  isolated from the cache instance
- ci.yml: add Redis to default and full database matrices and export
  the matching env vars (_APP_DB_HOST=redis-mirror, port 6379)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 22:37:46 +12:00
Shmuel Fogel fbbab0f7e1 Merge pull request #12181 from appwrite/set-global-collection
Set global collection
2026-04-30 12:49:00 +03:00
fogelito d98bd8c972 Remove line 2026-04-30 10:44:21 +03:00
fogelito c0bba74eee set setGlobalCollections logs 2026-04-30 10:36:12 +03:00
frubio 337d47b1d9 fix(locale): add Spanish session alert translations 2026-04-30 09:33:08 +02:00
Jake BarnbyandClaude Opus 4.7 d4ba685682 perf(sqlite): split each pool category into its own DB file
Previously every connection pool (console, database, documentsdb,
vectorsdb, logs) opened the same SQLite file, so they all serialised
through one writer lock — even though they're conceptually independent
databases. Treat _APP_DB_SQLITE_PATH as a directory + stem template and
replace the stem with the pool key, so each gets its own file and
unrelated writes no longer queue against each other.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 17:34:20 +12:00
Jake BarnbyandClaude Opus 4.7 afa7ee7731 perf(sqlite): aggressive PRAGMAs and tmpfs-backed test storage
Tune SQLite for high-concurrency test workloads:
- synchronous=OFF skips fsync (safe for ephemeral test data only).
- 256 MB page cache + 2 GB mmap window cuts read I/O dramatically.
- temp_store=MEMORY keeps temporary tables off disk.
- busy_timeout to 60s and wal_autocheckpoint to every 10k pages so
  long write bursts don't fight the checkpointer.
- 64 MB WAL size cap.

Mount the SQLite docker volume as tmpfs so writes never reach disk.
The test DB is wiped between CI runs so durability is irrelevant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 15:54:20 +12:00
Jake BarnbyandClaude Opus 4.7 f7e7c8e23f fix(sqlite): bump busy_timeout to 30s and use synchronous=NORMAL
E2E test backend was hitting SQLITE_BUSY ("database is locked") under
Swoole's concurrent worker fanout, since SQLite serialises writes through
a single file lock. The previous 5s timeout was too tight for parallel
test load. NORMAL synchronous halves write fsync cost on WAL — fine for
ephemeral test databases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 14:06:18 +12:00
Jake Barnby 9542af215e Merge remote-tracking branch 'origin/1.9.x' into feat-memory-adapter-tests
# Conflicts:
#	composer.lock
2026-04-30 13:23:49 +12:00
Jake BarnbyandClaude Opus 4.7 46357947a7 feat: enable emulateMySQL on SQLite adapter for test backend
Pulls latest utopia-php/database (e44768f) with the emulateMySQL flag and
opts SQLite into MariaDB-shape behaviour so the existing test suite, which
assumes MariaDB semantics, continues to pass against SQLite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 13:22:08 +12:00
fogelito f03cc847f8 Merge branch '1.9.x' of https://github.com/appwrite/appwrite into set-global-collection
# Conflicts:
#	composer.lock
2026-04-29 17:07:32 +03:00
Torsten Dittmann 6088fd55c8 Merge pull request #12138 from appwrite/feat-out-of-order-chunk-uploads 2026-04-29 18:04:57 +04:00
Jake BarnbyandClaude Opus 4.7 fc90b78f35 fix: filter unsupported index types in all 4 bootstrap createCollection paths
The original fulltext filter only covered the createDatabase() helper, but
http.php has three more inline createCollection paths — two for default
buckets and one for project metadata collections — each of which builds
indexes via array_map without consulting adapter capability flags. SQLite
doesn't support fulltext, so the project-collection path tripped during
EVENT_START and crashed every worker.

Extract buildSupportedIndexes() and use it from all four sites so the
filter is applied consistently. The 1-line ?? defaults on lengths/orders
match the dbForProject site's tolerance for raw config without those keys.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 01:00:11 +12:00
Jake BarnbyandClaude Opus 4.7 c9ed6c531d fix: bypass Audit::setup() so SQLite startup doesn't hit broken Utopia\Exception
utopia-php/audit's Adapter\Database::setup() calls $db->exists($db->getDatabase())
and throws Utopia\Exception on false. Two issues:
1. SQLite adapter's exists($db, null) always returns false (it has no concept
   of named databases — once the file is open, the DB exists), so the throw
   path always fires.
2. The audit lib's `use Utopia\Exception` references a class that doesn't
   exist anywhere in the dependency tree, so the throw fatals with
   `Class "Utopia\Exception" not found`.

Both are upstream bugs, but for this PR I just sidestep the broken setup()
and create the audit collection directly through the regular Database API
using the adapter's schema documents. Same end result, no exists() probe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:54:07 +12:00
fogelito 8eed06678b formatting 2026-04-29 15:54:05 +03:00
Jake BarnbyandClaude Opus 4.7 efc72272e1 fix: keep DB credentials populated and skip fulltext indexes on adapters that lack support
Two fixes for the SQLite test wiring:

1. .env had emptied _APP_DB_USER/_APP_DB_PASS/_APP_DB_ROOT_PASS, but the
   mongodb/mariadb/postgresql containers still consume those during init
   regardless of which adapter Appwrite uses. Empty values left the
   side-running mongodb (needed for documentsdb) refusing to start, which
   blocked docker compose up --wait for every CI matrix row, including
   MongoDB. Restoring the original test credentials.
2. Bootstrap was unconditionally creating fulltext indexes from collection
   configs. SQLite adapter explicitly returns false for
   getSupportForFulltextIndex(), so it threw on the first such index. Now
   the bootstrap consults the adapter and skips fulltext indexes when not
   supported.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:48:21 +12:00
fogelito 7a9a2899ff setGlobalCollections 2026-04-29 15:41:56 +03:00
Jake BarnbyandClaude Opus 4.7 7e25b4fad9 feat: wire SQLite database adapter for tests
SQLite gives e2e tests a single shared file across all containers without
needing a heavyweight MariaDB/MongoDB/PostgreSQL service. WAL + busy_timeout
keep multi-process writers tolerable. Memory adapter was considered but its
per-process PHP arrays don't survive Swoole worker fan-out or cross-container
queue handoffs, so file-backed SQLite is the practical choice.

- registers: add 'sqlite' scheme to pool factory and worker db register,
  configured with PRAGMA journal_mode=WAL, busy_timeout=5000, foreign_keys=ON
- compose: pass _APP_DB_SQLITE_PATH and mount appwrite-sqlite:/storage/sqlite
  on every service that touches the main DB
- .env: switch _APP_DB_ADAPTER to sqlite, drop mariadb from COMPOSE_PROFILES
- ci.yml: add SQLite to the e2e matrix alongside MongoDB so each service
  is timed against both adapters in the same workflow run

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 00:41:09 +12:00
Matej Bačo 32ebfc6cb8 Fix backwards compatibility 2026-04-29 14:14:49 +02:00
Matej Bačo e1b8f5bf98 review improvements 2026-04-29 14:04:54 +02:00
Matej Bačo 4d86e67006 Fix missing scopes for tables 2026-04-29 14:03:44 +02:00
Matej Bačo e010bf25d5 Fix formatting 2026-04-29 13:57:16 +02:00
Matej Bačo aaf91f3816 Improve scopes quality 2026-04-29 13:52:13 +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
Jake Barnby 8ab26aab44 Merge pull request #12171 from appwrite/migration-refractor
Refactor migrations API to module style
2026-04-29 21:44:19 +12:00
Matej Bačo fd42b8fa64 Merge pull request #12175 from appwrite/feat-console-key-scopes-endpoint
Feat: Console key scopes endpoint
2026-04-29 11:17:49 +02:00
Matej Bačo e75fc5b859 Add list scopes endpoint for Console 2026-04-29 10:08:31 +02:00
Jake Barnby 57b8305144 Merge pull request #12134 from appwrite/fix-realtime-span-exporter
added a guard to skip double import
2026-04-29 20:02:04 +12:00
Matej Bačo aca11ed073 Merge pull request #12170 from appwrite/feat-create-dynamic-keys
Feat: create dynamic keys
2026-04-29 09:58:22 +02:00
ArnabChatterjee20k dae9cbcf45 Merge pull request #12070 from appwrite/realtime-action-channels
Realtime action channels
2026-04-29 10:49:13 +05:30
Matej Bačo c1f61b22aa Merge branch '1.9.x' into feat-create-dynamic-keys 2026-04-28 17:18:36 +02:00
Matej Bačo 980762fc3e Rename from dynamic key to ephemeral key (api keys) 2026-04-28 17:18:06 +02:00
premtsd-code cd851bff24 Merge branch '1.9.x' into migration-refractor 2026-04-28 20:32:54 +05:30
Prem Palanisamy 3f5dcc81fd Refactor migrations API to module style 2026-04-28 15:57:41 +01:00
Matej Bačo b2ce95a0cd Dynamic key backwards compatibility 2026-04-28 16:14:10 +02:00
Matej Bačo ed9b47f6ce Migrate project jwt to dynamic api key 2026-04-28 15:57:37 +02:00
Harsh Mahajan 67d24d3ef1 Merge branch '1.9.x' into feat/impersonation-query-params 2026-04-28 19:11:14 +05:30
harsh mahajan 87ed7c3817 feat: add query param fallback for all impersonation params and simplify tests 2026-04-28 19:10:55 +05:30
Matej Bačo 8f176166c9 Re-introduce project JWT endpoint 2026-04-28 15:31:10 +02:00
Torsten Dittmann a0ef145b92 Merge branch '1.9.x' of https://github.com/appwrite/appwrite into feat-out-of-order-chunk-uploads 2026-04-28 17:10:56 +04:00
Matej Bačo cb4cff120b Add Keycloak oauth support 2026-04-28 10:54:13 +02:00
Matej Bačo 49e6a38e7f Add fusionauth oauth 2026-04-28 10:43:16 +02:00
harsh mahajan bda823ac0e chore: format 2026-04-28 13:38:00 +05:30
harsh mahajan 5afc8f462d fix: allow same-site in CSRF guard to support Console on subdomains 2026-04-28 13:26:13 +05:30
Matej Bačo d25707346f Add console oauth endpoint 2026-04-28 09:47:27 +02:00