Skip to content

Fix cve-fix version and image detection#2443

Open
dfarrell07 wants to merge 1 commit into
submariner-io:develfrom
dfarrell07:fix-state-expiring-ignores
Open

Fix cve-fix version and image detection#2443
dfarrell07 wants to merge 1 commit into
submariner-io:develfrom
dfarrell07:fix-state-expiring-ignores

Conversation

@dfarrell07

@dfarrell07 dfarrell07 commented May 20, 2026

Copy link
Copy Markdown
Member

The skill inferred the build image from branch names, but
the source of truth is BASE_BRANCH in each repo's Makefile.
This caused stdlib, breaking-change, and version checks to
use the wrong Go version.

Build image: read BASE_BRANCH from Makefile; unset leaked
SHIPYARD_TAG before child make build/unit.

stdlib: use build image compiler to pick fix version in
the right minor stream; set GOTOOLCHAIN=auto.

Packages: allow Go directive bumps when build image
satisfies them; scope K8s check to root go.mod; use >=
comparison (version_gte) for verification and pre-update;
skip commit for transitive fixes; wrap long Fixes lines.

Ignores: --no-fix flag for auto-expiring entries
(fix-state: not-fixed).

Review agent: one call per package; extract real
NEEDS_REVIEW reason; UNRESOLVED for version upgrades;
don't roll back validated Go bumps.

Self-fix: git worktree when fixing the repo that contains
the CVE scripts.

Summary by CodeRabbit

  • New Features

    • Added a --no-fix option for CVE ignores so they can expire automatically when a fix is later published.
    • Enhanced CVE fixing workflows with improved Go toolchain/version selection, including stdlib handling.
  • Bug Fixes

    • Strengthened CVE persistence verification using semver-based checks across modules.
    • Improved CVE detection/branching behavior (including worktree-based “self-fix”) and prevented build/tag settings from impacting scanning builds.
  • Documentation

    • Updated CVE review instructions for “no fix available” vs permanent ignore vs UNRESOLVED scenarios.
  • Tests

    • Added unit tests for version comparison behavior.

@submariner-bot

Copy link
Copy Markdown

🤖 Created branch: z_pr2443/dfarrell07/fix-state-expiring-ignores

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dfarrell07, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: edd408d4-8009-444c-88a6-5bccdbf6ab06

📥 Commits

Reviewing files that changed from the base of the PR and between bad9688 and 992b8db.

📒 Files selected for processing (10)
  • .agents/workflows/cve-fix.md
  • scripts/cve/detect.sh
  • scripts/cve/fix-all.sh
  • scripts/cve/fix-package.sh
  • scripts/cve/fix-stdlib.sh
  • scripts/cve/ignore.sh
  • scripts/cve/lib.sh
  • scripts/cve/review-prompt.md
  • scripts/cve/scan.sh
  • scripts/cve/test-lib.sh

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds optional auto-expiring CVE ignores, self-fix worktree support, version-aware stdlib and package handling, environment isolation for builds, and updated CVE review guidance.

Changes

CVE fix workflow updates

