-
-
Notifications
You must be signed in to change notification settings - Fork 928
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
Rails 5 update #1341
Rails 5 update #1341
Conversation
I haven't looked at the commits yet, but if there are any of these things that are compatible with both Rails 5 and the current version we should get those into separate PRs and merge them sooner. Smaller changes are always better to test. |
I am not sure if that would be a good idea. You won't be able to see anything in the logs other than deprecation warnings. This PR is not as bad as it looks. Just gemfiles change amount for 128 lines, |
☔ The latest upstream changes (presumably #1327) made this pull request unmergeable. Please resolve the merge conflicts. |
To remove As soon as there is a |
b66ac1c
to
b62d848
Compare
Thank you for checking out the PR @kmcphillips
I didn't add it because I didn't want to add a configuration which did nothing at the point(commit) it was added. |
06ca8f3
to
5f41680
Compare
#1352 simplifies this a bit. |
5f41680
to
49c388a
Compare
I have great news.. 😞 It has treading issue and as they go.. it is not reliably reproduceable. Failing build1, build2, build3. |
☔ The latest upstream changes (presumably f32321d) made this pull request unmergeable. Please resolve the merge conflicts. |
17cb351
to
2d7257e
Compare
I have updated this to 5.0.0. Treading error was fixed here: rails/rails#25707 |
@@ -28,6 +25,9 @@ class Application < Rails::Application | |||
config.plugins = [:dynamic_form] | |||
|
|||
config.autoload_paths << Rails.root.join('lib') | |||
|
|||
# Do not halt callback chains when a callback returns false. | |||
ActiveSupport.halt_callback_chains_on_return_false = false | |||
end |
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.
@sonalkr132 Did you run rails app:update
, this config will go to config/initializers/new_framework_defaults.rb
after that.
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.
I was hoping I would change config after we are sure that changes up to this point don't break anything.
However, now it seems like it is going to be a while before this gets deployed.. I have added the changes of rails app:update
. Thanks for having a look at the PR :)
384b0fa
to
8133cc1
Compare
☔ The latest upstream changes (presumably e0006da) made this pull request unmergeable. Please resolve the merge conflicts. |
8133cc1
to
d804fe4
Compare
group :development do | ||
gem 'rails-erd' | ||
end | ||
gem 'rails-erd', group: :development |
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.
Is this needed?
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.
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.
Sure, but why changed?
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.
Oh! It has to do with rebase 😝 I had removed quite_assets
changed group to one line but quite_assets
was removed in different PR and I had to rebase.
I guess it saves two lines, but yes, the change is unnecessary. May be I can restore it when I update the PR for 5.0.1 if you think it is important.
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.
Since this PR is changing 169 files I think it will be nice to keep it as minimal as it is possible for future reviewers.
I'm not sure if |
@user = User.find_by_slug!(params[:id]) | ||
rubygems = @user.rubygems_downloaded | ||
@rubygems = rubygems.slice!(0, 10) | ||
@extra_rubygems = rubygems |
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.
Is this removal of @extragems_rubygems
and rubygems
var assignments and following view change related to Rails 5 update or is it just a code cleanup/refactoring?
I left some notes @sonalkr132 to your awesome work!. |
…emplate HTTP request methods will accept only the following keyword arguments in future Rails versions: params, headers, env, xhr, as Rails discourages use of assert_template and the feature is moved out to gem. Possibly we will be adding tests which test for elements in view.
`assigns` is moved out to a gem in rails 5 and its use is discouraged.
Use of plain fixes: DEPRECATION WARNING: `render :text` is deprecated because it does not actually render a `text/plain` response. Switch to `render plain: 'plain text'` to render as `text/plain`, `render html: '<strong>HTML</strong>'` to render as `text/html`, or `render body: 'raw'` to match the deprecated behavior and render with the default Content-Type, which is `text/plain`. Use of request.env fixes: DEPRECATION WARNING: env is deprecated and will be removed from Rails 5.1 Use of request.env mentioned at: rails/rails@05934d2
Reusing params in ES suggestion view was showing error for unsafe use of params. `count` takes `conditions` as argument , but we don't need even that. Sytax of content_type changed. Rails now uses async queue_adapter which uses a different thread to work off jobs. We can't let that happen in our integration test because we are relying on the mail being delievered and doing that in a different thread leads to unpredictable delay.
Use of symbol or string as middleware name is deprecated. I moved it to env files because Redirect was env specific. Now errors in transactional callbacks are raised by default. serve_static_file and static_cache_control has been deprecated in favour of public_file_server. Tests now run after_commit callbacks by default. New rails test runner is cool 😎
6819da7
to
e696b48
Compare
We are not adding puma and actioncable config here.
e696b48
to
29940ef
Compare
@sonalkr132 can you re base this and update to 5.0.1 to fix the connection pool issue? |
Rails 5.0.1 is not released yet. rails 5.0.1 Milestone |
@sonalkr132 ah, I see. 😞 I guess this is blocked until Rails 5.0.1 comes out, then. |
☔ The latest upstream changes (presumably #1398) made this pull request unmergeable. Please resolve the merge conflicts. |
I agree 100% with @dwradcliffe . We cannot ship one big update PR to upgrade Rails version. it is too risky. |
@@ -47,7 +47,7 @@ def response_body | |||
context "on GET to show when hide email" do | |||
setup do | |||
@user.update(hide_email: true) | |||
get :show, id: @user.handle, format: format | |||
get :show, params: { id: @user.handle }, format: format |
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.
Changes like this should be done in a follow-up PR, in my opinion. This adds unnecessary review overhead to the Pull Request.
This would be a lot smaller if we didn't bother fixing deprecation warnings in this PR. We should focus on doing that afterward. |
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.
Some comments on what we should remove from this PR to keep it lean, what we can backport, etc.
@@ -16,7 +16,7 @@ gem 'daemons' | |||
gem 'dalli' | |||
gem 'delayed_job' | |||
gem 'delayed_job_active_record' | |||
gem 'doorkeeper' | |||
gem 'doorkeeper', '~> 4.0.0.rc4' |
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 can be backported (and can use the stable 4.0.0 version)
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 actually gone in master now.
nokogiri (1.6.8) | ||
mini_portile2 (~> 2.1.0) | ||
pkg-config (~> 1.1.7) | ||
parser (2.3.1.2) | ||
ast (~> 2.2) | ||
paul_revere (2.0.0) | ||
rails (~> 4.0) | ||
paul_revere (2.1.0.rc1) |
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.
paul_revere seems to be abandoned from what I can tell, can we replace it with something else?
@@ -7,9 +7,9 @@ def show | |||
sign_in User.authenticate(username, password) | |||
if current_user | |||
respond_to do |format| | |||
format.any(:all) { render text: current_user.api_key } | |||
format.any(:all) { render plain: current_user.api_key } |
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.
Replacing render text
with render plain
seems like an unnecessary deprecation warning fix? Should be a follow-up PR.
# Be sure to restart your server when you modify this file. | ||
|
||
# Configure sensitive parameters which will be filtered from the log file. | ||
Rails.application.config.filter_parameters += [:password] |
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.
Does this override an existing filter_parameters
config?
@@ -1,7 +1,6 @@ | |||
class Api::BaseController < ApplicationController | |||
before_action :doorkeeper_authorize!, if: :doorkeeper_token | |||
before_action :authenticate_with_oauth, if: :doorkeeper_token | |||
skip_before_action :require_ssl |
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.
What's the explanation for this change?
@@ -142,7 +144,7 @@ GEM | |||
activesupport (>= 4.1.0) | |||
gravtastic (3.2.6) | |||
hashie (3.4.4) | |||
high_voltage (2.4.0) | |||
high_voltage (3.0.0) |
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 seems to be something we can backport.
Thanks for review @connorshea I will keep your comments in mind when I make changes.
If it's okay I would like to open a new PR with ☝️. It doesn't it has to wait for rails 5.0.1 for people to review it.
I haven't read (blog/implementation) anything related to this. Can someone please explain it with a little more detail? Would it be something like this, where we check for rails versions? |
See also what I'm doing for GitLab: https://gitlab.com/gitlab-org/gitlab-ce/issues/14286 Lots of things can be backported to master to make this PR a lot smaller. |
@connorshea thanks :) That was helpful. I will send a new PR soon. |
See #1615 |
Please read commit message for explanation of changes.
It is very likely that I may have missed deprecations which didn't show up in test, feel free to open issues when you see them.
I have removed
quite_assets
gem because their rails requirement wouldn't have allowed update and looks like gem is abandoned. The feature is now implemented in sprocket-rails, we just have to be wait for version release.I really want to compare before and after performance, object allocation etc. I would really appreciate it if someone pointed me to relevant resources or took out time for general advice.