Skip to content
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(Upgradable)!: enable batched fn call after deploy #86

Merged
merged 5 commits into from
Mar 7, 2023

Conversation

mooori
Copy link
Contributor

@mooori mooori commented Mar 7, 2023

Closes #76 and this external issue.

Adds an additional parameter to Upgradable::up_deploy_code that allows to optionally specify a function call to be batched with the code deployment. This might be a function that migrates state. If that function call fails, the deployment is rolled back and the old code remains active.

Breaking change

This is a breaking change since it modifies the signature of Upgradable::up_deploy_code. Users that want to maintain the previous behavior (deployment without function call) can migrate in the following way:

// Previously:
up_deploy_code()

// Same behavior with the new API:
up_deploy_code(None)

@mooori mooori marked this pull request as ready for review March 7, 2023 15:55
@mooori mooori requested a review from birchmd March 7, 2023 15:55
Copy link

@birchmd birchmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mooori mooori merged commit 1035de5 into master Mar 7, 2023
@mooori mooori deleted the up-migrate-fn branch March 7, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgradable: don't deploy code if state migration fails
3 participants