Layer / File(s) Summary
Ignore state support
scripts/cve/lib.sh, scripts/cve/ignore.sh, scripts/cve/review-prompt.md, .agents/workflows/cve-fix.md
Adds optional --no-fix handling, conditional fix-state: not-fixed entries, and guidance for temporary, permanent, and unresolved CVE outcomes.
Branch detection and worktree setup
scripts/cve/detect.sh, scripts/cve/fix-all.sh, scripts/cve/scan.sh
Derives SHIPYARD_TAG from repository metadata, supports self-fix worktrees, records and cleans up WORKTREE_DIR, and unsets SHIPYARD_TAG for build commands.
Stdlib and package fix flow
scripts/cve/fix-stdlib.sh, scripts/cve/fix-all.sh, scripts/cve/fix-package.sh, scripts/cve/lib.sh, scripts/cve/test-lib.sh
Propagates available fix versions, validates Go and package versions semver-wise, reports specific review reasons, adjusts commit handling, and tests version_gte.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: skitt, sridhargaddam, mkolesnik, tpantelis, oats87


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Actionable Comments Resolved ❌ Error FAIL: The GOTOOLCHAIN review comment is still reflected in code (!= *auto* remains). citeturn1view0turn3view0 Update scripts/cve/fix-stdlib.sh to use [[ -z "${GOTOOLCHAIN:-}" ]] before exporting GOTOOLCHAIN=auto, preserving explicit caller settings.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and matches the main change: improved cve-fix version and build image detection.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dfarrell07
dfarrell07 force-pushed the fix-state-expiring-ignores branch from facbc6d to 4ca5179 Compare May 20, 2026 17:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@scripts/cve/review-prompt.md`:
- Around line 31-35: Run markdownlint on the changed markdown file
(scripts/cve/review-prompt.md) and fix any lint issues before committing;
specifically ensure line lengths, list formatting, code span/backtick usage, and
emphasis conventions comply with the project's markdownlint rules. Re-run
markdownlint until it reports no errors, then re-stage the file and update the
PR; reference the content that mentions CVE_SCRIPTS, ignore.sh, and STATE_FILE
while making the fixes to avoid altering meaning.
🪄 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: Pro

Run ID: c784d464-67ee-473d-803b-9a21a0d4c6c9

📥 Commits

Reviewing files that changed from the base of the PR and between 1077a2e and 4ca5179.

📒 Files selected for processing (4)
  • .agents/workflows/cve-fix.md
  • scripts/cve/ignore.sh
  • scripts/cve/lib.sh
  • scripts/cve/review-prompt.md

Comment thread scripts/cve/review-prompt.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@scripts/cve/fix-stdlib.sh`:
- Around line 34-35: The script currently forces GOTOOLCHAIN=auto even when the
caller explicitly set GOTOOLCHAIN (e.g., local); change the condition so we only
set GOTOOLCHAIN=auto when it is unset. Replace the test [[ "${GOTOOLCHAIN:-}" !=
*auto* ]] with an explicit unset check (e.g., [[ -z "${GOTOOLCHAIN:-}" ]]) while
keeping the existing OLD_MINOR==NEW_MINOR guard so that only when OLD_MINOR and
NEW_MINOR match and GOTOOLCHAIN is not set do we export GOTOOLCHAIN=auto.
🪄 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: Pro

Run ID: 5ceaeef5-5f71-4101-958e-add487377300

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca5179 and 220c299.

📒 Files selected for processing (1)
  • scripts/cve/fix-stdlib.sh

Comment thread scripts/cve/fix-stdlib.sh Outdated
@dfarrell07
dfarrell07 marked this pull request as draft May 20, 2026 22:59
@dfarrell07 dfarrell07 changed the title Add self-expiring grype ignore entries for no-fix-available CVEs WIP: cve-fix skill improvements May 21, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further
activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Jun 16, 2026
@github-actions github-actions Bot closed this Jun 30, 2026
@submariner-bot

Copy link
Copy Markdown

🤖 Closed branches: [z_pr2443/dfarrell07/fix-state-expiring-ignores]

@dfarrell07 dfarrell07 reopened this Jul 8, 2026
@submariner-bot

Copy link
Copy Markdown

🤖 Created branch: z_pr2443/dfarrell07/fix-state-expiring-ignores

@dfarrell07
dfarrell07 force-pushed the fix-state-expiring-ignores branch from 8dfbdb2 to bad9688 Compare July 8, 2026 20:09
@dfarrell07 dfarrell07 changed the title WIP: cve-fix skill improvements Fix cve-fix version and image detection Jul 8, 2026
@dfarrell07 dfarrell07 removed the stale label Jul 8, 2026
@dfarrell07 dfarrell07 moved this to In Review in Submariner Jul 8, 2026
@dfarrell07
dfarrell07 marked this pull request as ready for review July 8, 2026 20:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
scripts/cve/fix-stdlib.sh (1)

