Skip to content

refactor(storage): organise vector, analytics and lifecycle code by domain - #913

Merged
Tr00d merged 1 commit into
masterfrom
refactor/storage-domains
Nov 26, 2026
Merged

Tr00d merged 1 commit into
masterfrom
refactor/storage-domains

Conversation

@Tr00d

@Tr00d Tr00d commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Why

Storage/Common/ held 36 files from three unrelated domains: file buckets (lifecycle), vector buckets, and analytics buckets with their Iceberg catalog. An analytics type knows nothing about vectors, and the reverse is also true. This PR puts each domain's types together, so a domain reads as one folder.

The PR only moves files. Nothing behaves differently, and no type or member is renamed. Folders and namespaces drop the redundant domain prefix (CreateVectorBucket/ becomes VectorBuckets/CreateBucket/), but type names keep it (VectorBucketSummary, ListAnalyticsBucketsOptions).

Layout

Storage/
  Common/                  PathSegment, QueryString
  FileBuckets/
    Common/                BucketLifecycle, LifecycleRule, LifecycleRuleStatus, NoncurrentVersionExpiration, BucketLifecyclePath
    GetBucketLifecycle/  UpdateBucketLifecycle/
  VectorBuckets/
    IStorageVectorBucketApi, IVectorBucket, IVectorIndex, StorageVectorBucketApi, VectorBucket, VectorIndex
    Common/                StoredVector, StoredVectorBody, VectorContent, VectorContentRequest, VectorData,
                           VectorDataType, VectorDistanceMetric, VectorListPage, VectorService
    CreateBucket/ ListBuckets/ DeleteBucket/
    CreateIndex/ GetIndex/ ListIndexes/ DeleteIndex/
    PutVectors/ GetVectors/ ListVectors/ DeleteVectors/ QueryVectors/
  AnalyticsBuckets/
    IStorageAnalyticsApi, StorageAnalyticsApi
    Common/                AnalyticsBucket, AnalyticsBucketName
    CreateBucket/ ListBuckets/ DeleteBucket/
    Iceberg/
      IIcebergCatalog, IcebergCatalog
      Common/              Iceberg* types, IcebergTypeConverter, TableMetadataResponse
      CreateNamespace/ ListNamespaces/ CreateTable/ ListTables/ DeleteTable/ UpdateTable/
  • The folders are named VectorBuckets/AnalyticsBuckets/FileBuckets, not Vectors/Analytics, because IStorageClient has properties called Vectors and Analytics (CONVENTIONS §2: never name a folder after a name in scope).
  • Namespaces follow the folders, for example Supabase.Storage.VectorBuckets.CreateBucket and Supabase.Storage.AnalyticsBuckets.Iceberg.Common.
  • Storage.Tests has the same tree. Test folders, Data/ fixtures and Verify .verified.txt snapshots moved with their production counterparts. Test-only use-case folders moved into their domain (DeleteBucketLifecycle to FileBuckets/, AccessVectorIndex to VectorBuckets/AccessIndex/, and DeleteNamespace, LoadTable, NamespaceExists and TableExists to AnalyticsBuckets/Iceberg/). Support/ stays shared.
  • CONVENTIONS §2 gains a bullet on per-domain folders.

Nothing breaking

  • No shipped type moves. All the types that moved are absent from PublicAPI.Shipped.txt. Shipped file-bucket code (Bucket, FileObject, IStorageBucketApi, StorageBucketApi, ...) stays where it is, and the lifecycle members stay on IStorageBucketApi. Only the types those members reference moved.
  • PublicAPI.Shipped.txt is unchanged.
  • PublicAPI.Unshipped.txt: each of the 722 changed entries is the old entry with only its namespace rewritten. The record members the code fixer can drop (<Clone>$, Equals, operators) are all still there. The gate's public API diff signal reports these entries as "722 REMOVED". It compares namespaces of unshipped types, and those types have never been released.
  • Snapshot names come from class and method names, which did not change. Every .verified.txt sits next to its test class, and no snapshot was regenerated or orphaned.
  • No assertion changed. Besides usings and namespaces, the only edits are the JSON fixture paths in Storage.Tests.csproj and their Path.Combine readers, one fully-qualified IIcebergCatalog reference in a test, and one cref (Interfaces.IVectorBucket.GetIndexAsync became IVectorBucket.GetIndexAsync).

Cross-domain types

None. No moved type is used by more than one domain.

PathSegment and QueryString stay in Storage/Common/ as approved. Today only analytics buckets and the Iceberg catalog use them: PathSegment is used by AnalyticsBucketName, IcebergNamespace and IcebergTable, and QueryString by the Iceberg list queries. That does not match the new rule that the product's Common/ holds only what two domains share. If you want them to follow their usages, PathSegment would move to AnalyticsBuckets/Common/ and QueryString to AnalyticsBuckets/Iceberg/Common/.

Verification

  • gate.sh packages/Storage --fast: PARTIAL (exit 0). Build at baseline, format clean, 752/752 Unit + Contract tests pass, public API declared.
  • Full gate: INCOMPLETE. The local stack was down, so E2E and coverage were skipped. CI is the gate for those.

@Tr00d
Tr00d marked this pull request as ready for review November 26, 2026 13:02
@Tr00d
Tr00d merged commit c70d62b into master Nov 26, 2026
7 checks passed
@Tr00d
Tr00d deleted the refactor/storage-domains branch November 26, 2026 13:06
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