-
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
implement imports.exclude #80
Comments
I think I've been picturing a local override more as a flag only local audits can have with an extra flag for "and i mean it", ala The flipside over-engineered version of this would be generating a uuid for each forbid entry so people can explicitly name it. |
Yeah, my thinking was that being able to selectively reject imported audits as proposed above is a simple safety valve that doesn't complicate the model or lead to surprising results. |
One case where I could see fundamental disagreements cropping up are where we have unsafe code that is technically undefined behavior but also unlikely to ever be a problem. We come across this fairly often. (recent example) In any case: A problem I see with the model being proposed here is that a trusted upstream audit source can suddenly cause
|
Yes there is already a "lockfile" for foreign audits -- imports.lock, one of the 3 files managed by cargo vet and which is already minimally implemented. It's just a cache of all the foreign files, nothing fancy. The expected workflow is that CI will run with |
I added |
I think this will be slightly easier to implement in a clean way once we've also fixed #238, as that way we can more easily track which source each imported entry comes from and do these exclusions locally after the lock has been updated. I imagine we'll want to have the excluded entries downloaded and in the lockfile to keep formatting and error reporting anyway. |
This is a fairly straightforward implementation of imports.exclude. The configuration option is already documented in the book. After changing this configuration value, you'll need to update imports.lock by running a successful `cargo vet` without `--locked` (or by running `cargo vet regenerate imports`). I also added some validation to help catch outdated `imports.lock` files when running with `--locked`. These will never fire when unlocked, as `imports.lock` will be automatically updated in those cases. Fixes mozilla#80
At present cargo-vet largely punts on conflict handling, we should define it.
Generally speaking, audits are additive and can't generate conflicts. However, it can happen if the range provided in a
violation
entry intersects a leaf in the audit version graph. This basically means that two parties explicitly disagree on whether the criteria are met for that version. Examples might include:violation
range.I think (1) and (2) are the most likely cases, and so I think we want the default behavior to result in a discussion and ideally a consensus resolution. However, we can't have the tool entirely fall apart while that discussion is happening, or in the actual case of (3). So we need some mechanism to immediately resolve the conflict locally.
My spitball suggestion here is to add an
exclude
field toimports
table entries, which lists a set of crates for which audits are dropped for that import. That strikes me as a lightweight mechanism to resolve conflicts in either direction (local violation + foreign certification, or vice versa), while also ensuring that any such conflict is surfaced for manual inspection.@tmandry wdyt?
The text was updated successfully, but these errors were encountered: