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

Set deploy config to be updatable/deletable by default for CI/CD success #28

Closed
SilentRhetoric opened this issue May 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@SilentRhetoric
Copy link

SilentRhetoric commented May 7, 2023

Setting the HelloWorldApp delete & update parameters to is_local and on_update behavior to be dependent on the network on which it is deployed (UpdateApp locally but Fail on any other network) creates an unintuitive foot-gun for developers new to AlgoKit.

This is because the default behavior will work smoothly on the Localnet but then sets the developer up for the GH Actions workflow to fail the first time an updated contract is pushed to GH.

The automated deploy-testnet job will attempt to update the testnet contact, but it will have defaulted to being non-updatable/deletable unless the developer has thought to reconfigure this:

                on_schema_break=(
                    OnSchemaBreak.ReplaceApp if is_local else OnSchemaBreak.Fail
                ),
                on_update=OnUpdate.UpdateApp if is_local else OnUpdate.Fail,
                allow_delete=is_local,
                allow_update=is_local,
            )

To something like:

deploy_response = app_client.deploy(
                on_schema_break=(
                    OnSchemaBreak.ReplaceApp
                ),
                on_update=OnUpdate.UpdateApp,
                allow_delete=True,
                allow_update=True,
            )

I think this would both better demonstrate the idempotent deployment approach harmoniously with the automated CI/CD and also be a reasonably good practice for production smart contract development until the developer makes a conscious decision to have the contract be permanent and/or immutable.

@daniel-makerx
Copy link
Contributor

Thanks for the feedback @SilentRhetoric, we will have a change coming soon that will give a nicer default experience for localnet and testnet as well as having a conservative default for mainnet

@robdmoore robdmoore added the enhancement New feature or request label Dec 29, 2023
@daniel-makerx
Copy link
Contributor

This was resolved by using the AppendApp action instead of Fail when in higher environments see here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants