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

Add job deploying contracts from dapp-development branch #392

Merged
merged 12 commits into from
Sep 19, 2022
Merged

Conversation

michalinacienciala
Copy link
Contributor

@michalinacienciala michalinacienciala commented Aug 2, 2022

There are situations when team developing T Token Dashboard needs to
locally test some functionalities using modified contracts, for example
ones with shorter authorization decrease delay. We decided to create a
dapp-development branch in each of the upstream modules of
threshold-network/token-dashboard CI module, which would store the
code of these modified contracts. In this PR we create a
contracts-dapp-development-deployment-testnet job which deploys the
contracts, creates an NPM package (with dappdev<environment> suffix
and dapp-development-<environment> tag) and publishes it to the NPM
registry. At the end of the job we don't have a step informing CI about
completion of the workflow because we don't want to start the deployment
of the T Token Dashboard (which will soon be added as a downstream
module to the CI config) on a public testnet using modified contracts.
The job gets triggered only as a result of workflow_dispath event from
a dapp-development branch. Currently only goerli environment is
supported. We don't run system and unit tests for dapp-development
branch, as the tests are not configured to work with the modified
contracts.
Generally, the goal of the changes is to have the full set of
dapp-development-friendly contracts deployed to the NPM registry, so
that the dApp developers could quickly use them by upgrading the
token-dashboard dependencies using yarn upgrade <package-name>@dapp-development-goerli.
If the workflow gets dispatched from a different branch than
dapp-development, the deploy will behave as it used to, publishing
package with deployed unmodified contracts to the NPM registry under
<environment> tag.

TODO:

  • Modify the secret for the deployer account in the contracts-dapp-development-deployment-testnet job
  • Bump actions to latest versions
  • Test the workflow. For that we need:
  • Remove the dry-run from the code

Refs:
threshold-network/token-dashboard#136
threshold-network/solidity-contracts#119
keep-network/keep-core#3121

There are situations when team developing T Token Dashboard needs to
locally test some functionalities using modified contracts, for example
ones with shorter authorization decrease delay. We decided to create a
`dapp-development` branch in each of the upstream modules of
`threshold-network/token-dashboard` CI module, which would store the
code of these modified contracts. In this PR we create a
`contracts-dapp-development-deployment-testnet` job which deploys the
contracts, creates an NPM package (with `dappdev<environment>` suffix
and `dapp-development-<environment>` tag) and publishes it to the NPM
registry. At the end of the job we don't have a step informing CI about
completion of the workflow because we don't want to start the deployment
of the T Token Dashboard (which will soon be added as a downstream
module to the CI config) on a public testnet using modified contracts.
The job gets triggered only as a result of `workflow_dispath` event from
a `dapp-development` branch. Currently only `goerli` environment is
supported. We don't run system and unit tests for `dapp-development`
branch, as the tests are not configured to work with the modified
contracts.
Generally, the goal of the changes is to have the full set of
dapp-development-friendly contracts deployed to the NPM registry, so
that the dApp developers could quickly use them by upgrading the
`token-dashboard` dependencies using `yarn upgrade
<package-name>@dapp-development-goerli`.
If the workflow gets dispatched from a different branch than
`dapp-development`, the deploy will behave as it used to, publishing
package with deployed unmodified contracts to the NPM registry under
`<environment>` tag.
The contracts deployed in the
`contracts-dapp-development-deployment-testnet` job will be used by dApp
developers to build their local environments and deploy dApp previews.
We want more flexibility there than on the public-facing testnet dApp and
we want to use different deployer accounts for those two different types
of testnet dApps.
Newer versions of actions used in our workflows are available.
Changes not intended for merge to `main`.
We don't want to fill the default value with value that is supported, to
prevent from accidental dispatches of the workflow by people who don't
fully understand how the inputs should be configured. Previously we used
explicitely incorrect default value, but that may be too much and may be
a bit confusing. Let's leave the input without default.
Previously `-` was not supported as a value of `environment` property in
the `npm-version-bump` action. Now action supports hyphens and we can
change the suffix to more readible format.
We no longer use `/solidity` in the name of the `keep-core` CI modules. We
already replaced the old names with the new ones, but we missed one place where
the old names were still being used. This commit fixes that.
@michalinacienciala
Copy link
Contributor Author

Deployment tested on a branch that combines code from #392 and #403: https://github.com/keep-network/tbtc-v2/actions/runs/3052208927

@nkuba nkuba merged commit c10b380 into main Sep 19, 2022
@nkuba nkuba deleted the ci-dapp-dev branch September 19, 2022 14:00
@pdyraga pdyraga added this to the solidity/v1.0.0 milestone Jan 31, 2023
@pdyraga pdyraga added the ⛓️ solidity Solidity contracts label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⛓️ solidity Solidity contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants