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

Add support of derivatives to Automatus #11129

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

jan-cerny
Copy link
Collaborator

Description:

If a derivative data stream (eg. ssg-cs9-ds.xml) is tested, Automatus will now automatically infer which product this derivative is derived from.

Rationale:

Fixes: #10677

Review Hints:

  1. Build a product and its derivatives, for example: ./build_product rhel9 --derivatives
  2. Run test scenarios while passing the derivative data stream to Automatus, for example: ./tests/automatus.py rule --datastream build/ssg-cs9-ds.xml --remove-platforms --remove-machine-only --libvirt qemu:///system ssgts_rhel9 selinux_state
  3. verify that the automatus.py haven't traceback

Extract function `get_product_id` to reduce cognitive complexity
and allow easier extension.
If a derivative data stream (eg. ssg-cs9-ds.xml) is tested,
Automatus will now automatically infer which product this
derivative is derived from.

Fixes: ComplianceAsCode#10677
@jan-cerny jan-cerny added the Test Suite Update in Test Suite. label Sep 20, 2023
@jan-cerny jan-cerny added this to the 0.1.70 milestone Sep 20, 2023
@github-actions
Copy link

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@codeclimate
Copy link

codeclimate bot commented Sep 20, 2023

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

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

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

View more on Code Climate.

@jan-cerny
Copy link
Collaborator Author

/retest

@openshift-ci
Copy link

openshift-ci bot commented Sep 20, 2023

@jan-cerny: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images db3e7a1 link true /test images

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Mab879 Mab879 self-assigned this Sep 20, 2023
@Mab879
Copy link
Member

Mab879 commented Sep 20, 2023

/tests images

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

I can confirm that my reproducer in #10677 is fixed along with the provided example works.

Thanks for the fix!

@Mab879 Mab879 merged commit 59f9fa0 into ComplianceAsCode:master Sep 20, 2023
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Test Suite Update in Test Suite.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatus Template Mode Doesn't Support Derivatives
2 participants