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

refactor(NODE-5514): make FLE logic use async-await #3830

Merged
merged 10 commits into from
Aug 24, 2023

Conversation

baileympearson
Copy link
Contributor

@baileympearson baileympearson commented Aug 21, 2023

Description

What is changing?

To aid in development and debugging of flaky tests, the internals of our FLE logic is now async-await. The notable exception is StateMachine.kmsRequest, which was already manually constructing a promise but is out-of-scope to address now and has a follow up ticket (NODE-3959).

Also note: while I did not refactor kmsRequest to be async itself, I did refactor setTLSOptions to read certificate files asynchronously (in the AC of this ticket).

Along the way, I made a few other cleanups. I commented on which refactors I consider optional and am happy to revert them.

  • I made a slight refactor of how we handle kms requests in the state machine (see the comment in the diff view)
  • I abstracted mongocryptd respawn logic into a MongocryptdManager.withRespawn helper
  • Other misc small changes.
Is there new documentation needed for these changes?

What is the motivation for this change?

Release Highlight

Fill in title or leave empty for no highlight

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

Sorry, something went wrong.

@baileympearson baileympearson force-pushed the NODE-5514-fle-async-await-refactor branch 2 times, most recently from 7a2b9a9 to 8d961c3 Compare August 21, 2023 19:53
@baileympearson baileympearson changed the title refactor Encrypter and autoEncrypter.teardown() to be async refactor(NODE-5514): make FLE logic use async-await Aug 21, 2023
@baileympearson baileympearson marked this pull request as ready for review August 21, 2023 20:23
@durran durran self-assigned this Aug 22, 2023
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Aug 22, 2023
@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Aug 22, 2023
@baileympearson baileympearson requested a review from durran August 22, 2023 19:17
durran
durran previously approved these changes Aug 22, 2023
@W-A-James W-A-James self-requested a review August 22, 2023 19:44
@W-A-James W-A-James self-requested a review August 23, 2023 13:19
W-A-James
W-A-James previously approved these changes Aug 23, 2023
@durran
Copy link
Member

durran commented Aug 23, 2023

@baileympearson Can we get the conflict resolved and then good to go. Thanks!

@baileympearson baileympearson force-pushed the NODE-5514-fle-async-await-refactor branch from be9c10d to d919d4d Compare August 23, 2023 14:38
@baileympearson baileympearson requested a review from durran August 23, 2023 14:38
@nbbeeken nbbeeken self-requested a review August 23, 2023 14:52
@durran durran merged commit ea2d60a into main Aug 24, 2023
@durran durran deleted the NODE-5514-fle-async-await-refactor branch August 24, 2023 13:12
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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants