Skip to content

feat: simplify method registry to track only planned M2/M3 operations#13

Merged
rebelice merged 1 commit intomainfrom
vk/bd54-gomongo-mileston
Jan 21, 2026
Merged

feat: simplify method registry to track only planned M2/M3 operations#13
rebelice merged 1 commit intomainfrom
vk/bd54-gomongo-mileston

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Jan 20, 2026

Summary

  • Simplify method registry to track only 32 planned methods (M2: 10, M3: 22)
  • New error handling design:
    • Methods IN registry → PlannedOperationError (caller should fallback to mongosh)
    • Methods NOT IN registry → UnsupportedOperationError (no fallback, just error)
  • Replace DeprecatedOperationError with PlannedOperationError
  • Remove Hint field from UnsupportedOperationError

This replaces the previous design that tracked deprecated/unsupported status for 297+ methods. The new design is simpler and focused on the fallback decision.

Registry Contents (32 methods)

Milestone 2 - Write Operations (10):

  • insertOne, insertMany
  • updateOne, updateMany, replaceOne
  • deleteOne, deleteMany
  • findOneAndUpdate, findOneAndReplace, findOneAndDelete

Milestone 3 - Administrative Operations (22):

  • Index: createIndex, createIndexes, dropIndex, dropIndexes
  • Collection: drop, renameCollection, createCollection, dropDatabase
  • Database Info: stats, serverStatus, serverBuildInfo, version, hostInfo, listCommands
  • Collection Info: stats, dataSize, storageSize, totalIndexSize, totalSize, isCapped, validate, latencyStats

Test plan

  • go build ./... passes
  • golangci-lint run passes with 0 issues
  • TestPlannedOperation - verifies insertOne returns PlannedOperationError
  • TestUnsupportedOperation - verifies createSearchIndex returns UnsupportedOperationError
  • TestMethodRegistryStats - verifies registry contains 32 methods

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings January 20, 2026 09:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the method registry from tracking 297+ methods with deprecated/unsupported statuses to focusing on only 32 planned methods for M2 and M3 milestones. The error handling design is streamlined: methods in the registry return PlannedOperationError (indicating fallback to mongosh is available), while methods not in the registry return UnsupportedOperationError (no fallback available).

Changes:

  • Replaced DeprecatedOperationError with PlannedOperationError for clearer error semantics
  • Removed Hint field from UnsupportedOperationError to simplify error structure
  • Reduced method registry to 32 planned methods (10 from M2 write operations, 22 from M3 administrative operations)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
errors.go Replaced DeprecatedOperationError with PlannedOperationError and removed Hint field from UnsupportedOperationError
method_registry.go Simplified registry to track only 32 planned methods; replaced complex lookup with simple IsPlannedMethod function
translator.go Updated handleUnsupportedMethod to use new error types and simplified context handling with string literals
executor.go Removed usage of Hint field when creating UnsupportedOperationError
executor_test.go Updated tests to verify new error types and registry count of 32 methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@h3n4l h3n4l marked this pull request as draft January 20, 2026 10:15
…ions

- Reduce method registry from 297 entries to 32 (M2: 10, M3: 22)
- Replace DeprecatedOperationError with PlannedOperationError
- Methods in registry return PlannedOperationError (planned for future)
- Methods not in registry return UnsupportedOperationError
- Refactor visitMethodCall to use switch statement
- Update parser dependency for optional aggregate arguments
- Simplify genericMethod handling - all are unsupported

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@h3n4l h3n4l force-pushed the vk/bd54-gomongo-mileston branch from 6c00c59 to fe8159e Compare January 21, 2026 03:15
@h3n4l h3n4l marked this pull request as ready for review January 21, 2026 03:15
@rebelice rebelice merged commit 23dea8c into main Jan 21, 2026
2 checks passed
@rebelice rebelice deleted the vk/bd54-gomongo-mileston branch January 21, 2026 03:28
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.

3 participants