Skip to content

feat: migrate to utopia-php/database query-lib#11649

Draft
abnegate wants to merge 38 commits into1.9.xfrom
feat-query-lib
Draft

feat: migrate to utopia-php/database query-lib#11649
abnegate wants to merge 38 commits into1.9.xfrom
feat-query-lib

Conversation

@abnegate
Copy link
Copy Markdown
Member

Summary

  • Replace all Database::VAR_*, INDEX_*, PERMISSION_*, RELATION_* string constants with typed enums (ColumnType, IndexType, PermissionType, RelationType, ForeignKeyAction, RelationSide)
  • Replace getSupportFor*() adapter methods with instanceof Feature\* and $adapter->supports(Capability::*)
  • Update createAttribute(), createIndex(), createRelationship() worker calls to use Attribute, Index, Relationship value objects
  • Introduce unified addHook() registration for all database hooks (Permissions, Tenancy, Relationships, Decorator, Lifecycle)
  • Move usage tracking, user events, and function cache purge from inline ->on() closures to typed Lifecycle hooks
  • Add Metadata decorator hook to replace processDocument() recursion in all document CRUD endpoints
  • Remove processDocument(), checkPermissions(), prepareRelationships() closures from endpoints
  • Convert all 6 collection config files from raw arrays to Attribute/Index value objects (~3000 lines removed)
  • Fix createAttributesFromCollection() bug (raw arrays passed to method expecting Attribute objects)
  • Add permission filtering for joined tables (security fix)
  • Add collection-level authorization check for joined collections

Test plan

  • New e2e tests: testAggregateCount, testAggregateSum, testAggregateAvg, testAggregateMinMax, testGroupBy, testGroupByWithHaving, testDistinct, testCountDistinct, testAggregateWithFilter
  • New e2e tests: testJoin, testLeftJoin, testJoinWithAggregation
  • New security e2e tests: testJoinDeniedWithoutCollectionPermission, testJoinRespectsDocumentPermissions, testJoinWithApiKeyBypassesDocumentPermissions, testJoinToNonexistentCollection
  • Existing database e2e tests pass
  • Existing storage/tokens e2e tests pass
  • Migration tests pass

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5fa95ee7-c81e-4628-8338-4f3090de079a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-query-lib

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

✨ Benchmark results

  • Requests per second: 1,712
  • Requests with 200 status code: 308,246
  • P99 latency: 0.098223128

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,712 1,174
200 308,246 211,281
P99 0.098223128 0.190140638

abnegate added 19 commits March 27, 2026 01:05
@blacksmith-sh
Copy link
Copy Markdown

blacksmith-sh bot commented Mar 26, 2026

Found 128 test failures on Blacksmith runners:

Failures

Test View Logs
› Tests\E2E\Services\Avatars\AvatarsCustomClientTest/testGetFavicon View Logs
› Tests\E2E\Services\Avatars\AvatarsCustomClientTest/testSpecialCharsInitalImage View Logs
› Tests\E2E\Services\Avatars\AvatarsCustomServerTest/testGetBrowser View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testCreateFunction View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testCreateFunctionVariable View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testDeleteVariable View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/
testFunctionDeploymentRetentionWithMaintenance
View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testFunctionDownload View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testFunctionUsage View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testGetVariable View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testListVariables View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testUpdateVariable View Logs
› Tests\E2E\Services\Functions\FunctionsConsoleClientTest/testVariableE2E View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testCreateCustomExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/
testCreateCustomExecutionGuest
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testCreateExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/
testCreateExecutionNoDeployment
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testCreateFunction View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testCreateHeadExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/
testEventTriggerWithClientAuth
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testGetTemplate View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testListTemplates View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testNonOverrideOfHeaders View Logs
› Tests\E2E\Services\Functions\FunctionsCustomClientTest/testSynchronousExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testCancelDeploymentBuild View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testCookieExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testCreateCustomExecutionBinaryRequest
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testCreateCustomExecutionBinaryResponse
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testCreateDeployment View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testCreateDeploymentFromCLI View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testCreateDeploymentLarge View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testCreateExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testCreateFunction View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testCreateFunctionAndDeploymentFromTemplate
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testCreateFunctionAndDeploymentFromTemplateBranch
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testCreateFunctionAndDeploymentFromTemplateCommit
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testDeleteDeployment View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testDeleteExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testDeleteFunction View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testDeleteFunctionRulesCleanup
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testDuplicateDeployment View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testErrorPages View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testErrorPagesEmptyBody View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testErrorPagesPermissions View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testEventTrigger View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testExecutionTimeout View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testFunctionDeploymentRetention
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testFunctionLogging View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testFunctionsDomain View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testFunctionsDomainBinaryRequest
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/
testFunctionsDomainBinaryResponse
View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testFunctionSpecifications View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testGetDeployment View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testGetExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testGetFunction View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testGetRuntimes View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testListDeployments View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testListExecutions View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testListFunctions View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testListSpecs View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testLogAndErrorTruncation View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testRequestFilters View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testResponseFilters View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testScopes View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testSyncCreateExecution View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testUpdateDeployment View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testUpdateDeploymentStatus View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testUpdateFunction View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest/testUpdateSpecs View Logs
› Tests\E2E\Services\Functions\FunctionsCustomServerTest › Tests\E2E\Services</code>
Functions\FunctionsCustomServerTest::testCreateCustomExecution/
testCreateCustomExecution with data set #0
View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testAttributesCollectionsAPI View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testAttributesTablesAPI View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testConnection View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/
testConnectionFailureMissingChannels
View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testConnectionRegionCheck View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testCreateDeployment View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/
testDeleteAttributeCollectionsAPI
View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testDeleteAttributeTablesAPI View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testDeleteIndexCollectionsAPI View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testDeleteIndexTablesAPI View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testIndexesCollectionAPI View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testIndexesTablesAPI View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testManualAuthentication View Logs
› Tests\E2E\Services\Realtime\RealtimeConsoleClientTest/testPing View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testAccountChannelWithQuery
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testCollectionScopedDocumentsChannelReceivesEvents
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testCollectionScopedDocumentsChannelWithQuery
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/testConnection View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testConnectionFailureMissingChannels
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/testConnectionRegionCheck View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testDatabaseChannelWithQuery
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/testFilesChannelWithQuery View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testInvalidQueryShouldNotSubscribe
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testMultipleQueriesWithAndLogic
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testMultipleSubscriptionsDifferentQueryKeys
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testProjectChannelWithHeaderOnly
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testProjectChannelWithQuery
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/testQueryKeys View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testSubscriptionPreservedAfterPermissionChange
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientQueryTest/
testTestsChannelWithQueries
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelAccount View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelDatabase View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/
testChannelDatabaseBulkOperationMultipleClient
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/
testChannelDatabaseCollectionPermissions
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelDatabaseTransaction View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/
testChannelDatabaseTransactionMultipleOperations
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/
testChannelDatabaseTransactionRollback
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelDocumentsdb View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelExecutions View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelFiles View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelMemberships View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelParsing View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelsTablesDB View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelTablesDB View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelTablesDBRowUpdate View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelTeams View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testChannelVectorsDB View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/
testConcurrentRealtimeTrafficCoroutines
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testConnection View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/
testConnectionFailureMissingChannels
View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testConnectionPlatform View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testConnectionRegionCheck View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testManualAuthentication View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/testPingPong View Logs
› Tests\E2E\Services\Realtime\RealtimeCustomClientTest/
testRelationshipPayloadHidesRelatedDoc
View Logs
› Tests\E2E\Services\Sites\SitesConsoleClientTest/
testSiteDeploymentRetentionWithMaintenance
View Logs
› Tests\E2E\Services\Sites\SitesCustomClientTest/testListTemplates View Logs
› Tests\E2E\Services\Sites\SitesCustomServerTest/testPreviewDomain View Logs

Fix in Cursor

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

🔄 PHP-Retry Summary

⚠️ Unable to display test results - exceeds GitHub's comment size limit

The number of flaky tests is too large to display in a single comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant