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-3699): add support for comment field #3167

Merged
merged 54 commits into from Apr 1, 2022
Merged

feat(NODE-3699): add support for comment field #3167

merged 54 commits into from Apr 1, 2022

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Mar 9, 2022

Description

What is changing?

This PR adds support for the comment field. It includes changes from three drivers tickets:

Is there new documentation needed for these changes?

No.

Notes

Not modified:

  • the legacy count comment specified a $comment field of type string. The new comment field is supported in MongoDB 4.4+ and our legacy count command only runs for server versions <=3.2.
  • There is pre-existing logic in CommandOperation.executeCommand to attach a comment to a command when executing the command if the comment is of type string. All the new operations in the drivers spec attach the comment field to the command prior to calling super.executeOperation, so the logic in CommandOperation.executeCommand does not need to be updated. I also decided to leave it as-it-is (instead of making the change to accept non-string comments in this location specifically) because I didn't want to change the behavior for commands which only support string comments.

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>
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@baileympearson baileympearson force-pushed the NODE-3699 branch 2 times, most recently from ec05837 to dfcf905 Compare March 14, 2022 19:13
@baileympearson baileympearson marked this pull request as ready for review March 14, 2022 19:52
@baileympearson baileympearson changed the title wip feat(NODE-3699): Add support for comment field feat(NODE-3699): Add support for comment field Mar 14, 2022
src/operations/update.ts Outdated Show resolved Hide resolved
src/change_stream.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

whoops, didn't start a review before commenting, sorry for all the pings

@nbbeeken nbbeeken added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Mar 16, 2022
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.

Leaving feedback on everything except the tests.

src/change_stream.ts Show resolved Hide resolved
src/cmap/connection.ts Show resolved Hide resolved
src/cmap/connection.ts Outdated Show resolved Hide resolved
src/change_stream.ts Outdated Show resolved Hide resolved
src/change_stream.ts Outdated Show resolved Hide resolved
src/operations/aggregate.ts Outdated Show resolved Hide resolved
src/operations/delete.ts Outdated Show resolved Hide resolved
src/operations/find.ts Outdated Show resolved Hide resolved
src/operations/get_more.ts Outdated Show resolved Hide resolved
src/utils.ts Outdated Show resolved Hide resolved
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.

I still need to review the builder and the falsy values test, but here's feedback on the rest of the tests

test/unit/connection_string.test.ts Outdated Show resolved Hide resolved
test/unit/operations/get_more.test.ts Outdated Show resolved Hide resolved
test/tools/unified-spec-runner/match.ts Show resolved Hide resolved
test/tools/unified-spec-runner/operations.ts Outdated Show resolved Hide resolved
test/tools/unified-spec-runner/operations.ts Outdated Show resolved Hide resolved
test/tools/unified-spec-runner/schema.ts Show resolved Hide resolved
test/tools/utils.ts Outdated Show resolved Hide resolved
test/tools/utils.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Mar 30, 2022
test/tools/utils.ts Outdated Show resolved Hide resolved
nbbeeken
nbbeeken previously approved these changes Mar 31, 2022
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM

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.

just a couple of minor but important notes

test/unit/operations/list_collections.test.js Outdated Show resolved Hide resolved
test/integration/enumerate_collections.test.ts Outdated Show resolved Hide resolved
test/integration/enumerate_collections.test.ts Outdated Show resolved Hide resolved
test/integration/enumerate_databases.test.ts Outdated Show resolved Hide resolved
test/integration/enumerate_databases.test.ts Outdated Show resolved Hide resolved
test/integration/enumerate_indexes.test.ts Outdated Show resolved Hide resolved
test/integration/enumerate_indexes.test.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken changed the title feat(NODE-3699): Add support for comment field feat(NODE-3699): add support for comment field Apr 1, 2022
@nbbeeken nbbeeken merged commit 4e2f9bf into main Apr 1, 2022
@nbbeeken nbbeeken deleted the NODE-3699 branch April 1, 2022 15:26
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