Skip to content

Conversation

@abnegate
Copy link
Member

@abnegate abnegate commented Oct 6, 2025

Reverts #721

Summary by CodeRabbit

  • New Features
    • Added NOT query operators: notContains, notSearch, notStartsWith, notEndsWith, notBetween.
  • Refactor
    • Switched ID validation to objectId.
    • Reduced maximum length for keys, labels, and roles to 36 characters.
    • Simplified index/attribute validation; removed checks for multiple FULLTEXT and identical indexes.
  • Chores
    • Removed MongoDB support across app, dependencies, Docker, and CI; updated MySQL and Redis images; trimmed adapter test matrix.
  • Tests
    • Updated e2e/unit tests to reflect new validations and operators; removed MongoDB test suites; clarified spatial capability skips.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Removes MongoDB support across CI, Docker, dependencies, resources, and tests. Refactors adapter interfaces by dropping casting and certain capability methods, tightening getAttributeProjection return types, and adding spatial capability checks. Updates Database core for static query conversion and relationship filter subqueries. Simplifies validators and index checks. Adjusts tests accordingly.

Changes

Cohort / File(s) Summary
CI and Docker cleanup
.github/workflows/tests.yml, Dockerfile, docker-compose.yml, tests/resources/mongo/*
Removed MongoDB from test matrix, Docker build, compose services, and test resources (entrypoint/keyfile). Updated MySQL/Redis tags.
Dependencies
composer.json
Dropped MongoDB-related packages/extensions; re-pinned utopia-php/pools; pinned laravel-pint to 1.*; updated suggests.
Adapter interface changes
src/Database/Adapter.php
Removed casting and several capability methods; narrowed getAttributeProjection return type to string.
Adapter implementations
src/Database/Adapter/Pool.php, src/Database/Adapter/SQL.php
Mirrored Adapter changes: removed casting and certain capability APIs; added spatial capability methods in Pool; getAttributeProjection now returns string.
Database core flow
src/Database/Database.php
Renamed VAR_UUID7 to VAR_OBJECT_ID; removed casting hooks; made convertQueries/convertQuery static; replaced convertRelationshipQueries with convertRelationshipFiltersToSubqueries; adjusted index validation timing and cursor handling.
Index validator refactor
src/Database/Validator/Index.php
Simplified constructor (removed indexes and several flags); removed checks for multiple fulltext/identical indexes; tightened messages and unconditional attribute checks.
Query validators simplification
src/Database/Validator/Queries/Documents.php, src/Database/Validator/Query/Filter.php, .../Order.php, .../Select.php, src/Database/Validator/Structure.php
Removed supportForAttributes parameters/paths; now always validate attribute existence and values. Adjusted constructors accordingly.
Key/Label/UID limits
src/Database/Validator/Key.php, src/Database/Validator/Label.php, src/Database/Validator/UID.php
Reduced max length messaging to 36; removed KEY_MAX_LENGTH constant; updated descriptions.
Sequence validator
src/Database/Validator/Sequence.php
Switched UUID7 validation to 24-hex Object ID.
E2E tests cleanup and updates
tests/e2e/Adapter/MongoDBTest.php, tests/e2e/Adapter/SharedTables/MongoDBTest.php, tests/e2e/Adapter/Scopes/*
Removed MongoDB tests; dropped adapter capability guards; updated index definitions/expectations; standardized IDs and messages; used markTestSkipped for unsupported spatial features.
Unit tests updates
tests/unit/QueryTest.php, tests/unit/Validator/IndexTest.php, tests/unit/Validator/KeyTest.php, tests/unit/Validator/LabelTest.php, tests/unit/Validator/PermissionsTest.php, tests/unit/Validator/StructureTest.php
Added NOT query type tests; aligned with new Index constructor and FULLTEXT message; enforced 36-char limits; switched to VAR_OBJECT_ID and sample ObjectId.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Database
  participant Adapter

  Note over Database: Query conversion now static<br/>and uses relationship filter subqueries

  Client->>Database: findDocuments(collection, queries)
  activate Database
  Database->>Database: convertQueries(collection, queries) [static]
  Database->>Database: convertRelationshipFiltersToSubqueries(relationships, queries)
  Database->>Adapter: executeFind(collection, convertedQueries)
  activate Adapter
  Adapter-->>Database: result rows
  deactivate Adapter
  Database-->>Client: documents (no adapter casting hooks)
  deactivate Database
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • fogelito

Poem

A rabbit hops through fields of code,
Mongo’s burrow now off-road.
Indices trimmed, projections tight,
Filters turn to subquery light.
IDs gleam in hex’s sheen,
Spatial steps marked “skip” and clean—
Thump-thump: the tests still green. 🐇✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-721-feat-mongodb

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33ca426 and d49a7dd.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (35)
  • .github/workflows/tests.yml (0 hunks)
  • Dockerfile (2 hunks)
  • composer.json (1 hunks)
  • docker-compose.yml (3 hunks)
  • src/Database/Adapter.php (1 hunks)
  • src/Database/Adapter/Pool.php (2 hunks)
  • src/Database/Adapter/SQL.php (1 hunks)
  • src/Database/Database.php (14 hunks)
  • src/Database/Validator/Index.php (5 hunks)
  • src/Database/Validator/Key.php (2 hunks)
  • src/Database/Validator/Label.php (1 hunks)
  • src/Database/Validator/Queries/Documents.php (1 hunks)
  • src/Database/Validator/Query/Filter.php (1 hunks)
  • src/Database/Validator/Query/Order.php (2 hunks)
  • src/Database/Validator/Query/Select.php (2 hunks)
  • src/Database/Validator/Sequence.php (1 hunks)
  • src/Database/Validator/Structure.php (2 hunks)
  • src/Database/Validator/UID.php (1 hunks)
  • tests/e2e/Adapter/MongoDBTest.php (0 hunks)
  • tests/e2e/Adapter/Scopes/AttributeTests.php (16 hunks)
  • tests/e2e/Adapter/Scopes/CollectionTests.php (1 hunks)
  • tests/e2e/Adapter/Scopes/DocumentTests.php (24 hunks)
  • tests/e2e/Adapter/Scopes/GeneralTests.php (0 hunks)
  • tests/e2e/Adapter/Scopes/IndexTests.php (4 hunks)
  • tests/e2e/Adapter/Scopes/PermissionTests.php (0 hunks)
  • tests/e2e/Adapter/Scopes/SpatialTests.php (15 hunks)
  • tests/e2e/Adapter/SharedTables/MongoDBTest.php (0 hunks)
  • tests/resources/mongo/entrypoint.sh (0 hunks)
  • tests/resources/mongo/mongo-keyfile (0 hunks)
  • tests/unit/QueryTest.php (3 hunks)
  • tests/unit/Validator/IndexTest.php (8 hunks)
  • tests/unit/Validator/KeyTest.php (1 hunks)
  • tests/unit/Validator/LabelTest.php (1 hunks)
  • tests/unit/Validator/PermissionsTest.php (3 hunks)
  • tests/unit/Validator/StructureTest.php (2 hunks)

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.

@abnegate abnegate closed this Oct 6, 2025
@abnegate abnegate deleted the revert-721-feat-mongodb branch October 6, 2025 04:24
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.

2 participants