fix(release): ignore embedded metadata in changedset, list breaking changes first - #323
Conversation
Signed-off-by: GHkrishna <krishna@parity.io>
Signed-off-by: GHkrishna <krishna@parity.io>
Signed-off-by: GHkrishna <krishna@parity.io>
Signed-off-by: GHkrishna <krishna@parity.io>
CI Summary
Deploy ContractsDeployed addresses vs the expected setExpected is the committed expected-address set; actual is this CI deployment of the same pipeline.
Labelsother, type: docs |
There was a problem hiding this comment.
Please shorten the breaking-change section so it is only the broken ABIs, and list each break once. We should avoid putting too much information in there, otherwise people will end up skipping it.
The ordering is right: changed function signatures, removed functions, contracts no longer published, then changed or removed events. The text around that list is what people will skip. Drop the per-group explanations ("Existing callers get a bare revert…", "Calls to these now revert…", and so on). Drop the copied pull-request bodies.
The body should look like this:
Breaking ABI changes since v0.7.0
IUserStore.initialize:initialize(address)→initialize(address,address)
Also notice v0.8.0 listed that same change twice, on UserStore and on IUserStore. UserStore is IUserStore, and both ABIs are published, so the signature is identical. It would have been better to print it once, under the interface, which is what callers bind to, same for events. If the implementation has a breaking signature the interface does not, keep that line. Pair them the way .github/abi-contracts.txt does: Foo with IFoo.
You can put additions, new contracts, and custom errors behind a collapsed
Details
...block with a count in the summary, or leave them to abi-diff.json. They are not breaking, and in v0.8.0 they were most of the section.
Signed-off-by: GHkrishna <krishna@parity.io>
Signed-off-by: GHkrishna <krishna@parity.io>
re-gius
left a comment
There was a problem hiding this comment.
Thanks, almost done!
However, the Foo / IFoo check still lists DotnsFlatPricing and IDotnsPricing twice, because their names do not match.
Read the bases from the Forge artifacts the release job already built. Use a base only when it is also a published ABI. Record those names in the extract step and pass them to abidiff, so to cover all interface implementations.
Signed-off-by: GHkrishna <krishna@parity.io>
…eaking changes Signed-off-by: GHkrishna <krishna@parity.io>
…n breaking changes Signed-off-by: GHkrishna <krishna@parity.io>
|
Good catch, thanks. The extract step now records each contract's published bases from the build, and abidiff lists a change once, under the interface declaring it. Base ids are resolved through the same run's build info, since incremental builds mix ids. Removed contracts still get their own line. |
re-gius
left a comment
There was a problem hiding this comment.
LGTM!
nit: fix PR description.
Description
This PR fixes two things in the release tooling (
scripts/js/release-metadata.mjs).1.
changedsetno longer flags StoreFactory after comment-only editsStoreFactory deploys other contracts with
new, so its bytecode carries a copy of their creation code. Each copy ends with that contract's own metadata hash, and that hash changes whenever a comment or NatSpec line changes.changedsetonly stripped StoreFactory's own metadata at the end of its bytecode, so a comment edit in LabelStore made StoreFactory look changed and asked for an upgrade nobody needed.Now the hash inside each embedded copy is set to zeros before hashing. Real code changes still show up.
codehashes.jsongets a newhashSchemefield so that files hashed the old way and the new way are never compared by mistake.changedsetreads that field and hashes the current build the same way the previous file was hashed.2. Shorter ABI section in the release notes
The release body now has a "Breaking ABI changes" list with only the changes that break an existing caller or indexer, one line each: changed function signatures, removed functions, contracts no longer published, then changed or removed events. Everything else (additions, new contracts, custom errors) goes in a collapsed block with a count.
abi-diff.jsonis unchanged and still has the full diff.A contract and the interfaces it implements usually carry the same change, so each change is listed once, under the interface that declares it. A new
basescommand reads which published ABIs each contract inherits from, straight from the build, so pairs whose names don't match (likeDotnsFlatPricingandIDotnsPricing) are matched too. The extract step in both publish workflows runs it and passes the result toabidiff --bases.Type
Scope
Release tooling only. No contract code changes.
Related Issues
Found in #321, whose NatSpec-only edits to LabelStore put StoreFactory in its changedset.
Fixes
Fixes #322
Checklist
Code
forge buildpassesforge testpassesTesting
Security
selfdestructordelegatecallDocumentation
Breaking Changes
Breaking changes:
How to test
changedset fix
Release notes
Against the v0.7.0 and v0.8.0 release ABIs, the breaking list is the single
IUserStore.initializeline, and the other 26 changes are in the collapsed block.Notes
codehashes.json, which was hashed the old way. So StoreFactory will show up once more in that release's changedset if any contract it deploys changed, even if only a comment changed. After that it is clean.forge buildandrelease-metadata.mjs build, then pass the newcodehashes.jsontochangedset. If StoreFactory is not listed, its code did not change and it does not need an upgrade.basesreads the base contracts from the build info of the same compiler run, because AST ids only mean something inside one run. If no build info matches, it fails and asks forforge clean && forge build.