Skip to content
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

Implement converter for first recursive XML section: DocumentTracking #9

Closed
cgi1 opened this issue Dec 2, 2021 · 4 comments · Fixed by #21
Closed

Implement converter for first recursive XML section: DocumentTracking #9

cgi1 opened this issue Dec 2, 2021 · 4 comments · Fixed by #21

Comments

@cgi1
Copy link
Contributor

cgi1 commented Dec 2, 2021

As part of #3, we already integrated a 1-to-1 mapping between a flat XML element (DocumentPublisher).

Here, we would go into the first recursive conversion: DocumentTracking

This will provide us the code basis to go over other recursive sections in the further project one by one.

@cgi1
Copy link
Contributor Author

cgi1 commented Dec 3, 2021

Semantic Versioning is applied, which means we have one string containing all three levels (major.minor.patch).

The alternative is an unsigned integer versioning, which is a continously up counted number.

Some good examples can be found in Example 31: The first two are examples for semantic versioning and the last one is unsigned integer versioning.

@zpevma
Copy link
Contributor

zpevma commented Dec 10, 2021

The code now uses lxml's objectify. First implementation of DocumentTracking handler class can be found here.

Still need to implement this requirement:

type /$defs/version_t: If any element doesn't match the semantic versioning, replace the all elements of type /$defs/version_t with the corresponding integer version. For that, CVRF CSAF converter sorts the items of /document/tracking/revision_history by number ascending according to the rules of CVRF. Then, it replaces the value of number with the index number in the array (starting with 1). The value of /document/tracking/version is replaced by value of number of the corresponding revision item. The match must be calculated by the original values used in the CVRF document.

@cgi1
Copy link
Contributor Author

cgi1 commented Dec 10, 2021

huh... pretty extensive code already!

The general section handler as a basis looks good.

Then the first recursive implementation here provides a good guideline for the next structures.

After finishing the /$defs/version_t, @tschmidtb51 could take a look in between, as we only have the next meeting in January.

Thank you @sustefil and @zpevma!

@cgi1
Copy link
Contributor Author

cgi1 commented Jan 2, 2022

Happy new year everyone! 🥳

@zpevma and @sustefil, as a last step, finished the integration of version_t here - with comments from @sthagen (thanks for the collaboration!).

@tschmidtb51 / @pixelkunst-net: Lets check this pull request tomorrow as part of our weekly call (#21).

@sustefil sustefil linked a pull request Jan 7, 2022 that will close this issue
@cgi1 cgi1 closed this as completed in #21 Jan 10, 2022
@sustefil sustefil moved this from In progress to Done in cvrf2csaf_poc_implementation Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants