Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NODE-5207): deprecate unsupported runCommand options and add spec tests #3643

Merged
merged 29 commits into from Apr 26, 2023

Conversation

nbbeeken
Copy link
Contributor

@nbbeeken nbbeeken commented Apr 14, 2023

Description

What is changing?

DRIVERS-2577
mongodb/specifications#1389

  • Adds runCommand spec tests.
  • Improves the withTransaction operation runner to catch our undefined return type - which means the transaction did not commit
  • Improves the runCommand operation runner to validate arguments
  • Deprecates inherited options that are not supported by runCommand
Is there new documentation needed for these changes?

No.

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@nbbeeken nbbeeken changed the title [DNM,WIP]: DRIVERS-2533: add a runCommand specification test test(NODE-5207): add a runCommand specification tests Apr 21, 2023
@nbbeeken nbbeeken marked this pull request as ready for review April 21, 2023 14:06
@nbbeeken nbbeeken requested a review from dariakp April 21, 2023 14:06
@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 21, 2023
@dariakp dariakp changed the title test(NODE-5207): add a runCommand specification tests feat(NODE-5207): add a runCommand specification tests Apr 21, 2023
dariakp
dariakp previously approved these changes Apr 21, 2023
@dariakp dariakp added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Apr 21, 2023
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

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

Need to address failures here and in the specs repo

dariakp
dariakp previously approved these changes Apr 25, 2023
@dariakp dariakp changed the title feat(NODE-5207): add a runCommand specification tests feat(NODE-5207): deprecate unsupported runCommand options and add spec tests Apr 25, 2023
@@ -488,18 +488,19 @@ export class Connection extends TypedEventEmitter<ConnectionEvents> {
options: CommandOptions | undefined,
callback: Callback
): void {
const readPreference = getReadPreference(cmd, options);
cmd = { ...cmd };
Copy link
Member

Choose a reason for hiding this comment

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

Although this leaves the supplied command untouched outside of the scope of this method can we assign it to a new const to avoid any potential confusion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, updated

@dariakp dariakp merged commit d6d76b4 into main Apr 26, 2023
17 of 21 checks passed
@dariakp dariakp deleted the NODE-5202-runCommand branch April 26, 2023 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
3 participants