Skip to content

feat: add test 6.1.24 for CSAF 2.1, refactor, add suppl test cases#424

Merged
peinjoh merged 6 commits intomainfrom
feat/357-6-1-24
Mar 31, 2026
Merged

feat: add test 6.1.24 for CSAF 2.1, refactor, add suppl test cases#424
peinjoh merged 6 commits intomainfrom
feat/357-6-1-24

Conversation

@peinjoh
Copy link
Copy Markdown
Contributor

@peinjoh peinjoh commented Feb 24, 2026

resolves #357

This PR:

  • improves code structure and handling of malformed dates
  • adds new test cases for:
    • handling the optional date field
    • handling of malformed date
    • various combinations of multiple errors, mix of collision / non-collision

There an open request for clarification on what to do if the optional date field is missing: oasis-tcs/csaf#1310. You might want to keep this open until the questions there have been answered.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sXX cases; 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.

Comment thread csaf-rs/src/validations/test_6_1_24.rs Outdated
Comment thread csaf-rs/src/validations/test_6_1_24.rs Outdated
Comment thread csaf-rs/src/validations/test_6_1_24.rs
# Conflicts:
#	type-generator/assets/tests/csaf_2.0/testcases.json
#	type-generator/assets/tests/csaf_2.1/testcases.json
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread csaf-rs/src/validations/test_6_1_24.rs Outdated
@peinjoh peinjoh merged commit ad8c7c4 into main Mar 31, 2026
21 checks passed
@peinjoh peinjoh deleted the feat/357-6-1-24 branch March 31, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement 6.1.24 Multiple Definition in Involvements for CSAF2.1

3 participants