-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Upgrade to Rails 4.2 #2533
Upgrade to Rails 4.2 #2533
Conversation
This looks pretty good to me, to be honest. Almost all changes are minor OR changes to |
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.
Really awesome work @Souravirus, Thanks for completing it 💯 🎉
@@ -7,14 +7,14 @@ class NodeInsertExtrasTest < ActionDispatch::IntegrationTest | |||
assert_equal 0, Impression.count | |||
|
|||
assert_difference 'Impression.count', 1 do | |||
get "wiki/#{nodes(:about).slug}" | |||
get "/wiki/#{nodes(:about).slug}" #gave the complete address changed from wiki to /wiki |
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.
feel free to remove this comment anytime
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.
Yeah @Gauravano I will remove these
|
||
assert_response :success | ||
end | ||
|
||
assert_difference 'nodes(:about).totalviews', 0 do | ||
assert_difference 'Impression.count', 0 do | ||
get "wiki/#{nodes(:about).slug}" | ||
get "/wiki/#{nodes(:about).slug}" #gave the complete address changed from wiki to /wiki |
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 comment can also be removed
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.
Looks really good overall, nice work indeed!
That said, I thought that a few changes were general code improvements and had nothing to do with the Rails 4.2 upgrade. Let me know if I'm wrong, and if I'm not, consider moving them to different PRs.
@@ -65,8 +65,7 @@ def accept | |||
else | |||
@answer.accepted = true | |||
@answer.save | |||
@answer.node.add_tag('answered', @answer.author) |
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 understand the other difference (the addition of deliver_now
), but any reason in particular why you'd remove this line?
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 removed it mistakenly. I would add it again. Thanks!!
@@ -12,6 +12,12 @@ class DrupalContentTypeMap < ActiveRecord::Base | |||
lat_column_name: :lat, | |||
lng_column_name: :lng | |||
|
|||
before_save :truncate_fields | |||
|
|||
def truncate_fields |
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 some Rails 4.2 specific thing? I just seems like a general improvement to type-assertion, in which case, can't we keep this in another PR instead?
I'm okay either way, but I really like when a PR deals with just one thing, makes things easier to reason about.
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.
@ryzokuken
Actually these were added by @jywarren during the rails 4.2 update
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.
Early in the upgrade process I found I had to do this to get one test to pass, so I believe for some reason this was 4.2 related. Good question!
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.
Okay. @jywarren what do you say? I'd rather do a single thing in each PR.
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.
The ones I added were Rails 4.2 specific, so I'm fine with them being squashed into this. Sometimes with our atypical legacy code we require workarounds to move up Rails versions which may not immediately be apparent from the upgrade checklist but are borne out by the CI tests.
More broadly I am very much in favor of what you're saying -- if things can be merged in separately, then we can refer back to this PR as a good, concise example of a version upgrade, as narrowly defined as possible! In this case, as soon as @Souravirus re-adds the line on line 68 of answers_controller.rb
, I think we are good to move forward. Thanks for such a careful read-through!
@@ -106,5 +106,6 @@ class Application < Rails::Application | |||
|
|||
# Allow mass assignments | |||
config.active_record.whitelist_attributes = false | |||
config.active_record.raise_in_transactional_callbacks = true |
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.
Again, is this a code improvement which has nothing to do with the upgrade? If yes, I'd love if you cherry-picked this commit into another PR.
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.
No @ryzokuken, its a commit regarding to the update
@@ -10,6 +10,7 @@ test: | |||
encoding: utf8 | |||
pool: 5 | |||
timeout: 5000 | |||
strict: false |
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.
Same as above
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 was added by @jywarren in the update process.
Here is the screenshot:
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.
Again, this was to get a test to pass. Thanks!
@@ -18,6 +19,7 @@ development: | |||
password: | |||
encoding: utf8 | |||
database: publiclaboratory | |||
strict: false |
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.
Same as above
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 was added by @jywarren in the update process
@@ -28,3 +30,4 @@ production: | |||
encoding: utf8 | |||
pool: 5 | |||
timeout: 5000 | |||
strict: false |
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.
Same as above
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 was added by @jywarren in the update process
# config.log_level = :debug | ||
# Set to `:info` to match the current default, or set to `:debug` to opt-into | ||
# the future default. | ||
config.log_level = :info |
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.
Same as above
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 was added by @jywarren in the update process
Also, when we merge this, please make sure to squash and merge this. @Souravirus if possible, once the contents of this PR get approved completely, squash them. |
Yeah definitely I will squash them thanks @ryzokuken |
Done the changes as suggested by @Gauravano and @ryzokuken . Please see these changes @Gauravano, @ryzokuken @jywarren. Thanks!! |
OK -- perfect. I will check with @icarito in a few hours for one final check and we will move ahead with this! |
Okk thanks
Sent from Yahoo Mail on Android
On Fri, Apr 6, 2018 at 23:16, Jeffrey Warren<[email protected]> wrote:
OK -- perfect. I will check with @icarito in a few hours for one final check and we will move ahead with this!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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.
Wow...Fantastic work !
This is merged now!! |
Congratulations @Souravirus and everybody! |
Thanks !! |
@jywarren when it will be updated in the original website? |
We'll try over the next few days. It's already running at
stable.publiclab.org! Just want to do final checks before the main
publication. Great work!!
…On Fri, Apr 6, 2018, 3:33 PM Sourav Sahoo ***@***.***> wrote:
@jywarren <https://github.com/jywarren> when it will be updated in the
original website?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2533 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ5qq6wWm8iyS8sZJblpTxCc8s56Oks5tl9D0gaJpZM4S5BA->
.
|
@Souravirus congrats on successfully taking on such a big challenge. |
thanks @seafr |
Hey great work here, it's live on the publiclab.org website! Thanks for your contribution! |
Ah! great. Thanks!! |
* initial Rails 4.2 port * changing over to deliver_now for mails * updated Gemfile * truncating fixture field * truncating fixture field * nother fixture fix! fix! * nother fixture fix! fix! * last try with test dates for maps * truncation in model * strict: false in database.yml * back to before_save filter * back to before_save filter * deliver_now * strict back off... * strict back off... * Removed the error of undefined method 'any_instance' * changed wiki to /wiki because it was inside a integration test * Added deliver_now in the admin_mailer and node.rb * added test for AdminMailer.notify_node_moderators in notes_controller_test.rb * Added test for AdminMailer.notify_moderators_of_spam in admin_controller.rb * modified the deliver.now in comment_mailer.rb * Removed the errors related to reset_notify function in password_reset_mailer * modified the deliver_now in subscription_mailer.rb * modified the deliver_now in welcome_mailer.rb * Converted some assert_select to css_select and wrote rails-dom-testing in Gemfile * Added Gemfile.lock * Added few corrections * Removed conflicts * Modified the Gemfile.lock * Changed notes_controller * Corrected some suggestions * corrected some assert_select in editor_controller_test * Completed tests of controller_test.rb * corrected some assert_select * Removed few assert_select errors * Removed assert_select errors from notes_controller_test.rb * Reduced an error and removed all failures in functional * Removed the errors of tag_controller * Fixed all the errors and failures in functional folder * Removed errorfile * Removed all the errors * Added html-entities in rails test * Removed all fails * Removed some depreciation warnings * Removed a fail * Removed some depreciation warnings * Some changes done as suggested by reviewers
Related to #1832
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
fixes #0000
-style reference to original issue #@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.
Thanks!