Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CSAF 2.1 validator implementations for test cases 6.1.57 and 6.1.58 by introducing a reusable product-tree traversal helper that enumerates all root-to-leaf paths, and wiring the new validations into the validations module.
Changes:
- Added
ProductTreeTrait::collect_leaf_paths()(and recursive helper onBranchTrait) to depth-first collect root→leaf branch paths plus JSON instance paths. - Implemented validations for 6.1.57 (stacked branch categories) and 6.1.58 (product_version + product_version_range in same path), including unit tests.
- Extended
CategoryOfTheBranchwithHashderivation and aDisplayimpl to support hashing and readable error messages.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
csaf-rs/src/validations/test_6_1_57.rs |
New validation for stacked branch categories using collected leaf paths + associated tests. |
csaf-rs/src/validations/test_6_1_58.rs |
New validation preventing product_version and product_version_range in the same path + associated tests. |
csaf-rs/src/validations/mod.rs |
Exposes the new validation modules. |
csaf-rs/src/csaf_traits.rs |
Adds leaf-path collection traversal, plus Hash/Display on CategoryOfTheBranch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Contributor
Author
|
Abandoned after merge fail. Continued on #508 |
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.
Resolves #486 #485
This PR:
Their is some functional overlap between visit_all_branches and collect_all_leaves, and this could be generalized into a generic tree visitor with a pre-visit and post-visit callback. We should consider that if more similar functionality of the product tree becomes necessary, but IMO it would be overengineered for now.