-
Notifications
You must be signed in to change notification settings - Fork 49
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
Notes generated by mach cargo vet are unexpectedly deleted by running mach vendor rust #341
Comments
@mystor wdyt? |
The notes are disappearing because the key for these comments is Perhaps it's worth having some form of CI check that running |
Could we override the default to have cargo-vet just fail if there's an unrecognized field? That would result in this issue being caught by the person who added |
If the person who added I wonder a bit if perhaps there should be a This feels somewhat similar in some ways to other formatting issues which could be caught after the fact, such as the order of audits being re-written. |
That's a good idea. We can introduce that flag and then hook it up to run in CI. |
I wonder if we should default to that if you pass |
Yeah, I'm unsure, as theoretically one might want to run with |
My inclination is that we shouldn't anchor on locked just meaning "don't fetch imports" but interpret is more broadly as "we expect that everything is in a green state, please verify". |
This will detect issues like audits being out of order and unrecognized fields in CI, and should help avoid simple executions of `cargo vet` causing formatting changes locally. The implementation isn't particularly efficient for this, in that it immediately attempts to re-serialize the file after parsing it, and then compares the results (ignoring trailing newlines). As this checks formatting, it is a string-based check, and not structural. The `similar` library, which we already used for our tests, is used to allow including diffs in the output to make any issues more clear. This also required some changes to the way we read/write files from disk to keep information around. As a side-effect of these changes, we no longer emit an extra unnecessary newline at the end of store files. This won't be detected as an error by the checker, but will be a change when run locally. Fixes mozilla#341
This will detect issues like audits being out of order and unrecognized fields in CI, and should help avoid simple executions of `cargo vet` causing formatting changes locally. The implementation isn't particularly efficient for this, in that it immediately attempts to re-serialize the file after parsing it, and then compares the results (ignoring trailing newlines). As this checks formatting, it is a string-based check, and not structural. The `similar` library, which we already used for our tests, is used to allow including diffs in the output to make any issues more clear. This also required some changes to the way we read/write files from disk to keep information around. As a side-effect of these changes, we no longer emit an extra unnecessary newline at the end of store files. This won't be detected as an error by the checker, but will be a change when run locally. Fixes mozilla#341
Notes fields generated with
mach cargo vet
are being unexpectedly deleted duringmach vendor rust
. I discussed with @bholley , who suggested that I file an issue here.I'm able to reproduce the behavior with the
Cargo.toml
line from this patch:Here's some command output:
The text was updated successfully, but these errors were encountered: