-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Deprecate tasks in core/lib/tasks #2080
Conversation
core/lib/tasks/core.rake
Outdated
@@ -1,10 +1,16 @@ | |||
require 'active_record' | |||
|
|||
def prompt_for_agree prompt | |||
print prompt | |||
return ["y", "yes"].include? STDIN.gets.strip.downcase |
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.
Redundant return detected.
Unnecessary spacing detected.
core/lib/tasks/core.rake
Outdated
@@ -1,10 +1,16 @@ | |||
require 'active_record' | |||
|
|||
def prompt_for_agree prompt |
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.
Use def with parentheses when there are parameters.
9866727
to
605d576
Compare
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 never used these tasks. Just left a small comment, it works for me!
core/db/seeds.rb
Outdated
Rake::Task['db:load_dir'].reenable | ||
Rake::Task['db:load_dir'].invoke(default_path) | ||
['stores', 'store_credit', 'countries', 'return_reasons', 'states', | ||
'stock_locations', 'zones', 'refund_reasons', 'roles', 'shipping_categories'].each do |seed| |
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 like formatting this kind of array with each element in a separate line, mainly to keep git commits history clean if we change something, but it's just my personal preference, I'm ok with this as well.
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.
Yes. I also would like to have this separated by line 👍
And maybe use %w()
syntax, but I don't care about this very much.
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.
Great improvement.
core/db/seeds.rb
Outdated
Rake::Task['db:load_dir'].reenable | ||
Rake::Task['db:load_dir'].invoke(default_path) | ||
['stores', 'store_credit', 'countries', 'return_reasons', 'states', | ||
'stock_locations', 'zones', 'refund_reasons', 'roles', 'shipping_categories'].each do |seed| |
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.
Yes. I also would like to have this separated by line 👍
And maybe use %w()
syntax, but I don't care about this very much.
core/lib/tasks/core.rake
Outdated
namespace :db do | ||
desc 'Loads a specified fixture file: | ||
use rake db:load_file[/absolute/path/to/sample/filename.rb]' | ||
|
||
task :load_file, [:file, :dir] => :environment do |_t, args| | ||
ActiveSupport::Deprecation.warn("load_file has been deprecated. Please load your own file.") |
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.
Spree::Deprecation.warn
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 think we can be a little more verbose/descriptive on this deprecation notice
rake spree:load_dir
has been deprecated and will be removed with Solidus 3.0. Pleaseload
your seed files directly from your app'sdb/seeds.rb
file.
core/lib/tasks/core.rake
Outdated
@@ -13,6 +19,7 @@ use rake db:load_file[/absolute/path/to/sample/filename.rb]' | |||
|
|||
desc "Loads fixtures from the the dir you specify using rake db:load_dir[loadfrom]" | |||
task :load_dir, [:dir] => :environment do |_t, args| | |||
ActiveSupport::Deprecation.warn("load_dir has been deprecated. Please load your own files.") |
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.
Spree::Deprecation.warn
core/lib/tasks/core.rake
Outdated
@@ -32,9 +39,9 @@ use rake db:load_file[/absolute/path/to/sample/filename.rb]' | |||
|
|||
desc "Migrate schema to version 0 and back up again. WARNING: Destroys all data in tables!!" | |||
task remigrate: :environment do | |||
require 'highline/import' | |||
ActiveSupport::Deprecation.warn("remigrate has been deprecated. Please demigrate and then migrate again, I guess?") |
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 think rake db:reset
is what we want to recommend, no?
Also Spree::Deprecation.warn
Nothing in this file uses highline, say_status comes from thor
Using load_dir doesn't provide us much benefit over calling all of them ourselves here.
We're only using highline for a few, should-probably-not-be-used methods rake tasks.
605d576
to
06a2d76
Compare
Cleaned up the list of seeds and removed any trace of humour from the deprecations |
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
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's a word too much still in a deprecation notice, otherwise great!
core/lib/tasks/core.rake
Outdated
@@ -13,6 +19,7 @@ use rake db:load_file[/absolute/path/to/sample/filename.rb]' | |||
|
|||
desc "Loads fixtures from the the dir you specify using rake db:load_dir[loadfrom]" | |||
task :load_dir, [:dir] => :environment do |_t, args| | |||
Spree::Deprecation.warn("rake spree:load_dir has been deprecated and will be removed with Solidus 3.0. Please load your files directly file.") |
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.
Please load your files directly file.
I think there's a file too much.
Nothing here should be used by people.
06a2d76
to
cc19db9
Compare
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
All the tasks in this file are deprecated ref solidusio#2080
None of these tasks should be used by people.
This deprecates those tasks, and removes a dependency that exists just to support these tasks (highline).