ROX-35107: Add verify-pq-crypto-policies#105
Conversation
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tasks/verify-crypto-policies-task.yaml`:
- Around line 33-34: The grep command checking for `EXPECTED_GROUP` in
`CONFIG_FILE` matches the pattern anywhere in the file, including in
commented-out lines, causing false positives when ML-KEM is disabled but present
as a comment. Modify the grep command to exclude lines that start with optional
whitespace followed by a hash symbol to ensure only active configuration lines
are matched. This can be done by piping the grep output through an additional
grep filter with the -v flag to remove comment lines, or by using a more
specific pattern that only captures enabled configuration entries.
- Around line 33-41: The current logic treats file-not-found and
content-not-found as the same failure case. When the CONFIG_FILE is missing or
unreadable, grep exits immediately due to set -e, and cat may also fail before
reaching your explicit FAIL messages, reducing debuggability. Add an explicit
check using test -f and test -r (or similar) to verify that CONFIG_FILE exists
and is readable before attempting the grep command. Structure the logic to
handle three distinct cases: file missing/unreadable (with appropriate error
message), file exists but EXPECTED_GROUP not found (current FAIL message), and
file exists with EXPECTED_GROUP found (current PASS message). This ensures each
failure mode produces clear, distinct diagnostic output.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 95fb4824-89a6-460b-a1cf-0fd043ce228b
📒 Files selected for processing (1)
tasks/verify-crypto-policies-task.yaml
msugakov
left a comment
There was a problem hiding this comment.
Looks good!
Please make sure you test that it works as expected in the pipeline. Would be nice if you could share a link.
|
@msugakov here's a run of the pipeline from the Collector repo: https://konflux-ui.apps.stone-prd-rh01.pg1f.p1.openshiftapps.com/ns/rh-acs-tenant/applications/acs/taskruns/collector-on-push-9gmfj-verify-pq-crypto-policies/ |
This PR extracts the
verify-crypto-policiesfrom stackrox/collector#3463 so that it can be reused across stackrox repos. See that PR for details.