-
Notifications
You must be signed in to change notification settings - Fork 897
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 the evm:deployment_status rake task #15402
Add the evm:deployment_status rake task #15402
Conversation
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.
Overall, looks good 👍 just a test comment.
end | ||
|
||
it "returns new_replica if the current server is not seeded" do | ||
server.delete |
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.
It feels awkward to create the server then delete it. I'd rather see the server created only in the test cases where it is needed.
This is mainly for running within containers where we want to know if we require initialization work to be done and if we should migrate the database. Previously this was done from (untested) bash scripts.
f673210
to
7ab13ea
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.
👍 LGTM
return "new_deployment" if ActiveRecord::Migrator.current_version.zero? | ||
return "new_replica" if MiqServer.my_server.nil? | ||
return "upgrade" if ActiveRecord::Migrator.needs_migration? | ||
"redeployment" |
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.
amazing how much cleaner Ruby is compared to bash.
lib/tasks/evm.rake
Outdated
"new_deployment" => 0, | ||
"new_replica" => 1, | ||
"redeployment" => 2, | ||
"upgrade" => 3 |
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 should pick better numbers, but overall I like the approach: http://tldp.org/LDP/abs/html/exitcodes.html
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, I honestly have no idea what those numbers mean 😕
Clearly, they're exit codes but from where? Can you put a link or a comment explaining them...
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 gave no thought to this at all.
The previous implementation was setting an environment variable to a string, but I figure an exit code was cleaner so I'm up for suggestions or I'll just go with 3, 4, 5, 6 (based on @Fryguy 's link)
Some comments on commits carbonin/manageiq@7ab13ea~...0b21880 lib/tasks/evm.rake
|
Checked commits carbonin/manageiq@7ab13ea~...0b21880 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
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.
👍
@carbonin This PR is beautiful 👍 |
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 wish you linked to the shell code this replaces. The change is even better when you compare the complexity of the before/after code.
This is mainly for running within containers where we want to know if we require initialization work to be done and if we should migrate the database.
Previously this was done from (untested) bash scripts.