-
Notifications
You must be signed in to change notification settings - Fork 7
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
AP950 Upgrade to Rails 6 #1240
Merged
Merged
AP950 Upgrade to Rails 6 #1240
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d91e4b2
to
e44b28a
Compare
e71dde8
to
43feeb7
Compare
stephenrichards
approved these changes
Feb 14, 2020
43feeb7
to
824765f
Compare
colinbruce
approved these changes
Feb 14, 2020
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.
💥 🏆
Nice work, love the clarity of the commit messages and love the comments to highlight
why possible counter-intuitive changes (e.g, rollback of zeitwork) have been made allowing
us to refresh in the future
e33cc96
to
8d37061
Compare
0158558
to
8aeeb09
Compare
Update Rails to version 6.0.2 Downgrage sprockets to 3.7.2. This fixes a segmentation error in circle ci after upgrading to rails 6 this is when the docker file runs assets:precompile sass/sassc-rails#122
Update render file to render template. This fixes a deprecation as shown > DEPRECATION WARNING: render file: should be given the absolute path to a file
Update self.class.parent to self.class.module_parent to fix errors DEPRECATION WARNING: `Module#parent` has been renamed to `module_parent`. `parent` is deprecated and will be removed in Rails 6.1
Update tests to use #mediate_type instead of #content_type to remove deprection after upgrading to rails 6 as show : DEPRECATION WARNING: Rails 6.1 will return Content-Type header without modification. If you want just the MIME type, please use `#media_type` instead.
This is to remove the warning below after updating to rails 6 DEPRECATION WARNING: ActionView::Base instances should be constructed with a lookup context, assignments, and a controller.
…grade Update to use MailDeliveryJob instead of DeliveryJob after rails 6 upgrade Use new arguments format for ActionMailer::MailDeliveryJob because the changes to ActionMailer's arguments to args: @Args affects the email monitor in this app. I updated to fix this. https://github.com/rails/rails/blob/master/actionmailer/lib/action_mailer/message_delivery.rb Also, update tests with new MailDeliveryJob arguments format
Set up new config defaults for rails 6 https://guides.rubyonrails.org/configuring.html#results-of-config-load-defaults Set config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" Also, zeitwork is causing errors so use :classic
This is because in rails 6 the test queue adapter is overriding sidekiq in request tests. The ResendLinkRequestMailer and FeedbackMailer is already tested seperately in mailer tests. Tried to use alternative solutions such as disabling the queue adapter but that would cause errors elsewhere e.g. in a email monitor service test. ((ActiveJob::Base.descendants << ActiveJob::Base).each { |a| a.disable_test_adapter })
This is because sidekiq version 6 requires zeitwerk as the autoloader but we are using classic due to an error it give with expanding frozen paths in the rails helper
8aeeb09
to
c79e19d
Compare
6 tasks
This was referenced May 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Upgrade Rails to 6.0.2
Link to story
Upgrade rails to version 6.0.2
Revert sprockets gem to 3.7.2 , which fixes a segmentation error in CircleCi after upgrading to rails 6 this is when the docker file runs assets:precompile
Related sass issue
Revert to using classic as the rails autoloader instead of the rails 6 default of zeitwerk. This fixed issues relating to a loading in rails_helper require error :
Remove mailer tests in the request tests. This is because sidekiq is overridden in request tests by the test adapter (in Rails 6) and thus sidekiq mailer tests in the requests were faulting Rails 6 inconsistently overrides ActiveJob queue_adapter setting with TestAdapter rails/rails#37270 and the solution is to continue using the test adapter as the mailers are tested seperately.
Add type :request to request tests
Update tests and cassettes
Checklist
Before you ask people to review this PR:
bundle exec rake
git rebase master
.