← Back to Pull requests

ROX-37502: Move remediation tests to new remediation suite #1464

Merged
redhat-chai-bot merged 3 files (434 lines) on Oct 14, 2026 12:08 UTC
View on GitHub
redhat-chai-bot redhat-chai-bot commented on Oct 09, 2026 02:27 UTC
Author

Summary

Moves 3 remediation tests from the parallel e2e suite to a new dedicated remediation functional suite:

  • TestApplyGenericRemediation

  • TestPatchGenericRemediation

  • TestGenericRemediationFailsWithUnknownType
  • Details

  • Creates the new tests/e2e/remediation/ suite with boilerplate modeled after existing functional suites

  • Pure test moves, no refactoring

  • Part of ROX-37502: dissolving the parallel e2e suite into dedicated functional suites

  • Build verified: go build and go vet pass for both packages
  • ---
    AI-generated. Review for accuracy.

    @rhmdnd requested from Slack

    Diff: 434 lines (+243 / -191) across 3 files Reviewer: rhmdnd Review duration: 7781m
    All Vouch review confidence checks passed
    Residual risk 0.13 = Change Risk (0.47) × (1 − Review Confidence (0.73)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 434 lines diff across 3 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.50 · 5 substantive comment(s)
    0.50
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    73%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.363
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    14 items
    openshift-ci-robot openshift-ci-robot commented on Oct 09, 2026 02:27 UTC
    Contributor

    @redhat-chai-bot: This pull request references ROX-37502 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 "5.1.0" version, but no target version was set.

    <details>

    In response to this:

    >## Summary

    >Moves 3 remediation tests from the parallel e2e suite to a new dedicated remediation functional suite:

    >- TestApplyGenericRemediation
    >- TestPatchGenericRemediation
    >- TestGenericRemediationFailsWithUnknownType
    >## Details

    >- Creates the new tests/e2e/remediation/ suite with boilerplate modeled after existing functional suites

    >- Pure test moves, no refactoring
    >- Part of ROX-37502: dissolving the parallel e2e suite into dedicated functional suites
    >- Build verified: go build and go vet pass for both packages
    >---

    >AI-generated. Review for accuracy.
    >@rhmdnd requested from Slack

    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.
    </details>

    openshift-ci[bot] openshift-ci[bot] commented on Oct 09, 2026 02:27 UTC
    Bot

    Hi @redhat-chai-bot. 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.

    >[!TIP]
    >We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

    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.
    </details>

    github-actions[bot] github-actions[bot] commented on Oct 09, 2026 02:42 UTC
    Bot

    :robot: To deploy this PR, run the following command:

    make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1464-a1f3474a93a56c6ba4453d9e50c7b3ed48e023ff
    

    rhmdnd rhmdnd commented on code on Oct 13, 2026 13:40 UTC
    Code Review
    tests/e2e/remediation/main_test.go:1
    @@ -0,0 +1,238 @@
    +package remediation_e2e
    +
    +import (
    +	"context"
    +	"fmt"
    +	"log"
    +	"os"
    +	"testing"
    +
    +	compv1alpha1 "github.com/ComplianceAsCode/compliance-operator/pkg/apis/compliance/v1alpha1"
    +	"github.com/ComplianceAsCode/compliance-operator/tests/e2e/framework"
    +	corev1 "k8s.io/api/core/v1"
    +	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    +	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
    +	"k8s.io/apimachinery/pkg/types"
    +)
    +
    +var brokenContentImagePath string
    +var contentImagePath string
    +
    +func TestMain(m *testing.M) {

    Taking this approach means we need another Makefile target. It also means we need another job in openshift/release to run this suite conditionally based on the relevant code being changed.

    The openshift/release change will need to land before we can land this PR to ensure these tests are running.

    rhmdnd rhmdnd requested changes on Oct 13, 2026 13:40 UTC
    Changes Requested Reviewer

    Requested changes.

    redhat-chai-bot redhat-chai-bot commented on code on Oct 13, 2026 13:50 UTC
    Code Review
    tests/e2e/remediation/main_test.go:1
    @@ -0,0 +1,238 @@
    +package remediation_e2e
    +
    +import (
    +	"context"
    +	"fmt"
    +	"log"
    +	"os"
    +	"testing"
    +
    +	compv1alpha1 "github.com/ComplianceAsCode/compliance-operator/pkg/apis/compliance/v1alpha1"
    +	"github.com/ComplianceAsCode/compliance-operator/tests/e2e/framework"
    +	corev1 "k8s.io/api/core/v1"
    +	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    +	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
    +	"k8s.io/apimachinery/pkg/types"
    +)
    +
    +var brokenContentImagePath string
    +var contentImagePath string
    +
    +func TestMain(m *testing.M) {

    Good call — I've added the e2e-remediation Makefile target in this PR (following the same pattern as e2e-deployment, e2e-scan-config, etc.) and also added it to the main e2e target.

    For the openshift/release job configuration with run_if_changed, I've filed ROX-37544 to track that work. Agreed that the openshift/release change needs to land before this PR can merge.

    ---
    AI-generated. Review for accuracy.

    github-actions[bot] github-actions[bot] commented on Oct 13, 2026 14:01 UTC
    Bot

    :robot: To deploy this PR, run the following command:

    make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1464-f19f5286d8473a98ea083c735c7d490bf227c997
    

    github-actions[bot] github-actions[bot] commented on Oct 13, 2026 20:43 UTC
    Bot

    :robot: To deploy this PR, run the following command:

    make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1464-9ff2f50e4b7e67a779b2c7c3c76e7cf2c58b92be
    

    redhat-chai-bot redhat-chai-bot commented on Oct 13, 2026 21:08 UTC
    Author

    /retest-required

    redhat-chai-bot redhat-chai-bot commented on Oct 13, 2026 23:03 UTC
    Author

    /retest-required

    redhat-chai-bot redhat-chai-bot commented on Oct 14, 2026 02:17 UTC
    Author

    /retest-required

    rhmdnd rhmdnd approved these changes on Oct 14, 2026 12:08 UTC
    Approved Reviewer

    /lgtm

    openshift-ci[bot] openshift-ci[bot] commented on Oct 14, 2026 12:08 UTC
    Bot

    [APPROVALNOTIFIER] This PR is APPROVED

    This pull-request has been approved by: <a href="https://github.com/ComplianceAsCode/compliance-operator/pull/1464#" title="Author self-approved">redhat-chai-bot</a>, <a href="https://github.com/ComplianceAsCode/compliance-operator/pull/1464#pullrequestreview-5517613579" title="Approved">rhmdnd</a>

    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:

  • ~~OWNERS~~ [rhmdnd]
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":[]} -->

    Reviewers
    Assignees
    redhat-chai-bot redhat-chai-bot
    Labels
    risk: low confidence: 73.4% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47.3% (MEDIUM) · Higher = larger blast radius
    47.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 73.4% · Lower = rushed or shallow review
    73.4%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 12.6% · Safe to merge
    12.6%