Skip to content

CMP-3824: Added logic to cover 27967, 33782, 33711, 47346 from downstream -WIP#1071

Open
taimurhafeez wants to merge 5 commits intoComplianceAsCode:masterfrom
taimurhafeez:CMP-3824
Open

CMP-3824: Added logic to cover 27967, 33782, 33711, 47346 from downstream -WIP#1071
taimurhafeez wants to merge 5 commits intoComplianceAsCode:masterfrom
taimurhafeez:CMP-3824

Conversation

@taimurhafeez
Copy link
Collaborator

No description provided.

@openshift-ci
Copy link

openshift-ci bot commented Jan 27, 2026

Hi @taimurhafeez. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

@taimurhafeez taimurhafeez changed the title Added logic to cover 27967, 33782, 33711, 47346 from downstream CMP-3824: Added logic to cover 27967, 33782, 33711, 47346 from downstream Jan 27, 2026
@openshift-ci-robot
Copy link
Collaborator

@taimurhafeez: This pull request references CMP-3824 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

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 openshift-eng/jira-lifecycle-plugin repository.

@taimurhafeez taimurhafeez changed the title CMP-3824: Added logic to cover 27967, 33782, 33711, 47346 from downstream CMP-3824: Added logic to cover 27967, 33782, 33711, 47346 from downstream -WIP Jan 27, 2026
@taimurhafeez taimurhafeez marked this pull request as ready for review February 6, 2026 11:33
@openshift-ci openshift-ci bot requested review from jhrozek and rhmdnd February 6, 2026 11:33
@openshift-ci
Copy link

openshift-ci bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: taimurhafeez

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Feb 6, 2026
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1071-a740d5362a529a7316c683e2bcabe2765d2655b1

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1071-a8c3cf4c57dd6fb0d0e14bc501627dc7fb3c0913

@taimurhafeez
Copy link
Collaborator Author

/test e2e-aws-serial-arm

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1071-c360aca9a9e80e8c09a443e677b1e4ddf743d931

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1071-ef10ef564bc60531d3b83f9a33cd2927e9399fcb

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

Some comments inline. Thanks!

if err != nil {
t.Fatal(err)
// If it's not NON-COMPLIANT, check if it's COMPLIANT (all rules already compliant)
err2 := f.WaitForSuiteScansStatus(f.OperatorNamespace, suiteName, compv1alpha1.PhaseDone, compv1alpha1.ResultCompliant)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we need that PR that adds multiple results to the WaitForSuiteScansStatus do avoid the double loop.

@Anna-Koudelkova is adding that in another testing PR, and I think you are too. I wonder if we should just pull that out so we can merge that and then rebase.

Otherwise, in the worst case we wait the full time out for a compliance result.

// This allows the test to work regardless of which rules are non-compliant in the environment
remediationList := &compv1alpha1.ComplianceRemediationList{}
listOpts := client.ListOptions{
Namespace: f.OperatorNamespace,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could add additional filtering here to only get remediations for the suite in question, but not a real big deal since this is serial and there should only be one suite running at a time.

listOpts := client.ListOptions{
  Namespace: f.OperatorNamespace,
  LabelSelector: labels.SelectorFromSet(map[string]string{compv1alpha1.SuiteLabel: suiteName}),
}

Completely up to you, it shouldn't affect the test.

t.Fatal(err)
}
appliedRemediations = append(appliedRemediations, updatedRem)
log.Printf("✓ Remediation %d/%d applied successfully: %s\n", i+1, len(ourRemediations), rem.Name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't usually put emojis in test logging. Could refactor this out.

if checkResult.Status != compv1alpha1.CheckResultPass {
t.Fatalf("Expected check %s to PASS after remediation, got %s", checkName, checkResult.Status)
}
log.Printf("✓ Check %s is PASS\n", checkName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar comment here.

if mc.Name == rem.GetMcName() {
return false, nil

for i, rem := range appliedRemediations {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cleaning up the machine configs pools is required for node remediations, but what about any rules that are using API server remediations?

Are we ensuring the remediations we're applying are only using machine configs? I'm wondering if we need to implement something to make sure API server remediations also get unapplied before the next test case runs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually - looking at the tailored profile, we're only including three RHCOS4 rules, which should be fine for this since those have to use machine configs for remediation.

Rationale: "Test file-based remediation",
},
{
// Issue 47346: Array value remediation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Irrelevant test ID?

Rationale: "Test array value remediation with multiple NTP servers",
},
{
// Issue 27967: Different remediation type (audit rules)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Irrelevant test ID?

t.Fatal(err)
}

// Issue 33711: Verify ComplianceRemediation shows "Applied" status
Copy link
Collaborator

Choose a reason for hiding this comment

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

Irrelevant test ID?

if err != nil {
t.Fatal(err)
}
// Issue 33711: Verify all checks pass after remediation (Applied → PASS transition)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Irrelevant test ID?

@openshift-ci
Copy link

openshift-ci bot commented Mar 5, 2026

@taimurhafeez: The following tests 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/e2e-rosa ef10ef5 link true /test e2e-rosa
ci/prow/e2e-aws-parallel ef10ef5 link true /test e2e-aws-parallel

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants