Skip to content

Conversation

addaleax
Copy link
Collaborator

Specifically, match the stricter typing in mongodb/node-mongodb-native@dab4c7c.

@addaleax addaleax requested a review from a team as a code owner October 15, 2025 14:35
@Copilot Copilot AI review requested due to automatic review settings October 15, 2025 14:35
Copy link

@Copilot 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 updates TypeScript type definitions in the crypt library paths module to align with stricter typing requirements from the nightly MongoDB Node.js driver. The changes introduce template literal types to ensure type safety for shared library paths and their suffixes.

Key changes:

  • Added SharedObjectSuffix type to restrict valid shared library file extensions
  • Applied template literal types to cryptSharedLibPath and library candidate paths to enforce naming patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


export interface CryptLibraryPathResult {
cryptSharedLibPath?: string;
cryptSharedLibPath?: `${string}mongo_crypt_v${number}.${SharedObjectSuffix}`;
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

The template literal type requires 'mongo_crypt_v' but the actual library paths use 'mongosh_crypt_v1' (as seen in line 57). This mismatch will cause type errors since the actual paths don't match the pattern 'mongo_crypt_v${number}'.

Suggested change
cryptSharedLibPath?: `${string}mongo_crypt_v${number}.${SharedObjectSuffix}`;
cryptSharedLibPath?: `${string}mongosh_crypt_v${number}.${SharedObjectSuffix}`;

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are correct concerns, but we intentionally rename this file to avoid conflicts with a potentially user-installed file of that name

@addaleax addaleax added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Oct 15, 2025
@addaleax addaleax merged commit fbba5ad into main Oct 17, 2025
144 of 154 checks passed
@addaleax addaleax deleted the nightly-driver-types branch October 17, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants