Skip to content

ocp-test-profiles: skip rules with no CI-tested profile instead of failing with division by 0 - #14924

Closed
Vincent056 wants to merge 1 commit into
ComplianceAsCode:masterfrom
Vincent056:fix-ocp-test-profiles-empty
Closed

ocp-test-profiles: skip rules with no CI-tested profile instead of failing with division by 0#14924
Vincent056 wants to merge 1 commit into
ComplianceAsCode:masterfrom
Vincent056:fix-ocp-test-profiles-empty

Conversation

@Vincent056

Copy link
Copy Markdown
Contributor

The 'Identify rules changed in PR and test them in OCP Prow' job aborts with division by 0 (error token is "(0)") whenever a changed rule is not selected by any profile that has a prow lane — ELIGIBLE_PROFILES is empty and the random selection does RANDOM % 0.

This currently fails on every PR that only touches rules in the CEL-based cis-vm-extension profile (no prow lane yet): #14917, #14918, #14919.

Fix: skip such rules; the job then reports only profiles it can actually test. Also fixes the two yamllint complaints on the touched file (brackets on the branches line, one trailing space) so the changed-file lint gate stays green.

🤖 Generated with Claude Code

…v-by-zero

When a changed rule is not selected by any profile that has a prow lane
(e.g. rules only in the CEL-based cis-vm-extension profile), ELIGIBLE_PROFILES is empty and 'RANDOM % 0' aborts the whole job with
'division by 0'. Seen on ComplianceAsCode#14917, ComplianceAsCode#14918 and ComplianceAsCode#14919.
Guard the selection so such rules are skipped; the job then reports only
profiles it can actually test. Also fix the two yamllint complaints on the
touched file (brackets, trailing space) so the changed-file lint gate
passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown

@Vincent056: 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-aws-openshift-node-compliance e1c1cb2 link true /test e2e-aws-openshift-node-compliance
ci/prow/e2e-aws-openshift-platform-compliance e1c1cb2 link true /test e2e-aws-openshift-platform-compliance

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.

@Vincent056 Vincent056 closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant