Skip to content

RUBY-3252 Show user friendly error if no ffi #2730

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

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

comandeo
Copy link

@alexbevi
Copy link
Contributor

Changes and error message lgtm

@comandeo comandeo requested a review from jamis June 12, 2023 14:54
@comandeo comandeo marked this pull request as ready for review June 12, 2023 15:59
Copy link
Contributor

@jamis jamis left a comment

Choose a reason for hiding this comment

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

Elegant solution! Just the one comment about the specs.


describe Mongo::Crypt do
describe '.validate_ffi!' do
context 'when ffi is available' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be something here to test for the cases where FFI is not installed? Or skip when it isn't?

Copy link
Author

Choose a reason for hiding this comment

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

I couldn't come up with a reasonable complex solution for testing this case. We have gem 'ffi' in our standard set of dependencies for testing. So, we would need a dedicated configuration just to test this feature; I think this is an overhead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah! That makes sense. I'll trust that you've thought about this a lot more than I have. :) Thanks for the explanation. Maybe a comment in that spec, explaining the situation, would be helpful to future-us?


describe Mongo::Crypt do
describe '.validate_ffi!' do
context 'when ffi is available' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah! That makes sense. I'll trust that you've thought about this a lot more than I have. :) Thanks for the explanation. Maybe a comment in that spec, explaining the situation, would be helpful to future-us?

@comandeo comandeo merged commit 990d02c into mongodb:master Jun 12, 2023
@comandeo comandeo deleted the 3252-no-ffi-warning branch June 12, 2023 17:00
comandeo pushed a commit to comandeo/mongo-ruby-driver that referenced this pull request Jun 13, 2023
* RUBY-3252 Show user friendly error if no ffi

* Cleanup

* Remove one test

* Add comment explaining why test is omited
comandeo pushed a commit that referenced this pull request Jun 13, 2023
* RUBY-3252 Show user friendly error if no ffi

* Cleanup

* Remove one test

* Add comment explaining why test is omited
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants