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
Add ActionText installer rake task #37823
Add ActionText installer rake task #37823
Conversation
This ain't right. We should have an |
@kaspth maybe I misunderstood, but I thought the intention was to get rid of the rake task. We can add it back in if that's the desire. Just re-create |
Thanks for the feedback @kaspth. @vinistock I would love to. |
00e5b3d
to
fb6248c
Compare
@vinistock @kaspth Could you please review the changes? I tested it on one of the development app. The rake task is shown in the list of tasks( |
actiontext/lib/tasks/actiontext.rake
Outdated
task install: %w( environment run_action_text_generator) | ||
|
||
task :run_action_text_generator do | ||
system "#{RbConfig.ruby} ./bin/rails generate action_text:install" |
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.
Hm, this doesn't seem right to me. Though I can see we're doing the same thing in the Action Mailbox install Rakefile.
Can we require the correct generator and call start
on it like we do in the credentials command? (Assuming that'll still trigger the test framework hook.)
@y-yagi would you happen to have any opinions here?
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 tried requiring the generator and running it. The test framework hook didn't get invoked.
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 agree that we shouldn't run it from the bin file. Would this method be of help in this case?
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.
That method is only to be run within a generator, not from a Rake task.
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 see. How about this one? Could that be invoked from a rake task?
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.
Then I'd prefer to just do something like:
task "action_text:install" do
require "rails/command" # Can't remember the require path or if Rake tasks already have access to Rails::Command.
Rails::Command.invoke "generate action_text:install"
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.
Did the necessary changes. Removing desc
hide a generator from the list.
We probably also want to ensure we don't show the There's also an opportunity to convert Action Mailbox to use an install generator as well, after this. |
@vinistock from the users perspective, the fact that we accomplish the install logic via a generator is incidental (e.g. we just switched to it) and the public installer interface is |
fb6248c
to
5013216
Compare
@kaspth that makes sense. How does one hide a generator from the list? |
Can't remember, I'm assuming @abhaynikam can look at other generators or a method called something like |
5013216
to
22bf955
Compare
@abhaynikam looking better! Surprised we have access to About |
… Forwards the installer to run new ActionText generator
22bf955
to
d0c73b3
Compare
Yep. Works with
Sorry, I misunderstood. I have fixed it in the latest commit. Thanks |
It's looking good to me! |
@abhaynikam perfect, thanks so much! @vinistock thanks for the extra eyes too. 😄🙏 to you both |
After changes in #35085
While I was debugging this #37818, I faced with the issue where
rails action_text:install
as mentioned in the documentation was not working. After debugging for long it landed me to this PR: #35085PR moved the ActionText installer from task to generator. The documentation and warning message where user was suggested to run generator was not updated. This PR update the mention on ActionText installer.
I am not confident about changes in
tasks/release
file. Please do let me know if we need to revert it.