Skip to content

mongo - fix: moving gridFS property to read only#1873

Merged
jaredwray merged 5 commits intomainfrom
mongo---fix-moving-gridFS-property-to-read-only
Feb 25, 2026
Merged

mongo - fix: moving gridFS property to read only#1873
jaredwray merged 5 commits intomainfrom
mongo---fix-moving-gridFS-property-to-read-only

Conversation

@jaredwray
Copy link
Owner

@jaredwray jaredwray commented Feb 25, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
mongo - fix: moving gridFS property to read only

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jaredwray, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the useGridFS property within the MongoDB storage adapter to be read-only. This change ensures that the property can only be configured during the constructor's initialization, preventing potential inconsistencies or issues that could arise from dynamically changing the GridFS setting after the connection has been established, given that GridFS and standard MongoDB connections have different underlying structures.

Highlights

  • Read-only useGridFS property: The useGridFS property in the KeyvMongo class has been made read-only, ensuring it can only be configured during instantiation.
  • Setter removal: The public setter for useGridFS was removed from the KeyvMongo class, reinforcing its read-only nature.
  • Documentation update: The README.md documentation for useGridFS was updated to clearly state that it is read-only and must be set via the constructor due to differing connection shapes.
  • Test case adjustment: A test case that attempted to modify useGridFS via a setter was removed to align with the new read-only implementation.
Changelog
  • storage/mongo/README.md
    • Updated the description of the useGridFS property to clarify it is read-only and can only be set via the constructor.
    • Added a specific note indicating the property is read-only.
  • storage/mongo/src/index.ts
    • Removed the public setter for the useGridFS property.
    • Updated the JSDoc for the useGridFS getter to explain its read-only nature and the rationale.
  • storage/mongo/test/test.ts
    • Removed the test assertion that attempted to set the useGridFS property via its setter.
Activity
  • No activity was provided for this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request makes the useGridFS property read-only by removing its setter, updating documentation, and adjusting tests. This change prevents runtime modification of a property that affects the connection shape. My feedback points out a resulting inconsistency in the documentation and suggests extending this read-only approach to other similar configuration properties to improve the overall design.

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (b18aa28) to head (35ac1ee).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1873   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files          32       32           
  Lines        2747     2794   +47     
  Branches      483      490    +7     
=======================================
+ Hits         2746     2793   +47     
  Misses          1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jaredwray jaredwray merged commit 6620ef7 into main Feb 25, 2026
8 checks passed
@jaredwray jaredwray deleted the mongo---fix-moving-gridFS-property-to-read-only branch February 25, 2026 21:38
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