GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(ci): fail log checks when grep errors by vikin91 · Pull Request #24038 · stackrox/stackrox

Conversation

@vikin91

@vikin91 vikin91 commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Description

An error in the allowlist grep can leave the blocklist grep with no input. The checker treats that result as clean logs and exits 0. Invalid blocklist expressions and missing input logs can also pass silently.

Inspect both pipeline exit statuses and return 2 for scan errors. Keep exit 0 for clean logs and exit 1 for suspicious logs. pipefail alone is insufficient: the downstream no-match status can mask an upstream error.

Merge after #24037, which corrects the existing malformed pattern. This branch is based on master and changes only the checker.

User-facing documentation

  1. CHANGELOG.md is updated OR update is not needed
  2. documentation PR is created and is linked above OR is not needed

Testing and quality

  1. the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  2. CI results are inspected

Automated testing

  1. added unit tests
  2. added e2e tests
  3. added regression tests
  4. added compatibility tests
  5. modified existing tests

How I validated my change

  • CI - will need fix(ci): escape parentheses in HTTP log exceptions #24037 to pass!
  • Toy example:

From the repository root, in Bash or Zsh (GNU grep required; on macOS, install Homebrew grep):

# master branch - 'fatal' log line triggers the check

printf 'harmless\n' > /tmp/allowlist.txt
printf 'fatal: database is corrupted\n' >> /tmp/example.log
ALLOWLIST_FILE=/tmp/allowlist.txt bash scripts/ci/logcheck/check.sh /tmp/example.log; echo "exit=$?"
fatal: database is corrupted

/tmp/example.log:fatal: database is corrupted
/tmp/example.log:fatal: database is corrupted
/tmp/example.log:fatal: database is corrupted
exit=1

# now prepend a corrupted entry to allowlist.txt - the `fatal` log is ignored and check passes

$ printf '(\n' > /tmp/allowlist.txt
$ printf 'harmless\n' >> /tmp/allowlist.txt
$ printf 'fatal: database is corrupted\n' >> /tmp/example.log
$ ALLOWLIST_FILE=/tmp/allowlist.txt bash scripts/ci/logcheck/check.sh /tmp/example.log; echo "exit=$?"

ggrep: missing closing parenthesis
exit=0

# on this branch

$ printf '(\n' > /tmp/allowlist.txt
$ printf 'harmless\n' >> /tmp/allowlist.txt
$ printf 'fatal: database is corrupted\n' >> /tmp/example.log
$ ALLOWLIST_FILE=/tmp/allowlist.txt bash scripts/ci/logcheck/check.sh /tmp/example.log; echo "exit=$?"

ggrep: missing closing parenthesis
exit=2

AI-Assisted: Codex, implementation, local validation, and PR description.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vikin91
fix(ci): fail log checks when grep errors
ffb99da
An allowlist grep error can leave the blocklist grep with no input,
which the checker treats as clean logs. Inspect both pipeline statuses
and return exit 2 for regex or input-file errors, while preserving the
existing clean-log and suspicious-log results.

AI-Assisted: Codex, implementation and local validation.
@vikin91 vikin91 added the ai-assisted label Nov 12, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress label Nov 12, 2026
@openshift-ci

openshift-ci Bot commented Nov 12, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Log checks now distinguish clean scans, detected blocked patterns, and scan errors through separate exit statuses. Errors from either scanning stage are reported as scan failures, while a clean scan remains distinct from a scan that finds a blocked pattern. This makes CI log-check results clearer and helps avoid confusing scanning problems with log findings.

The log-check script now documents exit statuses for clean scans, offending patterns, and scan errors. It checks both grep statuses and handles scan errors separately from clean scans.

Changes: Log scan

Layer / File(s) Summary
Document and handle scan statuses
scripts/ci/logcheck/check.sh
The usage comment documents statuses 0, 1, and 2. The scan pipeline checks both grep statuses and exits with 2 if either indicates a scan error. The outer failure branch propagates statuses other than 1; status 1 leads to the clean exit.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · up to ffb99

