fix(filter-triage logic): include Mitigated, update the products tally #5481
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.
EDIT:
I think I've found all the necessary pieces of the puzzle and it all essentially boils down to fixing/adjusting the
--filter-triageswitch logic: take theMitigatedremark into account, and update the product CVE tally.With these corrections, the tool's exit status is now correctly reflecting the triaged CVEs, and the test_requirements.py can be adjusted to get rid of those custom/disabled pieces.
This change is useful beyond that test, so is still meaningful even in view of its potential removal as described in #4294.
Tested this manually by including a dependency with a CVE, and triaging it using the
TRIAGE.json.Let me know what you think.
Original PR description follows for context, but it's less relevant now, the above covers it.
The test_requirements.py test used a custom logic block to implement what is essentially the
--filter-triageswitch now, with one minor difference - theMitigatedpart was omitted from the latter.Add
Mitigatedto the filter-triage list, and use the switch in the test.I've stumbled upon this while reviewing #5465 and a commented out piece mentioning #1752 caught my attention, so I went down the rabbit hole.
That one is still open and I need to gather more information to open either a proposed PR or an issue to discuss it first. There's certainly some logic duplication and discrepancy, and the exit status is still not 0 when all CVEs are marked as mitigated/inapplicable, even though #1752 is closed by now.
While investigating the above I realized we can (and I think - should) get rid of that custom logic block in the test, now that we have a native feature for that. That required an adjustment in the filtering logic itself, but I think
Mitigatedmakes sense in that list - let me know what you think.