feat: simplify method registry to track only planned M2/M3 operations#13
Merged
feat: simplify method registry to track only planned M2/M3 operations#13
Conversation
There was a problem hiding this comment.
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
DeprecatedOperationErrorwithPlannedOperationErrorfor clearer error semantics - Removed
Hintfield fromUnsupportedOperationErrorto 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.
…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>
6c00c59 to
fe8159e
Compare
rebelice
approved these changes
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PlannedOperationError(caller should fallback to mongosh)UnsupportedOperationError(no fallback, just error)DeprecatedOperationErrorwithPlannedOperationErrorHintfield fromUnsupportedOperationErrorThis 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):
Milestone 3 - Administrative Operations (22):
Test plan
go build ./...passesgolangci-lint runpasses with 0 issuesTestPlannedOperation- verifies insertOne returns PlannedOperationErrorTestUnsupportedOperation- verifies createSearchIndex returns UnsupportedOperationErrorTestMethodRegistryStats- verifies registry contains 32 methods🤖 Generated with Claude Code