-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add support for mongoid 9 #16
Add support for mongoid 9 #16
Conversation
Looks like a bunch of tests are no longer working, some versions will have to be locked down. LMK if you need help. |
I'll look into this |
@dblock - I noticed that there was a Additionally, I brought in appraisal to help me lock versions. This included updating How would I go about testing these changes to see if they were applied correctly? |
I'm converting this to a draft PR. The tests pass locally. Need to test CI. |
@@ -1,3 +1,7 @@ | |||
# frozen_string_literal: true | |||
|
|||
ENV['MONGOID_ENV'] = 'test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this? I don't think it's used anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still necessary. Mongoid is not able to resolve the environment and throws an error while trying to run the test. Here's an example of an error thrown without this statement:
An error occurred while loading ./spec/mongoid/compatibility/version_spec.rb.
Failure/Error: Mongoid.load! 'spec/config/mongoid9.yml'
Mongoid::Errors::NoEnvironment:
message:
Could not load the configuration since no environment was defined.
summary:
Mongoid could not determine the environment to use because it was not specified in any of the following locations: Rails.env, Sinatra::Base.environment, ENV["RACK_ENV"], ENV["MONGOID_ENV"]. Without knowing the environment, Mongoid cannot load its configuration.
resolution:
Please ensure an environment is set in one of the listed locations. The environment must be explicitly set.
You can/should enable CI on your fork and you'll see these run. |
@dblock - I'm testing CI and I noticed that the pipeline fails trying to install bundler with a specific ruby version. I found this github thread that goes over the problem: ruby/setup-ruby#496 Error message:
Test Pipeline: https://github.com/sairamsrinivasan/mongoid-compatibility/actions/runs/9538619927/job/26288063365?pr=1 Any thoughts here? Can we trim down the list of versions defined in that matrix within |
@dblock - To follow up with my comment above. I upgraded the minimum ruby version to 2.6 in CI and the tests pass within a pipeline from my fork. See here: sairamsrinivasan#1 Danger is throwing a 401 error that I'm not too sure how to get around:
Any insight to this would be much appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to test bundler 1, since everything is 2 here want to get rid of it altogether?
Don't worry about danger.
For danger, copy the workflow/token from https://github.com/mongoid/mongoid-rspec/blob/master/.github/workflows/danger.yml#L17. |
@dblock - I appreciate the quick review! CI now passes in my fork. Example: sairamsrinivasan#1 |
Merged, thanks! Want to make the next release? Remind me your rubygems username? |
@dblock - Thanks for merging this PR. I'd be more than happy to make the next release. My rubygems username is: sai_srinivasan |
I think we should get #17 before releasing. But either way, invited you to https://github.com/mongoid/mongoid-compatibility/invitations and Rubygems, please follow https://github.com/mongoid/mongoid-compatibility/blob/master/RELEASING.md for a release. |
@dblock - I tried to run Thanks! |
You should have an invitation in email? |
@dblock - I checked my email thoroughly. I was looking for an email similar to the one that I received for Can you please send another one when you get the chance? |
@sairamsrinivasan didn't find that link, but I removed/re-added you in owners now, it's pending, see if you got it? |
@dblock - Thanks for doing that. I received an invite from rubygems.org. I pushed the new tag: https://rubygems.org/gems/mongoid-compatibility/versions/1.0.0 |
Great. Don't forget to increment the version for next developer iteration, see https://github.com/mongoid/mongoid-compatibility/blob/master/RELEASING.md for details. |
@dblock - I did. I had to add a section to RELEASING. that covers preparing for the next version Check out this commit on master: 25b4114 |
This PR adds support for Mongoid 9 so that we can use some of the methods that come with this gem.