Commit Graph

10073 Commits

Author SHA1 Message Date
Prem Palanisamy e42ea02ee1 Add AuthMethods migration support
- Bump utopia-php/migration to add-auth-methods-migration dev branch
- Add MigrationReport rule for TYPE_AUTH_METHODS
- E2E: testAppwriteMigrationAuthMethods flips email-password + JWT on
  source, runs migration, asserts both land as false on destination
2026-05-18 13:09:13 +01:00
Prem Palanisamy 8620cf1921 Add webhook migration support
MigrationReport now exposes webhook count. Composer pins point at
the add-webhook-migration dev branches.
2026-05-14 20:28:23 +01:00
Prem Palanisamy d64d7ece12 Add project variable migration support
Reports project-variable counts in MigrationReport and points the
migration lib pin at the add-project-variable-migration dev branch.
2026-05-14 17:24:32 +01:00
Prem Palanisamy 2b652a2b72 Drop stray trailing comma in Key::decode return 2026-05-14 11:25:09 +01:00
Prem Palanisamy 18fc760077 Remove stale console-key cleanup leftovers 2026-05-14 11:10:19 +01:00
Prem Palanisamy 6c35e86d98 Merge remote-tracking branch 'origin/feat-platform-db-access' into add-api-key-migration
# Conflicts:
#	app/controllers/api/migrations.php
#	app/controllers/shared/api.php
#	composer.json
#	composer.lock
#	src/Appwrite/Platform/Workers/Migrations.php
#	src/Appwrite/Utopia/Response/Model/MigrationReport.php
#	tests/e2e/Services/Migrations/MigrationsBase.php
2026-05-14 11:07:23 +01:00
premtsd-code beb119883a Merge branch '1.9.x' into feat-platform-db-access 2026-05-14 08:37:33 +01:00
harsh mahajan 5b7d6f1ca6 Fix project specs navigation order 2026-05-14 12:13:13 +05:30
Jake Barnby a4d1043684 Merge pull request #12302 from appwrite/fix-transaction-deletes
fix: match transactions collection name in deletes worker
2026-05-14 17:48:18 +12:00
Prem Palanisamy 0497137d80 Merge remote-tracking branch 'origin/1.9.x' into feat-platform-db-access
# Conflicts:
#	composer.lock
2026-05-14 06:20:03 +01:00
Jake Barnby 10eae0ab87 fix: match transactions collection name in deletes worker
The DELETE_TYPE_TRANSACTION constant was 'transaction' (singular), so
the worker's inner switch on $document->getCollection() (which returns
'transactions') never matched and every transaction deletion fell to
the default branch, logging "No lazy delete operation available for
document of type: transactions". Renamed to DELETE_TYPE_TRANSACTIONS
to align with every other constant used in that switch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 13:58:40 +12:00
Prem Palanisamy bddde5f298 Merge remote-tracking branch 'origin/1.9.x' into feat-platform-db-access
# Conflicts:
#	app/controllers/api/migrations.php
#	composer.json
#	composer.lock
#	src/Appwrite/Platform/Workers/Migrations.php
2026-05-13 16:36:39 +01:00
Chirag Aggarwal 85e2cf7d8b (refactor): Migrate queueForFunctions to FunctionPublisher and FunctionMessage 2026-05-13 18:28:05 +05:30
loks0n 24e108fdbf fix: use canonical project.id/user.id so trace sampler matches realtime and VCS spans
The sampler reads project.id from the span; realtime and VCS were storing it
under namespaced keys (realtime.project.id, vcs.github.event.repo.{id}.project.id),
causing all those spans to be dropped when _APP_TRACE_PROJECT_ID was set.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 11:03:28 +01:00
loks0n a0c4b7695e chore: normalize Span keys and centralize span lifecycle
Span attribute keys are now snake_case with dots only for child
relationships. Worker span lifecycle moved to app/worker.php; selective
trace filtering moved to the exporter sampler in app/init/span.php so
handlers only call Span::add.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-13 10:29:42 +01:00
Jake Barnby be2bb984c5 Merge pull request #12194 from appwrite/feat-insights-module
feat(insights): add insights module with CTA framework
2026-05-13 17:34:56 +12:00
Jake Barnby b058eb31f4 (refactor): inline CTAs as JSON on insights collection 2026-05-13 17:10:33 +12:00
Chirag Aggarwal 31fbc64ad2 Update SDK generator cover image config 2026-05-13 10:19:54 +05:30
Luke B. Silver 35941ddc34 Merge pull request #12220 from appwrite/feat/utopia-http-resources-context
Migrate to utopia-php/http resources/context API
2026-05-12 23:01:29 +01:00
Jake Barnby b85ca1536a (fix): remove redundant null coalesce on always-defined variable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 01:53:33 +12:00
Jake Barnby 304b0dab35 (fix): address greptile P1 review comments
- Add skipFilters to Reports/Get.php (was the only endpoint still
  triggering the full N+1 subquery cascade)
- Scale CTA batch limit dynamically (insightCount * MAX_CTA_COUNT)
  instead of fixed APP_LIMIT_SUBQUERY to prevent silent truncation
- Revert deleteReport to callback-based pagination so CTAs are not
  orphaned when a report has more than APP_LIMIT_SUBQUERY insights
- Add explicit prefix lengths (700) to _key_project_resource and
  _key_project_parent_resource indexes to stay under InnoDB 3072-byte limit
- Validate CTA service/method against ADVISOR_CTA_SERVICES and
  ADVISOR_CTA_METHODS enums in the CTAs validator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 01:42:59 +12:00
Jake Barnby 9da4a3260d (refactor): improve advisor module perf, security, and maintainability
- Fix N+1 in Reports/XList (51→4 queries) via skipFilters + batch fetch
- Add skipFilters to Reports/Delete and cursor fetch (avoid loading all
  nested insights/CTAs just for ownership check)
- Fix N+1 in deleteReport worker (flat CTA deletion instead of per-insight)
- Add advisor entity cleanup on project deletion (reports, insights, CTAs)
- Remove resourceInternalId, parentResourceInternalId, $permissions from
  Insight response model (internal IDs leak DB internals, permissions unused)
- Remove dead subQueryInsightCTAs filter registration
- Remove stale enum-value comments from platform schema
- Fix _key_dismissedAt index to include projectInternalId
- Fix scope category from 'Other' to 'Advisor'
- Switch action base class from Utopia\Platform\Action to Appwrite\Platform\Action

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 01:13:37 +12:00
Jake Barnby 8c8a56ed43 Merge pull request #12273 from appwrite/refactor-target-fetch
fix(messaging): remove redundant user fetch
2026-05-13 01:00:26 +12:00
Matej Bačo b655f24172 Fix warning 2026-05-12 14:49:59 +02:00
Matej Bačo 5a748c2783 PR review fixes 2026-05-12 14:46:33 +02:00
Matej Bačo 0ca52a1bdb Request enum params sdk method name 2026-05-12 14:39:13 +02:00
Matej Bačo 17e9c313f0 Fix response format enum sdk names 2026-05-12 14:17:31 +02:00
Jake Barnby f9ff1166b9 (perf): batch-fetch CTAs across an insight set to collapse N+1 2026-05-12 23:24:26 +12:00
Jake Barnby 4cd35e4d93 Merge branch '1.9.x' into feat-insights-module 2026-05-12 22:59:34 +12:00
Matej Bačo 5e1439f64e Merge pull request #12276 from appwrite/feat-rework-project-response-model
Feat: Rework project response model
2026-05-12 12:57:16 +02:00
loks0n 1cef07a2d4 Fix GraphQL coroutine context propagation
Promises\Swoole was already propagating the request container into child
coroutines, but using its own pre-existing key (__utopia_http_request_container)
rather than the new utopia-php/http key (__utopia__). With the keys
mismatched, the propagation was dead code and resolvers spawned from
webonyx coroutines saw an empty context, failing every GraphQL query
with 'Dependency utopia:graphql not found'.

