feat: add test 6.1.24 for CSAF 2.1, refactor, add suppl test cases#424
Merged
feat: add test 6.1.24 for CSAF 2.1, refactor, add suppl test cases#424
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CSAF rule 6.1.24 (Multiple Definition in Involvements) coverage for CSAF 2.1 (and aligns CSAF 2.0), including supplementary cases and a refactor to better handle optional/malformed dates during validation.
Changes:
- Implement/refactor validation logic for 6.1.24 to treat missing dates as part of the uniqueness key and to surface malformed-date errors.
- Add new supplementary CSAF 2.0/2.1 JSON fixtures for optional date, malformed date, and multi-error combinations.
- Regenerate CSAF 2.0/2.1 test harness code to include the new
sXXcases; extend datetime type to support hashing and convenient error conversion.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| type-generator/assets/tests/csaf_2.1/testcases.json | Registers new 6.1.24 supplementary cases for CSAF 2.1. |
| type-generator/assets/tests/csaf_2.1/mandatory/csaf-rs_csaf-csaf_2_1-6-1-24-s01.json | New CSAF 2.1 fixture: duplicate involvements with missing date. |
| type-generator/assets/tests/csaf_2.1/mandatory/csaf-rs_csaf-csaf_2_1-6-1-24-s02.json | New CSAF 2.1 fixture: malformed involvement date. |
| type-generator/assets/tests/csaf_2.1/mandatory/csaf-rs_csaf-csaf_2_1-6-1-24-s03.json | New CSAF 2.1 fixture: duplicates amid other non-duplicates. |
| type-generator/assets/tests/csaf_2.1/mandatory/csaf-rs_csaf-csaf_2_1-6-1-24-s04.json | New CSAF 2.1 fixture: multiple duplicate pairs. |
| type-generator/assets/tests/csaf_2.1/mandatory/csaf-rs_csaf-csaf_2_1-6-1-24-s11.json | New CSAF 2.1 fixture: same date, different party (valid). |
| type-generator/assets/tests/csaf_2.1/mandatory/csaf-rs_csaf-csaf_2_1-6-1-24-s12.json | New CSAF 2.1 fixture: different dates, same party (valid). |
| type-generator/assets/tests/csaf_2.1/mandatory/csaf-rs_csaf-csaf_2_1-6-1-24-s13.json | New CSAF 2.1 fixture: no involvements (valid). |
| type-generator/assets/tests/csaf_2.0/testcases.json | Registers new 6.1.24 supplementary cases for CSAF 2.0. |
| type-generator/assets/tests/csaf_2.0/mandatory/csaf-rs_csaf-csaf_2_0-6-1-24-s01.json | New CSAF 2.0 fixture: duplicate involvements with missing date. |
| type-generator/assets/tests/csaf_2.0/mandatory/csaf-rs_csaf-csaf_2_0-6-1-24-s02.json | New CSAF 2.0 fixture: malformed involvement date. |
| type-generator/assets/tests/csaf_2.0/mandatory/csaf-rs_csaf-csaf_2_0-6-1-24-s03.json | New CSAF 2.0 fixture: duplicates amid other non-duplicates. |
| type-generator/assets/tests/csaf_2.0/mandatory/csaf-rs_csaf-csaf_2_0-6-1-24-s04.json | New CSAF 2.0 fixture: multiple duplicate pairs. |
| type-generator/assets/tests/csaf_2.0/mandatory/csaf-rs_csaf-csaf_2_0-6-1-24-s11.json | New CSAF 2.0 fixture: same date, different party (valid). |
| type-generator/assets/tests/csaf_2.0/mandatory/csaf-rs_csaf-csaf_2_0-6-1-24-s12.json | New CSAF 2.0 fixture: different dates, same party (valid). |
| type-generator/assets/tests/csaf_2.0/mandatory/csaf-rs_csaf-csaf_2_0-6-1-24-s13.json | New CSAF 2.0 fixture: no involvements (valid). |
| csaf-rs/src/validations/test_6_1_24.rs | Refactors 6.1.24 validation to include missing-date tuples and convert malformed dates into ValidationErrors; updates unit tests accordingly. |
| csaf-rs/src/csaf2_1/testcases.generated.rs | Regenerated harness to execute new sXX 6.1.24 cases for CSAF 2.1. |
| csaf-rs/src/csaf2_0/testcases.generated.rs | Regenerated harness to execute new sXX 6.1.24 cases for CSAF 2.0. |
| csaf-rs/src/csaf/types/csaf_datetime.rs | Adds ValidCsafDateTime: Hash and a helper to convert datetime parse errors into ValidationError. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tziemek
reviewed
Feb 24, 2026
# Conflicts: # type-generator/assets/tests/csaf_2.0/testcases.json # type-generator/assets/tests/csaf_2.1/testcases.json
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tziemek
approved these changes
Mar 31, 2026
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 #357
This PR:
There an open request for clarification on what to do if the optional
datefield is missing: oasis-tcs/csaf#1310. You might want to keep this open until the questions there have been answered.