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

Fix data stream component parsing #10411

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

jan-cerny
Copy link
Collaborator

SCAP source data streams can reference multiple check components usually OCIL, OVAL and CPE OVAL. This commit fixes the situation when there is both OVAL and CPE OVAL needed for an XCCDF Benchmark.

We improve the _find_all_component_contents and make it more generic and also refactor the code.

Fixes: #10408

SCAP source data streams can reference multiple check components
usually OCIL, OVAL and CPE OVAL. This commit fixes the situation
when there is both OVAL and CPE OVAL needed for an XCCDF Benchmark.

We improve the _find_all_component_contents and make it more generic
and also refactor the code.

Fixes: ComplianceAsCode#10408
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@ggbecker ggbecker self-assigned this Apr 3, 2023
Copy link
Member

@ggbecker ggbecker left a comment

Choose a reason for hiding this comment

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

Thank for this improvement. Now it loads correctly all the correspondent components even if there is the CPE OVAL content as well.

@ggbecker ggbecker added the Infrastructure Our content build system label Apr 3, 2023
@ggbecker ggbecker added this to the 0.1.68 milestone Apr 3, 2023
@ggbecker
Copy link
Member

ggbecker commented Apr 3, 2023

@jan-cerny do you know if we can do something about the codeclimate/diff-coverage — 7% (50% threshold) check. I don't know what to suggest here to make it green.

@jan-cerny
Copy link
Collaborator Author

@ggbecker We could mitigate it by writing concise unit test for the XMLElement class.

@ggbecker
Copy link
Member

ggbecker commented Apr 3, 2023

@ggbecker We could mitigate it by writing concise unit test for the XMLElement class.

Are you willing to create it in this PR? Otherwise it should be fine to merge as it is IMO.

@jan-cerny
Copy link
Collaborator Author

@ggbecker I will take a look and try to create some test

@jan-cerny
Copy link
Collaborator Author

I have dd a simple unit test for the XMLContent class

@codeclimate
Copy link

codeclimate bot commented Apr 3, 2023

Code Climate has analyzed commit e6dc679 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 85.7% (50% is the threshold).

This pull request will bring the total coverage in the repository to 52.4% (0.6% change).

View more on Code Climate.

@ggbecker
Copy link
Member

ggbecker commented Apr 3, 2023

I have dd a simple unit test for the XMLContent class

It's perfect. Thank you

@ggbecker ggbecker merged commit a198173 into ComplianceAsCode:master Apr 3, 2023
29 checks passed
@jan-cerny jan-cerny deleted the issue10408 branch April 4, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compare_ds tool is reporting that rules are not part of ssg-product-oval anymore
2 participants