Skip to content

[ENH]: Get collections impl#6146

Merged
sanketkedia merged 10 commits intomainfrom
01-10-_enh_get_collections_impl
Jan 15, 2026
Merged

[ENH]: Get collections impl#6146
sanketkedia merged 10 commits intomainfrom
01-10-_enh_get_collections_impl

Conversation

@sanketkedia
Copy link
Copy Markdown
Contributor

@sanketkedia sanketkedia commented Jan 11, 2026

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Implements a generic get collection filter that encompasses all possible types of reads of collections
    • Creates indexes for faster lookup
    • Implements e2e GetCollections
  • New functionality
    • ...

Test plan

How are these changes tested?
Added test

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Migration plan

None

Observability plan

None

Documentation Changes

None

@github-actions
Copy link
Copy Markdown

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Copy Markdown
Contributor Author

sanketkedia commented Jan 11, 2026

@sanketkedia sanketkedia marked this pull request as ready for review January 11, 2026 00:16
@propel-code-bot
Copy link
Copy Markdown
Contributor

propel-code-bot bot commented Jan 11, 2026

Implement Spanner-backed get_collections endpoint with filtering and new indexes

Introduces a full Rust implementation of the get_collections RPC backed by Spanner, plus supporting data-model and index changes. Adds a fluent CollectionFilter builder, request/response wiring, a dynamic Spanner query with pagination, and extensive multi-region integration tests.

Key Changes

• Added CollectionFilter, GetCollectionsRequest, and GetCollectionsResponse types with TryFrom implementations and backend routing logic in rust/rust-sysdb/src/types.rs.
• Implemented SpannerBackend::get_collections with dynamic WHERE clauses, pagination, row aggregation, and conversion to Collection objects in rust/rust-sysdb/src/spanner.rs.
• Exposed the new backend method through Backend and the gRPC server (get_collections) so clients receive the populated proto response.
• Created new Spanner migrations for collections_lookup_idx (unique by tenant/database/name), collections_list_idx (tenant/database/created_at), and dropped the existing segment_unique_idx to support replication.
• Expanded MCMR integration tests to cover the new filtering pathways (IDs, name/tenant/database, pagination, metadata, null dimensions, isolation) ensuring expected behaviour.

Affected Areas

• rust/rust-sysdb/src/spanner.rs
• rust/rust-sysdb/src/types.rs
• rust/rust-sysdb/src/backend.rs
• rust/rust-sysdb/src/server.rs
• rust/spanner-migrations/migrations
• rust/rust-sysdb/src/tests within spanner module

This summary was automatically generated by @propel-code-bot

@sanketkedia sanketkedia force-pushed the 01-07-_enh_create_collection_impl_in_rust_sysdb branch from 0197b36 to ecca61f Compare January 11, 2026 21:25
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from 75c2da6 to 578c9ec Compare January 11, 2026 21:25
@sanketkedia sanketkedia force-pushed the 01-07-_enh_create_collection_impl_in_rust_sysdb branch from ecca61f to 18a2fa3 Compare January 12, 2026 15:49
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from 578c9ec to 6588983 Compare January 12, 2026 15:49
@sanketkedia sanketkedia force-pushed the 01-07-_enh_create_collection_impl_in_rust_sysdb branch from 18a2fa3 to 272af49 Compare January 12, 2026 16:27
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from 6588983 to 8929be5 Compare January 12, 2026 16:27
@sanketkedia sanketkedia force-pushed the 01-07-_enh_create_collection_impl_in_rust_sysdb branch from 272af49 to 545ac09 Compare January 13, 2026 02:20
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from 8929be5 to 29a65f5 Compare January 13, 2026 02:20
@sanketkedia sanketkedia force-pushed the 01-07-_enh_create_collection_impl_in_rust_sysdb branch from 545ac09 to b42abb8 Compare January 13, 2026 17:20
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch 3 times, most recently from e480dbb to 3fd3f10 Compare January 13, 2026 17:39
@sanketkedia sanketkedia force-pushed the 01-07-_enh_create_collection_impl_in_rust_sysdb branch from 448dadd to 9723f17 Compare January 13, 2026 23:40
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from 3fd3f10 to 7e28350 Compare January 13, 2026 23:40
@sanketkedia sanketkedia changed the base branch from 01-07-_enh_create_collection_impl_in_rust_sysdb to graphite-base/6146 January 14, 2026 02:56
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from 7e28350 to d2ac304 Compare January 14, 2026 02:56
@graphite-app graphite-app bot changed the base branch from graphite-base/6146 to main January 14, 2026 02:57
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from d2ac304 to c35ebab Compare January 14, 2026 02:57
@sanketkedia sanketkedia force-pushed the 01-10-_enh_get_collections_impl branch from c35ebab to 0ca022f Compare January 14, 2026 03:01
}

// Filter by tenant_id
if filter.tenant_id.is_some() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical

[Security] Security Risk: The get_collections implementation allows executing queries without a tenant_id filter if it's missing from the request. In a multi-tenant system, this allows cross-tenant data access, potentially exposing all collections in the database.

Ensure tenant_id is mandatory or explicitly validated to be present before executing the query.

Context for Agents
Security Risk: The `get_collections` implementation allows executing queries without a `tenant_id` filter if it's missing from the request. In a multi-tenant system, this allows cross-tenant data access, potentially exposing all collections in the database.

Ensure `tenant_id` is mandatory or explicitly validated to be present before executing the query.

File: rust/rust-sysdb/src/spanner.rs
Line: 646

@sanketkedia sanketkedia merged commit 4c81f23 into main Jan 15, 2026
128 of 130 checks passed
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