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

Use app namespace for framework tasks #23439

Merged
merged 1 commit into from Feb 27, 2016

Conversation

Projects
None yet
5 participants
@ryohashimoto
Contributor

ryohashimoto commented Feb 3, 2016

By introducing Rake proxy, rake rails commands become rails rails commands (rails rails:template, rails rails:update etc.) .

For simplicity, I removed the rails namespace from the framework codes and docs. (and now we can use rails template, rails update etc.)


updated:

Not removing the rails namespace, use app namespace instead.
e.g. rails rails:template and rails rails:update tasks should be rails app:template, rails app:update

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Feb 3, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @kaspth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

rails-bot commented Feb 3, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @kaspth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -1,68 +1,66 @@
namespace :rails do

This comment has been minimized.

@ryohashimoto

ryohashimoto Feb 3, 2016

Contributor

In this file, only the namespace and indentations are changed.

@ryohashimoto

ryohashimoto Feb 3, 2016

Contributor

In this file, only the namespace and indentations are changed.

@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth

kaspth Feb 3, 2016

Member

I don't think we should change this right now. I think more of bin/rails as the runner, and that the commands it runs pertains to the app itself... mostly. Because some commands fiddle more with the framework, i.e. those in the rails namespace. I say we keep it like this for 5.0 and spare the deprecation cycle. Thanks!

Member

kaspth commented Feb 3, 2016

I don't think we should change this right now. I think more of bin/rails as the runner, and that the commands it runs pertains to the app itself... mostly. Because some commands fiddle more with the framework, i.e. those in the rails namespace. I say we keep it like this for 5.0 and spare the deprecation cycle. Thanks!

@kaspth kaspth closed this Feb 3, 2016

@matthewd

This comment has been minimized.

Show comment
Hide comment
@matthewd

matthewd Feb 3, 2016

Member

@kaspth should we change the namespace to app: or something? rails rails:foo does look pretty terrible.

Member

matthewd commented Feb 3, 2016

@kaspth should we change the namespace to app: or something? rails rails:foo does look pretty terrible.

@ryohashimoto

This comment has been minimized.

Show comment
Hide comment
@ryohashimoto

ryohashimoto Feb 3, 2016

Contributor

@matthewd
I think so too.
The rails namespace is used for multiple purposes (update and template). So we could remove the namespace or use another namespace.

Contributor

ryohashimoto commented Feb 3, 2016

@matthewd
I think so too.
The rails namespace is used for multiple purposes (update and template). So we could remove the namespace or use another namespace.

@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth

kaspth Feb 3, 2016

Member

Yeah, app sounds good.

We should still define the rails versions but enrich them with a deprecation prerequisite task.

Member

kaspth commented Feb 3, 2016

Yeah, app sounds good.

We should still define the rails versions but enrich them with a deprecation prerequisite task.

@kaspth kaspth reopened this Feb 3, 2016

@ryohashimoto

This comment has been minimized.

Show comment
Hide comment
@ryohashimoto

ryohashimoto Feb 4, 2016

Contributor

@kaspth
Thanks for reopening this PR.
I updated the PR to use app namespace and add deprecation warnings for existing tasks under the rails namespace.

Contributor

ryohashimoto commented Feb 4, 2016

@kaspth
Thanks for reopening this PR.
I updated the PR to use app namespace and add deprecation warnings for existing tasks under the rails namespace.

@ryohashimoto ryohashimoto changed the title from Remove rails namespace for framework tasks to Use app namespace for framework tasks Feb 4, 2016

@kaspth

View changes

Show outdated Hide outdated railties/CHANGELOG.md
@kaspth

View changes

Show outdated Hide outdated railties/lib/rails/tasks/framework.rake
@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth

kaspth Feb 7, 2016

Member

Also needs a rebase (and remember to keep your commits squashed). Thanks ❤️

Member

kaspth commented Feb 7, 2016

Also needs a rebase (and remember to keep your commits squashed). Thanks ❤️

@ryohashimoto

This comment has been minimized.

Show comment
Hide comment
@ryohashimoto

ryohashimoto Feb 13, 2016

Contributor

@kaspth
Thanks for your advice.
Modified to use ActiveSupport::Deprecation.warn and removed deprecated task in the rails namespace.
So, when the task in the rails namespace is executed, only a deprecation message is printed out.

Contributor

ryohashimoto commented Feb 13, 2016

@kaspth
Thanks for your advice.
Modified to use ActiveSupport::Deprecation.warn and removed deprecated task in the rails namespace.
So, when the task in the rails namespace is executed, only a deprecation message is printed out.

@kaspth

View changes

Show outdated Hide outdated railties/lib/rails/tasks/framework.rake
@ryohashimoto

This comment has been minimized.

Show comment
Hide comment
@ryohashimoto

ryohashimoto Feb 16, 2016

Contributor

