Skip to content

OLS-3724 Zero out top-level diagnosis when actionRequired is true - #385

Open
thoraxe wants to merge 1 commit into
openshift:mainfrom
thoraxe:OLS-3724-zero-out-top-level-diagnosis
Open

OLS-3724 Zero out top-level diagnosis when actionRequired is true#385
thoraxe wants to merge 1 commit into
openshift:mainfrom
thoraxe:OLS-3724-zero-out-top-level-diagnosis

Conversation

@thoraxe

@thoraxe thoraxe commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When the analysis agent sets actionRequired=true, the top-level diagnosis field is now zeroed out in the AnalysisResult CR, even if the LLM populated it
  • The schema describes this constraint in text but doesn't enforce it structurally — this adds a server-side guard in createAnalysisResult
  • Per-option diagnosis fields are unaffected

Test plan

  • New test: TestCreateAnalysisResult_ZerosTopLevelDiagnosisWhenActionRequired — fully-populated diagnosis with actionRequired=true is zeroed
  • New test: TestCreateAnalysisResult_PreservesTopLevelDiagnosisWhenNoAction — diagnosis with actionRequired=false is preserved
  • Existing test TestCreateAnalysisResult_EmptyTopLevelDiagnosis still passes
  • make test passes

🤖 Generated with Claude Code

The analysis agent can populate the top-level diagnosis even when
actionRequired is true. The schema describes the constraint in text
but does not enforce it structurally. This adds a server-side guard
in createAnalysisResult so the top-level diagnosis is only written
to the AnalysisResult CR when actionRequired is false.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci
openshift-ci Bot requested review from joshuawilson and xrajesh July 27, 2026 12:56
@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign harche for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 834c447c-9084-4eb1-b83a-f99bc5a44de6

📥 Commits

Reviewing files that changed from the base of the PR and between f0c9524 and fce248b.

📒 Files selected for processing (2)
  • controller/agenticrun/results.go
  • controller/agenticrun/results_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift/lightspeed-agentic-sandbox (manual)

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Top-level diagnosis details are now omitted when an action is required.
    • Diagnosis information remains available when no action is needed.
    • Per-option diagnosis details continue to be preserved.

Walkthrough

createAnalysisResult now copies top-level diagnosis only when analysis does not require action. Tests verify that action-required results clear top-level diagnosis while preserving option-level diagnosis, and that no-action results retain the provided diagnosis.

Changes

Diagnosis gating

Layer / File(s) Summary
Gate top-level diagnosis and validate outcomes
controller/agenticrun/results.go, controller/agenticrun/results_test.go
createAnalysisResult excludes top-level diagnosis when action is required and preserves it otherwise; tests cover both outcomes and option-level diagnosis preservation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately states the main behavioral change: zeroing the top-level diagnosis when actionRequired is true.
Description check ✅ Passed The description matches the code and tests, describing the zeroing behavior, server-side guard, and unchanged per-option diagnosis.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown

@thoraxe: all tests passed!

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.

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