Skip to content

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Feb 11, 2026

Summary

  • Add 15 remaining M3 commands via RunCommand and Go driver APIs:
    • Database info: db.stats(), db.serverStatus(), db.serverBuildInfo(), db.version(), db.hostInfo(), db.listCommands()
    • Collection info: collection.stats(), collection.dataSize(), collection.storageSize(), collection.totalIndexSize(), collection.totalSize(), collection.isCapped()
    • Collection admin: collection.validate(), collection.latencyStats()
    • Index management: collection.createIndexes()
  • Empties the method registry so all commands execute natively without mongosh fallback
  • This completes the full M3 milestone

Test plan

  • All new commands have integration tests in admin_test.go
  • Unit tests pass: go test ./internal/...
  • go vet ./... passes
  • Test binary compiles: go test -c -o /dev/null .

🤖 Generated with Claude Code

Add 15 remaining M3 commands via RunCommand and Go driver APIs:
- Database info: db.stats(), db.serverStatus(), db.serverBuildInfo(),
  db.version(), db.hostInfo(), db.listCommands()
- Collection info: collection.stats(), collection.dataSize(),
  collection.storageSize(), collection.totalIndexSize(),
  collection.totalSize(), collection.isCapped()
- Collection admin: collection.validate(), collection.latencyStats()
- Index management: collection.createIndexes()

This completes the full M3 milestone, emptying the method registry
so all commands execute natively without mongosh fallback.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copilot AI review requested due to automatic review settings February 11, 2026 08:10
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

Implements the remaining M3 administrative/metadata commands end-to-end (parser translation → operation types → executor implementations) and adds integration coverage for them.

Changes:

  • Added new operation types and wired translator visitor cases for remaining DB/collection admin commands (including createIndexes, stats/info commands, validate, latencyStats).
  • Implemented executor support via RunCommand, collStats, aggregation $collStats, and Go driver index APIs.
  • Added integration tests in admin_test.go for the new commands and removed all “planned/fallback” entries from the method registry.

Reviewed changes

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

Show a summary per file
File Description
types/operation_type.go Adds new OperationType constants for M3 admin/info commands.
internal/translator/visitor.go Routes new parsed commands/method calls to the new operation types.
internal/translator/types.go Extends Operation with IndexSpecs for createIndexes().
internal/translator/method_registry.go Clears planned-method registry (no more mongosh fallback for M1–M3).
internal/translator/collection.go Adds argument extraction for createIndexes() specs.
internal/executor/executor.go Dispatches new operation types to executor implementations.
internal/executor/admin.go Implements createIndexes plus DB/collection info/admin commands.
client.go Documents result shapes for the new operations.
admin_test.go Adds integration tests for all newly implemented commands.

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

h3n4l and others added 3 commits February 11, 2026 16:17
All M3 methods are now implemented natively, so the method registry
that tracked planned-but-unimplemented methods is no longer needed.

- Delete internal/translator/method_registry.go and method_registry.go
- Remove public IsPlannedMethod/MethodRegistryStats APIs from errors.go
- Simplify handleUnsupportedMethod to always return UnsupportedOperationError
- Remove obsolete TestPlannedOperation and TestMethodRegistryStats tests

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Address PR review feedback:
- Validate 'key' field is a non-empty bson.D in extractCreateIndexesArgs
- Return errors on type mismatches for createIndexes spec fields
  (key, name, unique, sparse, expireAfterSeconds) instead of
  silently ignoring
- Return error when version field is missing from buildInfo result
  in executeDbVersion

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Fix ineffectual assignment lint error in extractCreateIndexesArgs
- Remove redundant nil check before len() (staticcheck S1009)
- Skip TestServerStatus on DocumentDB (serverStatus unsupported)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@h3n4l h3n4l requested a review from rebelice February 11, 2026 08:27
@h3n4l h3n4l merged commit d2ea344 into main Feb 11, 2026
2 checks passed
@h3n4l h3n4l deleted the feat/m3-remaining-admin-commands branch February 11, 2026 08:31
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