-
Notifications
You must be signed in to change notification settings - Fork 0
Test 6.1.35: Add validation for contradicting remediations in CSAF documents #19
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
Conversation
|
Introduced test "6.1.35" to validate and detect contradicting remediation categories for the same product. Added traits and implementations to abstract remediation and vulnerability handling for easier extensibility across CSAF versions. Updated test infrastructure and presets to include the new validation logic.
933148b
to
7735f81
Compare
|
Refactor test case logic to handle multiple scenarios and update validation schema. Adjust remediation categories and align dependencies to more flexible version ranges to enhance maintainability.
Updated the remediation validation logic to account for product groups and associations using the new `get_all_product_ids` method. Added helper functions and traits to resolve product IDs from groups, ensuring accurate detection of contradicting remediations. Enhanced test cases to cover these changes and updated data structures for improved clarity.
Replaced HashSet with BTreeSet across multiple modules to ensure deterministic iteration order and sorted outputs. Updated function signatures, implementations, and imports accordingly to align with this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general this needs more documentation, especially how the trait magic works and please do the update / schema regen in a separate PR so we can focus on the code here which is non-trivial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also state the test number in the PR, if it is trying to implement a test.
Just converting back to draft to male it easier for me to review things. |
Then we are lacking test cases and especially remediation categories. |
ok then let's keep it in this file and hopefully the next tests will be easier. |
Most certainly, because I had to do all the hard lifting here... 😂 |
Moved `get_all_product_ids` implementation from `getter_implementations.rs` to `getter_traits.rs` for better modularity and reuse. Removed redundant imports and optimized closures for clarity and consistency in all related modules.
Detailed explanations and doc comments were added to traits and methods to clarify their roles in the CSAF document structure. This improves code readability and provides guidance on key functionalities, such as remediation category normalization and product resolution mechanisms.
Replaced string-based conversion of remediation categories with direct enum matching. This ensures stronger type safety, improves performance, and eliminates potential runtime panics from invalid string parsing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments, other than that LGTM
Introduced test "6.1.35" to validate and detect contradicting remediation categories for the same product. Added traits and implementations to abstract remediation and vulnerability handling for easier extensibility across CSAF versions. Updated test infrastructure and presets to include the new validation logic.