Updated and rebased. I think it's better to use deprecated task names like below.
(And it doesn't deprecate all tasks with rails: namespace.)

namespace :rails do
  %i(update template templates:copy update:configs update:bin).each do |task_name|
    task "#{task_name}" do
      ActiveSupport::Deprecation.warn(<<-MSG.squish)
        Running #{task_name} with the rails: namespace is deprecated in favor of app.
        Run e.g. bin/rails app:#{task_name} instead."
      MSG
      Rake.application.invoke_task("app:#{task_name}")
    end
  end
end
Contributor

ryohashimoto commented Feb 16, 2016

Updated and rebased. I think it's better to use deprecated task names like below.
(And it doesn't deprecate all tasks with rails: namespace.)

namespace :rails do
  %i(update template templates:copy update:configs update:bin).each do |task_name|
    task "#{task_name}" do
      ActiveSupport::Deprecation.warn(<<-MSG.squish)
        Running #{task_name} with the rails: namespace is deprecated in favor of app.
        Run e.g. bin/rails app:#{task_name} instead."
      MSG
      Rake.application.invoke_task("app:#{task_name}")
    end
  end
end
@ryohashimoto

This comment has been minimized.

Show comment
Hide comment
@ryohashimoto

ryohashimoto Feb 16, 2016

Contributor

@kaspth
Could you take a look?

Contributor

ryohashimoto commented Feb 16, 2016

@kaspth
Could you take a look?

@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth

kaspth Feb 24, 2016

Member

Looks good and thanks for your patience! Can you rebase? If not, I will do it tonight 😄

Member

kaspth commented Feb 24, 2016

Looks good and thanks for your patience! Can you rebase? If not, I will do it tonight 😄

@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth

kaspth Feb 24, 2016

Member

Wait, what do you mean by "(And it doesn't deprecate all tasks with rails: namespace.)"?

Member

kaspth commented Feb 24, 2016

Wait, what do you mean by "(And it doesn't deprecate all tasks with rails: namespace.)"?

@ryohashimoto

This comment has been minimized.

Show comment
Hide comment
@ryohashimoto

ryohashimoto Feb 24, 2016

Contributor

@kaspth
Thanks for your support. Rebased now.

(And it doesn't deprecate all tasks with rails: namespace.)

I mean only tasks listed below are now deprecated. If someone add other tasks in the 'rails' namespace,
they shouldn't be deprecated because they don't have corresponding tasks in the 'app' namespace.
I believe this approach is natural.

%i(update template templates:copy update:configs update:bin) # in the rails namespace
Contributor

ryohashimoto commented Feb 24, 2016

@kaspth
Thanks for your support. Rebased now.

(And it doesn't deprecate all tasks with rails: namespace.)

I mean only tasks listed below are now deprecated. If someone add other tasks in the 'rails' namespace,
they shouldn't be deprecated because they don't have corresponding tasks in the 'app' namespace.
I believe this approach is natural.

%i(update template templates:copy update:configs update:bin) # in the rails namespace
The tasks in the rails task namespace is deprecated in favor of app n…
…amespace.

(e.g. `rails:update` and `rails:template` tasks is renamed to `app:update` and `app:template`.)

kaspth added a commit that referenced this pull request Feb 27, 2016

@kaspth kaspth merged commit 6fb3163 into rails:master Feb 27, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kaspth

This comment has been minimized.

Show comment
Hide comment
@kaspth
Member

kaspth commented Feb 27, 2016

@ryohashimoto thanks!

@ryohashimoto

This comment has been minimized.

Show comment
Hide comment
@ryohashimoto

ryohashimoto Feb 27, 2016

Contributor

@kaspth Thanks a lot !

Contributor

ryohashimoto commented Feb 27, 2016

@kaspth Thanks a lot !

@ryohashimoto ryohashimoto deleted the ryohashimoto:160203_rake_rails branch Feb 27, 2016

kaspth referenced this pull request Feb 28, 2016

Update docs to point to new update task.
This guides were pointing to this command `rails app:update`, which I
tried to run, but it didnt worked. I think the right command is `rails
rails:update` instead. Also thats the name of the rake task.

Also I removed the `Rake` word from the title, as we run it using
`rails` bin now.

cc @kaspth
[skip ci]

yui-knk added a commit to yui-knk/rspec-rails that referenced this pull request Mar 23, 2017

Switch template task name depending on Rails version
Rake tasks `rails:update` or `rails:template` and so on were
deprecated on Rails 5.0, and will be removed on Rails 5.1.
So we should switch a task name.

ref:
* rails/rails#23439
* rails/rails@f778281

yui-knk added a commit to yui-knk/rspec-rails that referenced this pull request Mar 23, 2017

Switch template task name depending on Rails version
Rake tasks `rails:update` or `rails:template` and so on were
deprecated on Rails 5.0, and will be removed on Rails 5.1.
So we should switch a task name.

ref:
* rails/rails#23439
* rails/rails@f778281

yui-knk added a commit to yui-knk/rspec-rails that referenced this pull request Mar 23, 2017

Switch template task name depending on Rails version
Rake tasks `rails:update` or `rails:template` and so on were
deprecated on Rails 5.0, and will be removed on Rails 5.1.
So we should switch a task name.

ref:
* rails/rails#23439
* rails/rails@f778281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment