-
Notifications
You must be signed in to change notification settings - Fork 685
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
Removing unused variables from the datastream #11858
Conversation
Skipping CI for Draft Pull Request. |
🤖 A k8s content image for this PR is available at: Click here to see how to deploy itIf you alread have Compliance Operator deployed: Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: |
4e55df6
to
6a9e5cd
Compare
@Honny1 I have built the |
@jan-cerny |
Code Climate has analyzed commit c904b62 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 66.6% (50% is the threshold). This pull request will bring the total coverage in the repository to 59.4% (0.1% change). View more on Code Climate. |
/packit rebuild-failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the PR. I have checked the review hints. I have also compared the built data streams for RHEL 8 and 9 products. I haven't found any problem.
sub_el.get("idref").replace("xccdf_org.ssgproject.content_value_", "") | ||
) | ||
out_var_ids[ | ||
rule.get("id").replace("xccdf_org.ssgproject.content_rule_", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to extract this code to a variable
Description:
This PR removes unused variables in the datastream. It also fixes missing variables for thin data streams. The problem was caused by removing XCCDF groups without rules because the removed groups contained variables that were used in rules from other groups.
The problem can be replicated by building a thin ds for the
enable_fips_mode
rule.To solve this problem, an in-memory XCCDF benchmark is created that contains all the rules from which information is obtained about which rule uses which variable. This step slows down the build.
Review Hints:
Verify that the problem does not occur with a single rule:
For all thin ds, you can run a test from the test suite. (A validation test has been implemented for this problem)