The change makes the CI log checker fail on grep or input errors instead of treating them as clean logs. Normal clean and suspicious results are unchanged. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(ci): fail log checks when grep errors" matches the main change. The PR updates scripts/ci/logcheck/check.sh so that grep failures in either pipeline stage exit with status 2 instead of …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description explains the problem (an allowlist grep error can leave the blocklist grep with no input, so the checker exits 0), the fix (inspect both pipeline exit statuses and return 2 for scan er…
Full details: Title check

Explanation

The title "fix(ci): fail log checks when grep errors" matches the main change. The PR updates scripts/ci/logcheck/check.sh so that grep failures in either pipeline stage exit with status 2 instead of being treated as clean logs. The title is short, specific, and states the primary fix.

Full details: Description check

Explanation

The description explains the problem (an allowlist grep error can leave the blocklist grep with no input, so the checker exits 0), the fix (inspect both pipeline exit statuses and return 2 for scan errors), the merge dependency on #24037, and gives a reproducible local validation example with before and after output. The template's required sections are present. Several template checkboxes are unchecked: CI results were not marked as inspected, and no unit, e2e, regression, compatibility, or modified tests are marked. The author says CI depends on #24037, and the template allows skipping tests with an explanation. The description does not clearly explain why no automated test was added for a shell checker, so this is a minor gap.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: bf36916f-0e44-47ae-a3f5-a518d904b070
Commits

Reviewing files that changed from the base of the PR and between 34e955b and ffb99da.

Files selected for processing: 1

  • scripts/ci/logcheck/check.sh

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.86%. Comparing base (2378155) to head (ffb99da).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #24038      +/-   ##
==========================================
+ Coverage   52.69%   52.86%   +0.16%     
==========================================
  Files        2815     2755      -60     
  Lines      177457   175277    -2180     
==========================================
- Hits        93512    92656     -856     
+ Misses      75770    74534    -1236     
+ Partials     8175     8087      -88     
Flag Coverage Δ
go-unit-tests 52.86% <ø> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit ffb99da. To use with deploy scripts:

export MAIN_IMAGE_TAG=5.1.x-560-gffb99da014
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vikin91
vikin91 marked this pull request as ready for review November 12, 2026 12:45
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress label Nov 12, 2026
vjwilson
vjwilson approved these changes Nov 12, 2026
View reviewed changes

@vjwilson vjwilson left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

/lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vikin91
vikin91 enabled auto-merge (squash) November 12, 2026 14:33
@openshift-ci

openshift-ci Bot commented Nov 12, 2026

Copy link
Copy Markdown

@vikin91: 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/gke-qa-e2e-tests ffb99da link false /test gke-qa-e2e-tests
ci/prow/ocp-4-12-nongroovy-e2e-tests ffb99da link false /test ocp-4-12-nongroovy-e2e-tests
ci/prow/ocp-next-candidate-nongroovy-e2e-tests ffb99da link false /test ocp-next-candidate-nongroovy-e2e-tests
ci/prow/ocp-4-22-nongroovy-e2e-tests ffb99da link false /test ocp-4-22-nongroovy-e2e-tests
ci/prow/ocp-4-12-qa-e2e-tests ffb99da link false /test ocp-4-12-qa-e2e-tests
ci/prow/ocp-next-candidate-qa-e2e-tests ffb99da link false /test ocp-next-candidate-qa-e2e-tests
ci/prow/gke-ui-e2e-tests ffb99da link true /test gke-ui-e2e-tests
ci/prow/ocp-4-22-qa-e2e-tests ffb99da link false /test ocp-4-22-qa-e2e-tests

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

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

Reviewers

@vjwilson vjwilson vjwilson approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ai-assisted

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@vikin91 @vjwilson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.