feat: include cargo trees in advisory reports#52
Open
jlizen wants to merge 1 commit into
Open
Conversation
jlizen
commented
Jun 9, 2026
| let auditReport = vulnerableAuditReport; | ||
| let cargoTreeExitCode = 0; | ||
|
|
||
| async function importMain(): Promise<void> { |
Author
There was a problem hiding this comment.
This is a bit fragile, importing main.ts right now has side effects.
Doing something like this:
if (require.main === module) {
main();
}
...might break the runtime usage (IDK js module loading that well) but we could also just split into an inner entrypoint file.
Member
|
Don't think I'll be able to review this. @tarcieri maybe? |
Member
|
I'd personally like to retire this whole thing and replace it with an extremely simple GitHub Action that just installs and runs the CLI, which would solve this same problem. I thought we had a statement on this repo about how it's in life support mode and not accepting new features, but maybe not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #5
When getting a vulnerability finding, you immediately want to see where it comes from.
Often that is based on cargo features (example: aws sdks bring in old rustls stuff with their default feature set, and lots of libraries don't have
--no-default-features).This change dumps an inverted cargo tree for any findings, including features, into the report.
It is on by default, with no opt-out. I can make it opt-out or opt-in if desired. From experience maintaining similar tooling inside my company, you basically always want to show it, saves a hop for any debug.
Example:
On failure, it shows the error.
Testing
I added some e2e snapshot tests with mocked cargo audit and cargo tree outputs, covering happy and sad paths.
I also manually tested the commands myself locally (though I didn't spin up a local github action runner).
I didn't add any unit tests exercising the real
cargo treeinvocation, there wasn't an integration harness yet, but i could be convinced to add it if desired.