Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDriver metadata (name and version) is now imported from package.json and exported as Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/3-mongo-target/3-mongo-driver/src/exports/control.ts (1)
8-10: Use the importedversionas the descriptor version source of truth.Since
versionis already imported frompackage.json, consider using it for the descriptorversionfield too to avoid manual drift.♻️ Suggested change
- version: '0.0.1', + version,🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/3-mongo-target/3-mongo-driver/src/exports/control.ts` around lines 8 - 10, The descriptor's version field should use the imported package.json `version` as the single source of truth; update the DRIVER_INFO (and any descriptor object) to set its `version` property from the imported `version` variable (instead of a hardcoded string) so the driver info and descriptor always reflect package.json's version.packages/3-mongo-target/3-mongo-driver/src/mongo-driver.ts (1)
21-24: ExtractDRIVER_INFOinto sharedsrc/coreto prevent cross-plane drift.The same metadata constant is now duplicated here and in
src/exports/control.ts. Move it to a shared core module and import it in both places.♻️ Suggested refactor
- import { version } from '../package.json' with { type: 'json' }; - - const DRIVER_INFO = { name: 'Prisma', version }; + import { DRIVER_INFO } from './core/driver-info';// src/core/driver-info.ts import { version } from '../../package.json' with { type: 'json' }; export const DRIVER_INFO = { name: 'Prisma', version } as const;As per coding guidelines
packages/**/src/**: “Structure multi-plane packages with split sources by plane:src/core/**for shared,src/exports/control.tsfor migration,src/exports/runtime.tsfor runtime”.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/3-mongo-target/3-mongo-driver/src/mongo-driver.ts` around lines 21 - 24, Create a single shared export for the DRIVER_INFO constant and use it from both places: extract the current inline const DRIVER_INFO into a new core module that imports the package.json version (using the with { type: 'json' import form) and exports const DRIVER_INFO (as const); then replace the local DRIVER_INFO declarations in mongo-driver.ts and the other duplicated file with imports from that new core module so both modules reference the same shared DRIVER_INFO export.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/3-mongo-target/3-mongo-driver/src/exports/control.ts`:
- Around line 8-10: The descriptor's version field should use the imported
package.json `version` as the single source of truth; update the DRIVER_INFO
(and any descriptor object) to set its `version` property from the imported
`version` variable (instead of a hardcoded string) so the driver info and
descriptor always reflect package.json's version.
In `@packages/3-mongo-target/3-mongo-driver/src/mongo-driver.ts`:
- Around line 21-24: Create a single shared export for the DRIVER_INFO constant
and use it from both places: extract the current inline const DRIVER_INFO into a
new core module that imports the package.json version (using the with { type:
'json' import form) and exports const DRIVER_INFO (as const); then replace the
local DRIVER_INFO declarations in mongo-driver.ts and the other duplicated file
with imports from that new core module so both modules reference the same shared
DRIVER_INFO export.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 56e58c20-08be-4b51-8030-7abcea5e5a96
📒 Files selected for processing (3)
packages/3-mongo-target/3-mongo-driver/src/exports/control.tspackages/3-mongo-target/3-mongo-driver/src/mongo-driver.tspackages/3-mongo-target/3-mongo-driver/tsconfig.json
This PR adds basic client metadata enrichment to MongoDB logs so users can differentiate connections from client libraries. Basically the same idea as https://github.com/prisma/prisma-engines/pull/2695/changes
Summary by CodeRabbit