fix(plugin-mongodb): export ObjectId and dates as mongosh constructors, and compile every plugin in CI - #2091
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Two commits. Follows #2090.
1. CI never compiled the registry plugins
macos-tests.ymlbuilds-scheme TablePro, whose dependencies are the 14 bundled plugins. The 16 registry-only plugins (MongoDB, Oracle, DuckDB, MSSQL and the rest) are compiled only by theAllPluginsaggregate, and nothing in PR CI ran it.build-plugin.ymldoes not fire until a release tag.I hit this while writing #2090: a hard compile error in the MongoDB plugin still produced
** BUILD SUCCEEDED **. It surfaced only because that one file happens to be in the test target's source list. The rest of the plugin was never compiled by CI at all, so a plugin-only change could go green and be broken.Adds an
AllPluginsbuild step before the test step.2. ObjectId and dates did not survive MQL export
The dump is a mongosh script, so a bare string in it inserts a string.
_idwas written as"507f1f77bcf86cd799439011"and a date as"2026-01-01T00:00:00Z", so re-running the script replaced every ObjectId and every date with a string. Same defect class as the binary subtype in #2090, and the same root cause: the type was gone before the exporter saw the value.unwrapExtendedJsonmapped{"$oid": ...}straight toString, so nothing downstream could tell an ObjectId from an ordinary string. It now returns aMongoDBObjectIdbox, which isCustomStringConvertibleover the hex so the one site that interpolatesbsonToDict(doc)["_id"]keeps working.BsonValueKindgains.objectId, andtypeNamereportsObjectId, the spellingfetchColumnsalready used for an empty collection.MQL export then writes
ObjectId("...")for anObjectIdcolumn andISODate("...")for aTIMESTAMPcolumn, validating the value first and falling back to a quoted string if it does not parse. Cell display is unchanged: the grid still shows the bare hex, and the column still classifies as text, so no edit guard or formatter moves.Deliberately not fixed: values nested in a subdocument
A typed value inside a subdocument or array still exports as a string, and the docs now say so.
I stopped short of fixing it because the only contained fix is a bad one. The export data source is format-agnostic: the same
PluginCellValuestream feeds MQL, CSV, JSON and XLSX, and a nested document has already been serialized to a JSON string by the time any exporter sees it. MQL export could re-parse that JSON and rewrite any string matchingBinData(...)orObjectId(...)back into a constructor, but that is reconstructing a type by pattern-matching a display string, and it would silently convert a genuine user string that happens to look like one.The clean fix is a driver-owned export hook, so MongoDB serializes its own literals per format rather than the exporter guessing from text. That is an additive PluginKit protocol change affecting every driver and every format, and it deserves its own design rather than being tacked on here.
Verification
TableProTestswith CI's own quarantine skip list.AllPluginsbuilds.https://claude.ai/code/session_01628orR3jwc3ATfcFCLVUMB