-
Notifications
You must be signed in to change notification settings - Fork 27
Conversation
@brianmcmichael @gbalabasquer I think this PR could be reviewed and merged on |
Unified together with #170 to automate further the spell crafting process by relying on Etherscan APIs to retrieve transaction hash, including commit add-on feat to automate end-to-end following |
scripts/deploy.sh
Outdated
# commit edit change to config.sol | ||
(set -x; git add src/test/config.sol) | ||
(set -x; git commit -m "add deployed spell info") |
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.
I'm not sure if we should auto-commit this. First, I think this approach could be fragile (like one may have other staged changes for addition). Second, there is something that is a bit too sneaky about auto-commits without human review. Minimally, if we wanted to do this, I would say we should let this code run for a while and see if it encounters any failures under normal operation. But honestly, I think we may just want humans to be able to diff to review, add, and commit this manually.
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.
yeah, this pattern is part of the spell crafting/reviewing automation endeavour, inspired by dapp init
pattern.
In this specific case though, it could be a bit tricky as there are many moving pieces but one approach could be ensuring the changes have been actually edited in config.sol
directly or better, running tests and if they pass commit.
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.
Added tests check at deployed block in 8581a61
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.
Not a fan of the auto-commit either. If this is part of an automation workflow, it may be better to have the auto-commit done in an external script that calls deploy.sh imo.
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.
As discussed in chat I'm testing some improvements to beef the script up with more checks before committing the changes as make test
is a bit fragile an could return a zero status even if tests doesn't pass, but not opposed to handle the commit in an external script, I only think would be best for a CLI tool where the approach is more modular.
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.
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.
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.
after some testing and further discussions, using trap
we ensure we always exit with restoring the staging area.
Co-authored-by: Christopher Mooney <[email protected]>
Rationale
Following #170 pattern I've extended the
deploy.sh
script behaviour to automatically editconfig.sol
by replacing the address with the deployed one (works with both pre-existingaddress(0)
or with deployed spell addressaddress(0x123)
.