Skip to content

Clean up some of the pending TODO comments#3015

Open
jamis wants to merge 2 commits intomongodb:masterfrom
jamis:cleanup-TODO
Open

Clean up some of the pending TODO comments#3015
jamis wants to merge 2 commits intomongodb:masterfrom
jamis:cleanup-TODO

Conversation

@jamis
Copy link
Copy Markdown
Contributor

@jamis jamis commented Apr 10, 2026

A lot of the TODO comments in the code have been there for a while. This PR removes some of the low-hanging fruit.

@jamis jamis requested a review from a team as a code owner April 10, 2026 20:30
@jamis jamis requested review from comandeo-mongo and Copilot April 10, 2026 20:30
Copy link
Copy Markdown
Contributor

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 removes/updates long-standing TODOs by replacing ad-hoc OCSP response patching with a dedicated wrapper type, modernizing ClusterTime comparisons, and clarifying intent in a few internal comments.

Changes:

  • Introduce Mongo::Socket::OcspVerifier::Response (a SimpleDelegator) to carry OCSP responder URI metadata without monkey-patching stdlib objects.
  • Use Comparable for Mongo::ClusterTime and drop now-redundant custom comparison operator methods.
  • Remove/replace several stale TODO comments and adjust related documentation.

Reviewed changes

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

Show a summary per file
File Description
lib/mongo/socket/ocsp_verifier.rb Adds Response delegator wrapper and uses it instead of mutating OpenSSL::OCSP::SingleResponse.
lib/mongo/socket/ocsp_cache.rb Updates cache-value documentation to reference the new wrapper type.
lib/mongo/protocol/msg.rb Removes a stale TODO comment in maybe_encrypt.
lib/mongo/operation/result.rb Removes a stale TODO comment about nil replies.
lib/mongo/cluster/reapers/cursor_reaper.rb Replaces TODO with explanatory comment when a server can’t be found for a killspec.
lib/mongo/cluster_time.rb Includes Comparable and removes custom <, <=, >, >= implementations.

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

Comment on lines 19 to 23
# This module caches OCSP responses for their indicated validity time.
#
# The key is the CertificateId used for the OCSP request.
# The value is the SingleResponse.
# The value is an OcspVerifier::Response.
#
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