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

[CLI] Improve warning message for source verification failure #13267

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Aug 2, 2023

Description

...when publishing or upgrading packages via the CLI. Improvements are as follows:

  • Preserve formatting in the error (newlines, etc) by removing debug formatting.
  • Add context explaining what the warning means, and that it can be ignored using a command-line flag.

Test Plan

  • Create two packages: test depending on dep.
  • Publish dep, and update its manifest with its published location.
  • Modify dep's source to be different from the version that was published.
  • Try to publish test, expect a source verification error, which now looks like this:
Failed to publish the Move module(s), reason: [warning] Local dependency did not match its on-chain 
version at b33d80d795a038ce44d1f67b84047493f8775ab29d7f856271f705c6e1fd329f::Dep::dep

This may indicate that the on-chain version(s) of your package's dependencies may behave differently 
than the source version(s) your package was built against.

Fix this by rebuilding your packages with source versions matching on-chain versions of dependencies, 
or ignore this warning by re-running with the --skip-dependency-verification flag.

If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

The source verification failure warning from package publish and upgrade CLI commands has improved formatting and suggests ways to fix the issue or silence the warning.

...when publishing or upgrading packages via the CLI.  Improvements
are as follows:

- Preserve formatting in the error (newlines, etc) by removing debug
  formatting.
- Add context explaining what the warning means, and that it can be
  ignored using a command-line flag.

Test Plan:

- Create two packages: `test` depending on `dep`.
- Publish `dep`, and update its manifest with its published location.
- Modify `dep`'s source to be different from the version that was
  published.
- Try to publish `test`, expect a source verification error, which now
  looks like this:

```
Failed to publish the Move module(s), reason: [warning] Local dependency did not match its on-chain version at b33d80d795a038ce44d1f67b84047493f8775ab29d7f856271f705c6e1fd329f::Dep::dep

This may indicate that the on-chain version(s) of your package's dependencies may behave differently than the source version(s) your package was built against.

Fix this by rebuilding your packages with source versions matching on-chain versions of dependencies, or ignore this warning by re-running with the --skip-dependency-verification flag.
```
@amnn amnn self-assigned this Aug 2, 2023
@vercel
Copy link

vercel bot commented Aug 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 2:14pm
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Aug 2, 2023 2:14pm
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Aug 2, 2023 2:14pm
mysten-ui ⬜️ Ignored (Inspect) Visit Preview Aug 2, 2023 2:14pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Aug 2, 2023 2:14pm
sui-wallet-kit ⬜️ Ignored (Inspect) Visit Preview Aug 2, 2023 2:14pm

@amnn amnn requested a review from damirka August 2, 2023 14:10
@damirka
Copy link
Contributor

damirka commented Aug 2, 2023

Just thinking out loud - would it make sense to add a "force refetch" flag to the CLI?

The cause of the issue usually is folks using "testnet" as a ref, and Move CLI does not refetch deps when a branch is specified (as in not commit hash).

Copy link
Contributor

@damirka damirka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but left a comment with an idea of how this or a follow up action could help make it better.

@amnn
Copy link
Contributor Author

amnn commented Aug 2, 2023

would it make sense to add a "force refetch" flag to the CLI?

I need to understand this better: The default behaviour of the toolchain is to refetch remote (git) dependencies before you compile, and you need to use the --skip-fetch-latest-git-deps, so what would "force refetch" do? If we're not refetching, that suggests a(nother) bug.

@amnn amnn merged commit 46e32c0 into main Aug 2, 2023
@amnn amnn deleted the amnn/dep-verification-error branch August 2, 2023 14:57
ebmifa pushed a commit that referenced this pull request Aug 10, 2023
## Description

...when publishing or upgrading packages via the CLI. Improvements are
as follows:

- Preserve formatting in the error (newlines, etc) by removing debug
formatting.
- Add context explaining what the warning means, and that it can be
ignored using a command-line flag.

## Test Plan

- Create two packages: `test` depending on `dep`.
- Publish `dep`, and update its manifest with its published location.
- Modify `dep`'s source to be different from the version that was
published.
- Try to publish `test`, expect a source verification error, which now
looks like this:

```
Failed to publish the Move module(s), reason: [warning] Local dependency did not match its on-chain 
version at b33d80d795a038ce44d1f67b84047493f8775ab29d7f856271f705c6e1fd329f::Dep::dep

This may indicate that the on-chain version(s) of your package's dependencies may behave differently 
than the source version(s) your package was built against.

Fix this by rebuilding your packages with source versions matching on-chain versions of dependencies, 
or ignore this warning by re-running with the --skip-dependency-verification flag.
```

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [x] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes

The source verification failure warning from package publish and upgrade
CLI commands has improved formatting and suggests ways to fix the issue
or silence the warning.
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.

3 participants