Skip to content

feat(Upgradable)!: enable batched fn call after deploy#86

Merged
mooori merged 5 commits into
masterfrom
up-migrate-fn
Mar 7, 2023
Merged

feat(Upgradable)!: enable batched fn call after deploy#86
mooori merged 5 commits into
masterfrom
up-migrate-fn

Conversation

@mooori
Copy link
Copy Markdown
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
Copy Markdown

@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
This was referenced Mar 27, 2026
This was referenced Apr 7, 2026
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