63-65: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Don't override an explicitly configured GOTOOLCHAIN value.

This condition matches explicit values like GOTOOLCHAIN=local, forcing auto even when the caller intentionally set a different mode. Per the official Go documentation, GOTOOLCHAIN=local means the go command always runs the bundled toolchain—overriding this silently breaks offline and reproducible build environments. Additionally, the override at line 63 causes the host Go check at line 70 to be skipped (since auto matches *auto*), masking insufficient host Go versions.

This was previously flagged in an earlier review commit and remains unaddressed.

🔧 Proposed fix
 # Compiler already has the fix version — bump go.mod to match
-if [[ "${GOTOOLCHAIN:-}" != *auto* ]]; then
+if [[ -z "${GOTOOLCHAIN:-}" ]]; then
   export GOTOOLCHAIN=auto
 fi
🤖 Prompt for 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.

In `@scripts/cve/fix-stdlib.sh` around lines 63 - 65, The GOTOOLCHAIN handling in
the stdlib fix script is overriding explicit caller configuration, especially
GOTOOLCHAIN=local, by forcing auto. Update the check around the GOTOOLCHAIN
export so it only sets auto when GOTOOLCHAIN is unset, and preserves any
explicitly provided value in the script’s main flow before the host Go version
check. Use the existing GOTOOLCHAIN guard logic near the compiler/version setup
to keep the host Go check effective.
🤖 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.

Duplicate comments:
In `@scripts/cve/fix-stdlib.sh`:
- Around line 63-65: The GOTOOLCHAIN handling in the stdlib fix script is
overriding explicit caller configuration, especially GOTOOLCHAIN=local, by
forcing auto. Update the check around the GOTOOLCHAIN export so it only sets
auto when GOTOOLCHAIN is unset, and preserves any explicitly provided value in
the script’s main flow before the host Go version check. Use the existing
GOTOOLCHAIN guard logic near the compiler/version setup to keep the host Go
check effective.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9722505b-a40f-46e6-a8b8-c89a59052616

📥 Commits

Reviewing files that changed from the base of the PR and between d6b8e08 and bad9688.

📒 Files selected for processing (10)
  • .agents/workflows/cve-fix.md
  • scripts/cve/detect.sh
  • scripts/cve/fix-all.sh
  • scripts/cve/fix-package.sh
  • scripts/cve/fix-stdlib.sh
  • scripts/cve/ignore.sh
  • scripts/cve/lib.sh
  • scripts/cve/review-prompt.md
  • scripts/cve/scan.sh
  • scripts/cve/test-lib.sh
✅ Files skipped from review due to trivial changes (2)
  • .agents/workflows/cve-fix.md
  • scripts/cve/review-prompt.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/cve/ignore.sh

@dfarrell07
dfarrell07 force-pushed the fix-state-expiring-ignores branch from bad9688 to 3b153bb Compare July 23, 2026 19:36
The skill inferred the build image from branch names, but
the source of truth is BASE_BRANCH in each repo's Makefile.
This caused stdlib, breaking-change, and version checks to
use the wrong Go version.

Build image: read BASE_BRANCH from Makefile; unset leaked
SHIPYARD_TAG before child make build/unit.

stdlib: use build image compiler to pick fix version in
the right minor stream; set GOTOOLCHAIN=auto.

Packages: allow Go directive bumps when build image
satisfies them; scope K8s check to root go.mod; use >=
comparison (version_gte) for verification and pre-update;
skip commit for transitive fixes; wrap long Fixes lines.

Ignores: --no-fix flag for auto-expiring entries
(fix-state: not-fixed).

Review agent: one call per package; extract real
NEEDS_REVIEW reason; UNRESOLVED for version upgrades;
don't roll back validated Go bumps.

Self-fix: git worktree when fixing the repo that contains
the CVE scripts.

Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
@dfarrell07
dfarrell07 force-pushed the fix-state-expiring-ignores branch from eea6171 to 992b8db Compare July 23, 2026 19:55
@dfarrell07

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants