-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[1.10 Backport] Revert "fix: test_sec_audit: ignore cargo audit output" #5101
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
[1.10 Backport] Revert "fix: test_sec_audit: ignore cargo audit output" #5101
Conversation
8bb41a6
to
8fc9dde
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## firecracker-v1.10 #5101 +/- ##
==================================================
Coverage 84.10% 84.10%
==================================================
Files 251 251
Lines 28080 28080
==================================================
Hits 23616 23616
Misses 4464 4464
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This is a lot of changes for a one line fix. Is there a way we can fix the audit without bringing in alll these other unrelated changes? |
I tried building a sort of |
Maybe we can just hack it to add a
I tested it and it's working fine:
|
But this won't work in the scenario where we want to run the grep, because it'll just abort without filtering out the unwanted part of the output in case of failures, no? |
41918d7
to
c345fc3
Compare
Isn't that the same behavior of running without the grep on the fixed |
When we run this as an A/B-Test, in python we ignore the return code and only parse the json it outputs to stderr. But for that to work, all non-json parts actually need to be stripped from stderr, e.g. we need to run the grep part even if cargo audit fails. Now yes, there's way we can hack around all of this by running different commands for A/B and non-A/B, but I admittedly don't see the problem with backporting a handful (or two) of commits 😅 |
Right, that's why I suggest to keep the I tested also the PR scenario in case you don't believe me, adding a debug
We're currently standing at 13 commits and 93 files changed unless you pushed the wrong thing. |
Oh, I see what you mean now. Bash will not abort
|
oh! neat, didn't now that. I thought it would just abort before the grep without running it if cargo audit fails.
I still don't see any problem 😂 but let me update to your proposed on-line fix. Kinda wished we'd done it that way in main as well now, so that all the branches would be in sync, but oh well :( |
The pipe through grep was causing any return code of cargo audit to be overwritten with that of grep (which is always 0). Fix this by using `-o pipefail`, which changes the return code of a bash pipe to instead be that of the rightmost failing command (or 0 if none fail). Note that just -o pipefail will not abort the pipe on a non-zero code (so the grep will still run even if cargo audit fails). Suggested-by: Riccardo Mancini <[email protected]> Signed-off-by: Patrick Roy <[email protected]>
I wouldn't worry too much about that. We'll likely never touch this part of the code again and in a few months we'll forget this branch even existed. |
c345fc3
to
1ec07ec
Compare
e7ae239
into
firecracker-microvm:firecracker-v1.10
This reverts commit d761b01. The output
to stdout was fixed in cargo audit 0.21.2, so if we rebuild the docker
container the grep is no longer necessary.
In fact, the grep has broken this test in our nightly pipeline because
it overwrites the return code of cargo audit itself, meaning the non-PR
version of this test (which is supposed to fail if there exist any cargo
audit warnings) was never failing.
(cherry picked from commit 1d98a21)
Signed-off-by: Patrick Roy [email protected]
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md
.PR Checklist
tools/devtool checkstyle
to verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md
.Runbook for Firecracker API changes.
integration tests.
TODO
.rust-vmm
.