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

Move `dev:cache` rake task to use Rails::Command #33559

Merged
merged 3 commits into from Aug 15, 2018

Conversation

Projects
None yet
6 participants
@anniecodes
Contributor

anniecodes commented Aug 8, 2018

This PR:

  1. Moves the dev:cache rake task to be using Rails::Command instead without changing the API
  2. It adds deprecation around calling that command with rake instead of rails
@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Aug 8, 2018

r? @sgrif

(@rails-bot has picked a reviewer for you, use r? to override)

rails-bot commented Aug 8, 2018

r? @sgrif

(@rails-bot has picked a reviewer for you, use r? to override)

Show outdated Hide outdated railties/test/commands/dev_test.rb

@guilleiguaran guilleiguaran requested a review from kaspth Aug 8, 2018

@bogdanvlviv

Thanks for the PR!
Could you please fix rubocop issues https://codeclimate.com/github/rails/rails/pull/33559

Show outdated Hide outdated railties/lib/rails/tasks/dev.rake
Show outdated Hide outdated railties/test/commands/dev_test.rb
Show outdated Hide outdated railties/test/application/rake/dev_test.rb
Show outdated Hide outdated railties/test/commands/dev_test.rb
# frozen_string_literal: true
require "isolation/abstract_unit"
require "rails/command"

This comment has been minimized.

@bogdanvlviv

bogdanvlviv Aug 8, 2018

Contributor

This "require" also seems extra in this file since we don't use Rails::Command.
But I think we should add require "rails/command" to railties/lib/rails/tasks/dev.rake file

@bogdanvlviv

bogdanvlviv Aug 8, 2018

Contributor

This "require" also seems extra in this file since we don't use Rails::Command.
But I think we should add require "rails/command" to railties/lib/rails/tasks/dev.rake file

This comment has been minimized.

@bogdanvlviv

bogdanvlviv Aug 8, 2018

Contributor

I double checked it, we need this "require"
since we use class Rails::Command::DevTest < ActiveSupport::TestCase
and removing it causes uninitialized constant Rails::Command (NameError)

@bogdanvlviv

bogdanvlviv Aug 8, 2018

Contributor

I double checked it, we need this "require"
since we use class Rails::Command::DevTest < ActiveSupport::TestCase
and removing it causes uninitialized constant Rails::Command (NameError)

This comment has been minimized.

@anniecodes

anniecodes Aug 8, 2018

Contributor

Yes this one is necessary. I had double checked that one when checking the rails/commands/dev/dev_command.rb as well. I'll update the dev.rake with the require.

@anniecodes

anniecodes Aug 8, 2018

Contributor

Yes this one is necessary. I had double checked that one when checking the rails/commands/dev/dev_command.rb as well. I'll update the dev.rake with the require.

Show outdated Hide outdated railties/test/commands/dev_test.rb
Show outdated Hide outdated railties/test/application/rake/dev_test.rb
@anniecodes

This comment has been minimized.

Show comment
Hide comment
@anniecodes

anniecodes Aug 9, 2018

Contributor

Test failures are unrelated to this PR. I'm going to rebase after the fix for these i18n related failures is on master.

Contributor

anniecodes commented Aug 9, 2018

Test failures are unrelated to this PR. I'm going to rebase after the fix for these i18n related failures is on master.

@kaspth

Needs a commit squash as well, then 👍

@@ -1,10 +1,11 @@
# frozen_string_literal: true
require "rails/dev_caching"
require "rails/command"

This comment has been minimized.

@kaspth

kaspth Aug 11, 2018

Member

We should probably do require "active_support/deprecation" here as well.

@kaspth

kaspth Aug 11, 2018

Member

We should probably do require "active_support/deprecation" here as well.

This comment has been minimized.

@anniecodes

anniecodes Aug 13, 2018

Contributor

Done :)

@anniecodes

anniecodes Aug 13, 2018

Contributor

Done :)

anniecodes added some commits Aug 8, 2018

Have `bin:rake dev:cache` use the Dev Rails Command under the hood
* Call the Rails::Command::DevCommand in the rake task for dev:cache
* Add deprecation for using `bin/rake` in favor of `bin/rails`

@kaspth kaspth merged commit efaa719 into rails:master Aug 15, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
codeclimate All good!
Details
@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth

kaspth Aug 15, 2018

Member

Thanks, @anniecodes!

Member

kaspth commented Aug 15, 2018

Thanks, @anniecodes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment