Skip to content

RUBY-4003 Public API audit: tag internal members @api private (reference only) - #3133

Draft
jamis wants to merge 21 commits into
mongodb:masterfrom
jamis:4003-public-api-audit
Draft

jamis wants to merge 21 commits into
mongodb:masterfrom
jamis:4003-public-api-audit

Conversation

@jamis

@jamis jamis commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Reference-only PR for RUBY-4003. Not intended for merge at this time.

It audits the driver's public API surface. Internal members that were accidentally public are tagged @api private, and the public set is made explicit. The changes are almost entirely YARD comments, with no runtime behavior change. Each of the 20 commits covers one cluster of classes.

jamis added 21 commits November 12, 2026 10:12
Tag driver-internal Database constants and delegated methods, the
Retryable module, and Database::View as @api private. Document the
read_preference, read_concern, and write_concern delegators, which
remain public.
Tag driver-internal Client constants, cluster, encrypter, and
server_selector as @api private, along with Collection#server_selector,
the Loggable module, and every tracer accessor. Document the Client
delegators and closed?, which remain public.
Tag CAPPED, NS, CHANGEABLE_OPTIONS and the cluster, encrypted_fields_map
and next_primary delegators on Collection as private API, and deprecate
parallel_scan. Remove the semipublic tag from Collection::View, document
selector, and mark View#timeout_ms and its internal delegators private.
Tag plumbing on Aggregation::Behavior, MapReduce, Builder, Readable,
Writable and ChangeStream. Deprecate Readable#map_reduce, MapReduce and
Readable#modifiers in the docs, document ChangeStream#to_enum, and fix
the unresolvable ChangeStream return type on the watch methods.
Tag the transaction state and error message constants and the
cluster, dirty!, snapshot?, txn_num, txn_options, txn_read_preference,
retry_writes?, implicit? and explicit? members. Tag
ClusterTime::Consumer explicitly and replace its note, which wrongly
called its methods public API.

Fix stale or incomplete docs on with_transaction, start_transaction,
commit_transaction and abort_transaction.
Tag internal Monitoring dispatch, Publishable, Secure, log subscribers,
and the pool and started_event readers on events as @api private. Remove
the inconsistent @api experimental tag from event classes so their
subscriber payload members are public.
Tag Cluster at class level, keep the Topology types public with an
explicit note that SDAM events expose them, and tag Topology bookkeeping
members private. Reword Result#cluster_time to return BSON::Document.
Nest the class in sdam_flow.rb so its license header no longer replaces
the Cluster docstring in YARD.
Retire the remaining @api semiprivate tags. Operation::Result and the
Insert, Update and Delete result classes stay public as return types of
public methods; bulk results, cursor results, CachingCursor and the
Result plumbing members become private. Crypt::RewrapManyDataKeyResult
becomes public.
Tag internal error constants, initializers, and helpers @api private,
retire the remaining @api experimental tags, and add @deprecated to
error classes the driver never raises.
Tag URI parsing constants, URI#srv_records, the Address resolver
classes, and Options::Mapper as private. URI, Address, and
Options::Redacted stay public. Fix the URI#options description.
Tag Tracing, CursorHost, and the Event plumbing private, and make the
Mongo.* option accessors, Logger, QueryCache, Index constants, VERSION,
DBRef, and Event::Base explicitly public.
Database#cursor_command returns a Cursor, so make the class public with
a trimmed surface and tag its plumbing private. Fix doc return types that
YARD could not resolve, including OperationFailure::Family.
Conflicts resolved by taking upstream code and wording and keeping the @api tags. New upstream URI serialization hooks and SENSITIVE_URI_OPTIONS are tagged @api private.

This branch has not been deployed

No deployments
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