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

Make Rawhide CI Green #12065

Merged
merged 6 commits into from
Jun 28, 2024
Merged

Conversation

Mab879
Copy link
Member

@Mab879 Mab879 commented Jun 14, 2024

Description:

Use registry.fedoraproject.org/fedora:rawhide for rawhide test

Rationale:

It should be updated a bit more often DockerHub, hopefully.

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

@Mab879 Mab879 changed the title Use registry.fedoraproject.org/fedora:rawhide for rawhide test Make Rawhide CI Green Jun 14, 2024
@Mab879 Mab879 force-pushed the use_fedora_reg_rawhide branch 2 times, most recently from 4bdac97 to 05b70ca Compare June 14, 2024 03:58
Copy link

github-actions bot commented Jun 14, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12065
This image was built from commit: 15e7703

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12065

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12065 make deploy-local

@Mab879 Mab879 force-pushed the use_fedora_reg_rawhide branch 2 times, most recently from 54f46c4 to 11a4dee Compare June 14, 2024 04:19
@Mab879 Mab879 marked this pull request as draft June 14, 2024 04:45
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Jun 14, 2024
@jan-cerny
Copy link
Collaborator

Looking at the failing

    platform = ssg.build_yaml.Platform.from_text(
        "systemd and !yum and (ntp or chrony)", product_cpes)
    assert platform.get_remediation_conditional("bash") == "( rpm --quiet -q systemd && ( rpm --quiet -q chrony || rpm --quiet -q ntp ) && ! ( rpm --quiet -q yum ) )"

it's suspicious that the conditional is expected to have different ordering of operands than the expression

@Mab879
Copy link
Member Author

Mab879 commented Jun 21, 2024

@evgenyz Got any ideas on the CI failure that Jan mentioned above?

@jan-cerny
Copy link
Collaborator

I think the produced Bash and Ansible code should have the same order of operands as the platform expression. Therefore, the test should be reworked. Then, I assume it will start failing everywhere except Rawhide. It's unclear to me how to fix that. There probably is used a set or a dictionary somewhere where we should use a tuple or a list or other structure that preserves order of the elements. But I haven't found where is the place. I think it needs to be somewhere in the bundled "expressions" library.

@evgenyz
Copy link
Member

evgenyz commented Jun 27, 2024

I think that with introduction of new Python ssg/ext/boolean.py started to order elements of the expression differently. It might be not convenient, but technically these expressions are equal from boolean logic point of view.

We can either try and fix boolean.py or stop comparing expressions as strings.

@evgenyz
Copy link
Member

evgenyz commented Jun 27, 2024

I think the produced Bash and Ansible code should have the same order of operands as the platform expression.

Since we use normalization of boolean expressions we can't really depend on order (and even particular set of elements) of the initial expression.

@evgenyz
Copy link
Member

evgenyz commented Jun 27, 2024

or stop comparing expressions as strings.

There is an example of how one could test features of the expression rather than its string representation contents.

@Mab879 Mab879 marked this pull request as ready for review June 27, 2024 20:09
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Jun 27, 2024
@marcusburghardt marcusburghardt added the Test Suite Update in Test Suite. label Jun 28, 2024
Copy link

codeclimate bot commented Jun 28, 2024

Code Climate has analyzed commit 15e7703 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 59.4% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Jun 28, 2024
@jan-cerny jan-cerny added this to the 0.1.74 milestone Jun 28, 2024
@jan-cerny jan-cerny merged commit ba77d94 into ComplianceAsCode:master Jun 28, 2024
93 checks passed
@Mab879 Mab879 deleted the use_fedora_reg_rawhide branch June 28, 2024 18:28
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.

4 participants