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

@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: 8fb9e048-b135-47ab-bed2-9fe20a527c04

📥 Commits

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

📒 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)
🚧 Files skipped from review as they are similar to previous changes (2)
  • controller/agenticrun/results.go
  • controller/agenticrun/results_test.go

📝 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 both outcomes and preserve per-option diagnosis for action-required results.

Changes

Diagnosis gating

Layer / File(s) Summary
Gate and validate top-level diagnosis
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 preserve per-option diagnosis.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change to zero out top-level diagnosis when actionRequired is true.
Description check ✅ Passed The description directly explains the diagnosis behavior change, affected fields, and added tests.
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.

@xrajesh

xrajesh commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@thoraxe - needs rebase . PTAL

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2026
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>
@thoraxe
thoraxe force-pushed the OLS-3724-zero-out-top-level-diagnosis branch from fce248b to 81e85a5 Compare August 11, 2026 14:00
@thoraxe

thoraxe commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main — clean rebase, no conflicts. go test ./controller/agenticrun/... passes.

@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2026
@openshift-ci

openshift-ci Bot commented Aug 11, 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.

2 participants