Align the key so child coroutines actually inherit the request's
container (wrapped as a child Container, so request-scoped overrides
in the resolver can't bleed back into the outer request).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:47:52 +01:00
loks0n 040ce6e335 Simplify Swoole worker bootstrap
EVENT_START and EVENT_TASK were each constructing `new Http($swoole, 'UTC')`
purely as a vehicle to reach DI -- never configuring routing, never calling
->run(). Now that the Swoole adapter exposes resources() directly, the
Http instance is no longer needed: the resources container we passed into
the Server constructor is already in scope as $container.

Drop the throwaway Http construction, pass $container straight through, and
update createDatabase() to take Container instead of Http to match. Also
rename $swooleAdapter to $swoole for consistency with the rest of the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:47:51 +01:00
loks0n 4bdcdb6f96 Migrate to utopia-php/http resources/context API
Adopts the new split DI containers in utopia-php/http: `resources()` for
boot-time wiring (shared across requests) and `context()` for per-request
state. Replaces the removed `getResource()`/`setResource()`/`getContainer()`
helpers throughout the HTTP entry point, controllers, GraphQL layer, and
installer.

Bumps the dependency chain accordingly: utopia-php/http to the dev branch
(aliased to 0.34.25 to satisfy platform's exact pin), servers 0.4.*,
queue 0.18.*, and pulled-along cli/platform/database upgrades.

Also tightens app/init/resources/request.php by collapsing single-return
factories to arrow functions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 11:41:42 +01:00
Matej Bačo 930c23d7e3 Harden backwards compatibility attributes 2026-05-12 12:27:06 +02:00
Jake Barnby 45f3a64617 (perf): skip subquery filters when loading report for ownership-only check 2026-05-12 22:09:50 +12:00
Matej Bačo 8bef181ad8 Fix scheduler doc missing for functions 2026-05-12 10:44:16 +02:00
Matej Bačo ff92fd229b Revert "Fix function scheduler document missing"
This reverts commit 5ef5ead98f.
2026-05-12 10:43:11 +02:00
Matej Bačo 5ef5ead98f Fix function scheduler document missing 2026-05-12 10:42:56 +02:00
Damodar Lohani 0e87d0b483 fix: remove invalid event label from project delete action
Event::generateEvents() rejects the pattern 'project.delete' because
it parses 'delete' as a resource that must be present in route params.
The pre-migration route did not declare an event label, so functions
and webhooks were never triggered on project deletion. Restore that
behavior by removing the label.
2026-05-12 04:50:58 +00:00
Jake Barnby 51c65093b8 (feat): add appId and appInternalId to reports collection for third-party app submissions 2026-05-12 16:09:38 +12:00
Matej Bačo da3a3b939a Finalize PR 2026-05-11 20:22:50 +02:00
Matej Bačo 36dec7c88f Fix more tests 2026-05-11 19:47:57 +02:00
Matej Bačo 152b45087e Fix more tests 2026-05-11 17:01:00 +02:00
Matej Bačo 6cbf080156 Fix code quality 2026-05-11 16:04:39 +02:00
Matej Bačo 89ec639f87 Fix startup issues 2026-05-11 15:55:53 +02:00
Matej Bačo 870fe72bf6 Fix response filter 2026-05-11 15:40:45 +02:00
Matej Bačo 5cd737b901 Backwards compatibility for GET /v1/project 2026-05-11 15:08:15 +02:00
Jake Barnby c18865423e Merge remote-tracking branch 'origin/1.9.x' into feat-insights-module
# Conflicts:
#	composer.lock
#	src/Appwrite/Platform/Workers/Migrations.php
2026-05-12 00:23:17 +12:00
Chirag Aggarwal 330b11a64b Merge branch '1.9.x' into refactor/mails-messaging-publishers 2026-05-11 17:43:48 +05:30
Jake Barnby 53d18a0d08 refactor(advisor): rename module to Advisor (service-named, top-level)
The module's namespace and directory now match the top-level service
name (`advisor`) instead of one of its resource names (`insights`):

- src/Appwrite/Platform/Modules/Insights -> .../Modules/Advisor
- src/Appwrite/Insights -> src/Appwrite/Advisor
- tests/unit/Insights -> tests/unit/Advisor
- Route group label flipped from `'insights'` to `'advisor'`
- Section-header comments aligned

Resource names (`insights`, `reports`, `insightCTAs`) and the
`Insight*`/`Report` response models stay — those are the resources the
service exposes, not the service itself.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 23:40:06 +12:00