-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat(cosmovisor): add ability to run custom preupgrade script #16550
feat(cosmovisor): add ability to run custom preupgrade script #16550
Conversation
tools/cosmovisor/args.go
Outdated
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.
Could you update the tests.
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.
tests updated, waiting for results.
Will take care of tests another day :) |
give us a ping whenever you have them 🙌 |
59367ed
to
a6bc667
Compare
a6bc667
to
88ef8be
Compare
@facundomedica Tests added. Some "less related" github automated test fail, but the directly related tests pass.. If more adjustments necessary, please message back. |
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 lgtm. I am going to test locally that it works.
tools/cosmovisor/process.go
Outdated
return err | ||
} | ||
|
||
if uInfo.Name == "" { |
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.
nit: we could use the validate function on the plan
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.
changed code to use ValidateBasic
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.
should the test be removed completely since UpgradeBinary already checks upgradeInfo.ValidateFull()?
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 and thank you @chillyvee! LGTM to me mostly but there is an assertion that we need to make in the tests for cases where the preUpgrade file doesn't exist to ensure that the error is of type os.IsNotExist. Thank you.
@odeke-em Appreciate the comments! Running new commits through test. |
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, thank you @chillyvee!
Description
Validators/Infrastructure providers need the ability to execute custom scripts for backup, alerting, and other functions prior to upgrade.
Set environment variable COSMOVISOR_CUSTOM_PREUPGRADE=preupgrade.sh to execute
.simapp/cosmovisor/preupgrade.sh
during upgrade.Custom script is run with 2 arguments [ Upgrade Name, Upgrade Height ]
For example:
.simapp/cosmovisor/preupgrade.sh v2 2000
for upgrade v2 at height 2000Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change