Skip to content

OU-1409: Match new ols routing and names#1052

Open
jgbernalp wants to merge 1 commit into
openshift:mainfrom
jgbernalp:match-new-ols-routing-and-names
Open

OU-1409: Match new ols routing and names#1052
jgbernalp wants to merge 1 commit into
openshift:mainfrom
jgbernalp:match-new-ols-routing-and-names

Conversation

@jgbernalp

@jgbernalp jgbernalp commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

requires #1044 to be merged first

Summary by CodeRabbit

  • New Features

    • “View AI Investigation” now opens matching Agentic Run resources for alerts.
    • Alert matching supports consistent fingerprints across labels and namespaces.
    • Agentic Runs can be discovered in the default and alert-specific namespaces.
  • Bug Fixes

    • Improved investigation matching by using the correct fingerprint metadata.
    • Prevented unrelated investigations from appearing for alerts with different fingerprints.

@openshift-ci-robot

openshift-ci-robot commented Jul 13, 2026

Copy link
Copy Markdown

@jgbernalp: This pull request references OU-1409 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

requires #1044 to be merged first

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 13, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2026
@openshift-ci

openshift-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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

@jgbernalp jgbernalp requested review from etmurasaki and zhuje July 13, 2026 08:26
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.

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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: d9558809-af23-4c09-8f99-28e1f8e6b8b4

📥 Commits

Reviewing files that changed from the base of the PR and between ab9a890 and 595655e.

📒 Files selected for processing (7)
  • web/src/components/agentic-runs/alert-identifier.spec.ts
  • web/src/components/agentic-runs/alert-identifier.ts
  • web/src/components/agentic-runs/constants.ts
  • web/src/components/agentic-runs/useAgenticRunCheck.ts
  • web/src/components/ai-proposals/constants.ts
  • web/src/components/alerting/AlertList/AlertTableRow.tsx
  • web/src/components/console/models/index.ts

Walkthrough

Alert investigation lookup now uses fingerprint-matched AgenticRun resources instead of proposals. New constants and query logic support namespace-aware fetching, while alert rows navigate to the first matching AgenticRun.

Changes

Agentic run migration

Layer / File(s) Summary
Fingerprint constants and matching tests
web/src/components/agentic-runs/constants.ts, web/src/components/agentic-runs/alert-identifier.ts, web/src/components/agentic-runs/alert-identifier.spec.ts
Defines AgenticRun fingerprint labels and hashing parameters, updates fingerprint matching, and tests deterministic fingerprint and proposal-label behavior.
AgenticRun query hook and model
web/src/components/console/models/index.ts, web/src/components/agentic-runs/useAgenticRunCheck.ts
Adds the AgenticRunModel and queries matching runs in the default and alert namespaces using fingerprint and source selectors.
Alert-row investigation navigation
web/src/components/alerting/AlertList/AlertTableRow.tsx, web/src/components/ai-proposals/useProposalCheck.ts, web/src/components/ai-proposals/constants.ts, web/src/components/hooks/usePerspective.tsx
Replaces proposal lookup and URLs with AgenticRun lookup and navigation, and removes proposal-specific hook, constants, and URL support.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AlertTableRow
  participant useAgenticRunCheck
  participant KubernetesAPI
  participant Browser
  AlertTableRow->>useAgenticRunCheck: Provide alert
  useAgenticRunCheck->>KubernetesAPI: Query AgenticRun by fingerprint and source
  KubernetesAPI-->>useAgenticRunCheck: Return matching runs
  useAgenticRunCheck-->>AlertTableRow: Return run state and items
  AlertTableRow->>Browser: Navigate to first AgenticRun
Loading
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main goals of updating routing and renaming proposal-related concepts to agentic runs.
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.
Stable And Deterministic Test Names ✅ Passed The new spec’s describe/it titles are all static literals with no interpolation, timestamps, IDs, or other run-dependent data.
Test Structure And Quality ✅ Passed PR changes only add TS/Jest tests and web code; no Go/Ginkgo tests or cluster-interaction It blocks are present, so the check is not applicable.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests were added; the new test is a Jest unit spec, and no MicroShift-specific test APIs or guards are present.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Changed files are TS/TSX/Jest only; no Ginkgo e2e tests or SNO-only assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed Only frontend alert/UI code and tests changed; no manifests, controllers, or pod scheduling logic were added, so the topology check is not applicable.
Ote Binary Stdout Contract ✅ Passed PR only changes web TS/JS files; Go entrypoint has no stdout writes or suite hooks, so OTE stdout contract isn’t violated.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only a Jest unit spec was added; no Ginkgo/e2e tests or IPv4/external-network assumptions were found in the changed files.
No-Weak-Crypto ✅ Passed No weak primitives or secret comparisons found; the new code only implements Prometheus FNV-1a fingerprinting and compares public labels with ===.
Container-Privileges ✅ Passed No changed file defines privileged containers or host namespace flags; the PR only touches TS/TSX code, not K8s manifests.
No-Sensitive-Data-In-Logs ✅ Passed The changed files contain no console/logger calls or other logging sinks; the diff only updates fingerprinting, hooks, and URL construction.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@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: 4

🧹 Nitpick comments (2)
web/src/components/agentic-runs/alert-identifier.ts (1)

47-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename matchesProposal to align with AgenticRun terminology.

The PR objective is to rename proposals to agentic runs, but the function name and parameter still use "Proposal." This creates inconsistency for callers and future maintainers.

♻️ Proposed refactor
-export const matchesProposal = (alert: Alert, proposal: K8sResourceCommon): boolean => {
-  const proposalFp = proposal.metadata?.labels?.[AGENTIC_RUN_LABEL_FINGERPRINT];
-  if (!proposalFp) {
+export const matchesAgenticRun = (alert: Alert, run: K8sResourceCommon): boolean => {
+  const runFp = run.metadata?.labels?.[AGENTIC_RUN_LABEL_FINGERPRINT];
+  if (!runFp) {
     return false;
   }
-  return proposalFp === getAlertFingerprintPrefix(alert.labels);
+  return runFp === getAlertFingerprintPrefix(alert.labels);
 };
🤖 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 `@web/src/components/agentic-runs/alert-identifier.ts` around lines 47 - 52,
Rename the matchesProposal function and its proposal parameter to use AgenticRun
terminology, updating all callers and references consistently while preserving
the existing fingerprint-matching behavior.
web/src/components/agentic-runs/alert-identifier.spec.ts (1)

20-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align test factory and describe block with AgenticRun terminology.

makeProposal creates a resource with kind: 'Proposal', but the model now defines AgenticRunModel with kind: 'AgenticRun'. The describe('matchesProposal') block also uses stale terminology. Both should be renamed to match the PR's objective.

♻️ Proposed refactor
-const makeProposal = (labels: Record<string, string>): K8sResourceCommon => ({
+const makeAgenticRun = (labels: Record<string, string>): K8sResourceCommon => ({
   apiVersion: 'agentic.openshift.io/v1alpha1',
-  kind: 'Proposal',
+  kind: 'AgenticRun',
   metadata: {
-    name: 'test-proposal',
+    name: 'test-agentic-run',
     namespace: 'openshift-lightspeed',
     labels,
   },
 });

And update the describe block and all makeProposal call sites:

-describe('matchesProposal', () => {
+describe('matchesAgenticRun', () => {
   it('matches by fingerprint prefix', () => {
     const alert = makeAlert({ severity: 'critical' });
     const fp8 = getAlertFingerprintPrefix(alert.labels);
-    const proposal = makeProposal({
+    const run = makeAgenticRun({
       'agentic.openshift.io/alert-fingerprint': fp8,
       'agentic.openshift.io/source': 'alertmanager',
     });
-    expect(matchesProposal(alert, proposal)).toBe(true);
+    expect(matchesAgenticRun(alert, run)).toBe(true);
   });

Also applies to: 71-71

🤖 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 `@web/src/components/agentic-runs/alert-identifier.spec.ts` around lines 20 -
28, Update the test factory makeProposal and every call site to use AgenticRun
terminology, including kind: 'AgenticRun' and an appropriately renamed factory
if needed. Rename the describe('matchesProposal') block to the corresponding
AgenticRun terminology while preserving the existing test behavior.
🤖 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 `@web/src/components/agentic-runs/alert-identifier.spec.ts`:
- Line 5: Update the imports in alert-identifier.spec.ts so Alert and
K8sResourceCommon are brought in through a type-only import, while AlertStates
remains a regular value import because it is used as AlertStates.Firing.

In `@web/src/components/agentic-runs/constants.ts`:
- Around line 8-12: Update the stale comments surrounding
AGENTIC_RUN_LABEL_FINGERPRINT and AGENTIC_RUN_LABEL_SOURCE in constants.ts,
replacing “Proposal CR” with “AgenticRun CR” while leaving the constants and
values unchanged.

In `@web/src/components/agentic-runs/useAgenticRunCheck.ts`:
- Line 1: Update the import of Alert and K8sResourceCommon to use a type-only
import, since both symbols are used exclusively in type annotations and
parameters.

In `@web/src/components/alerting/AlertList/AlertTableRow.tsx`:
- Around line 64-79: The AgenticRun URL construction in the hasAgenticRun block
must require a defined namespace before adding the investigation link. Update
the guard around runName and getAgenticRunUrl to validate both
run.metadata.namespace and runName, preserving the existing dropdown behavior
when either value is missing.

---

Nitpick comments:
In `@web/src/components/agentic-runs/alert-identifier.spec.ts`:
- Around line 20-28: Update the test factory makeProposal and every call site to
use AgenticRun terminology, including kind: 'AgenticRun' and an appropriately
renamed factory if needed. Rename the describe('matchesProposal') block to the
corresponding AgenticRun terminology while preserving the existing test
behavior.

In `@web/src/components/agentic-runs/alert-identifier.ts`:
- Around line 47-52: Rename the matchesProposal function and its proposal
parameter to use AgenticRun terminology, updating all callers and references
consistently while preserving the existing fingerprint-matching behavior.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 516b7919-99ed-4ccb-9797-77fc2e44a19c

📥 Commits

Reviewing files that changed from the base of the PR and between ac79f75 and ab9a890.

📒 Files selected for processing (9)
  • web/src/components/agentic-runs/alert-identifier.spec.ts
  • web/src/components/agentic-runs/alert-identifier.ts
  • web/src/components/agentic-runs/constants.ts
  • web/src/components/agentic-runs/useAgenticRunCheck.ts
  • web/src/components/ai-proposals/constants.ts
  • web/src/components/ai-proposals/useProposalCheck.ts
  • web/src/components/alerting/AlertList/AlertTableRow.tsx
  • web/src/components/console/models/index.ts
  • web/src/components/hooks/usePerspective.tsx
💤 Files with no reviewable changes (3)
  • web/src/components/ai-proposals/constants.ts
  • web/src/components/ai-proposals/useProposalCheck.ts
  • web/src/components/hooks/usePerspective.tsx

@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.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 4

🧹 Nitpick comments (2)
web/src/components/agentic-runs/alert-identifier.ts (1)

47-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename matchesProposal to align with AgenticRun terminology.

The PR objective is to rename proposals to agentic runs, but the function name and parameter still use "Proposal." This creates inconsistency for callers and future maintainers.

♻️ Proposed refactor
-export const matchesProposal = (alert: Alert, proposal: K8sResourceCommon): boolean => {
-  const proposalFp = proposal.metadata?.labels?.[AGENTIC_RUN_LABEL_FINGERPRINT];
-  if (!proposalFp) {
+export const matchesAgenticRun = (alert: Alert, run: K8sResourceCommon): boolean => {
+  const runFp = run.metadata?.labels?.[AGENTIC_RUN_LABEL_FINGERPRINT];
+  if (!runFp) {
     return false;
   }
-  return proposalFp === getAlertFingerprintPrefix(alert.labels);
+  return runFp === getAlertFingerprintPrefix(alert.labels);
 };
🤖 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 `@web/src/components/agentic-runs/alert-identifier.ts` around lines 47 - 52,
Rename the matchesProposal function and its proposal parameter to use AgenticRun
terminology, updating all callers and references consistently while preserving
the existing fingerprint-matching behavior.
web/src/components/agentic-runs/alert-identifier.spec.ts (1)

20-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Align test factory and describe block with AgenticRun terminology.

makeProposal creates a resource with kind: 'Proposal', but the model now defines AgenticRunModel with kind: 'AgenticRun'. The describe('matchesProposal') block also uses stale terminology. Both should be renamed to match the PR's objective.

♻️ Proposed refactor
-const makeProposal = (labels: Record<string, string>): K8sResourceCommon => ({
+const makeAgenticRun = (labels: Record<string, string>): K8sResourceCommon => ({
   apiVersion: 'agentic.openshift.io/v1alpha1',
-  kind: 'Proposal',
+  kind: 'AgenticRun',
   metadata: {
-    name: 'test-proposal',
+    name: 'test-agentic-run',
     namespace: 'openshift-lightspeed',
     labels,
   },
 });

And update the describe block and all makeProposal call sites:

-describe('matchesProposal', () => {
+describe('matchesAgenticRun', () => {
   it('matches by fingerprint prefix', () => {
     const alert = makeAlert({ severity: 'critical' });
     const fp8 = getAlertFingerprintPrefix(alert.labels);
-    const proposal = makeProposal({
+    const run = makeAgenticRun({
       'agentic.openshift.io/alert-fingerprint': fp8,
       'agentic.openshift.io/source': 'alertmanager',
     });
-    expect(matchesProposal(alert, proposal)).toBe(true);
+    expect(matchesAgenticRun(alert, run)).toBe(true);
   });

Also applies to: 71-71

🤖 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 `@web/src/components/agentic-runs/alert-identifier.spec.ts` around lines 20 -
28, Update the test factory makeProposal and every call site to use AgenticRun
terminology, including kind: 'AgenticRun' and an appropriately renamed factory
if needed. Rename the describe('matchesProposal') block to the corresponding
AgenticRun terminology while preserving the existing test behavior.
🤖 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 `@web/src/components/agentic-runs/alert-identifier.spec.ts`:
- Line 5: Update the imports in alert-identifier.spec.ts so Alert and
K8sResourceCommon are brought in through a type-only import, while AlertStates
remains a regular value import because it is used as AlertStates.Firing.

In `@web/src/components/agentic-runs/constants.ts`:
- Around line 8-12: Update the stale comments surrounding
AGENTIC_RUN_LABEL_FINGERPRINT and AGENTIC_RUN_LABEL_SOURCE in constants.ts,
replacing “Proposal CR” with “AgenticRun CR” while leaving the constants and
values unchanged.

In `@web/src/components/agentic-runs/useAgenticRunCheck.ts`:
- Line 1: Update the import of Alert and K8sResourceCommon to use a type-only
import, since both symbols are used exclusively in type annotations and
parameters.

In `@web/src/components/alerting/AlertList/AlertTableRow.tsx`:
- Around line 64-79: The AgenticRun URL construction in the hasAgenticRun block
must require a defined namespace before adding the investigation link. Update
the guard around runName and getAgenticRunUrl to validate both
run.metadata.namespace and runName, preserving the existing dropdown behavior
when either value is missing.

---

Nitpick comments:
In `@web/src/components/agentic-runs/alert-identifier.spec.ts`:
- Around line 20-28: Update the test factory makeProposal and every call site to
use AgenticRun terminology, including kind: 'AgenticRun' and an appropriately
renamed factory if needed. Rename the describe('matchesProposal') block to the
corresponding AgenticRun terminology while preserving the existing test
behavior.

In `@web/src/components/agentic-runs/alert-identifier.ts`:
- Around line 47-52: Rename the matchesProposal function and its proposal
parameter to use AgenticRun terminology, updating all callers and references
consistently while preserving the existing fingerprint-matching behavior.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 516b7919-99ed-4ccb-9797-77fc2e44a19c

📥 Commits

Reviewing files that changed from the base of the PR and between ac79f75 and ab9a890.

📒 Files selected for processing (9)
  • web/src/components/agentic-runs/alert-identifier.spec.ts
  • web/src/components/agentic-runs/alert-identifier.ts
  • web/src/components/agentic-runs/constants.ts
  • web/src/components/agentic-runs/useAgenticRunCheck.ts
  • web/src/components/ai-proposals/constants.ts
  • web/src/components/ai-proposals/useProposalCheck.ts
  • web/src/components/alerting/AlertList/AlertTableRow.tsx
  • web/src/components/console/models/index.ts
  • web/src/components/hooks/usePerspective.tsx
💤 Files with no reviewable changes (3)
  • web/src/components/ai-proposals/constants.ts
  • web/src/components/ai-proposals/useProposalCheck.ts
  • web/src/components/hooks/usePerspective.tsx
🛑 Comments failed to post (4)
web/src/components/agentic-runs/alert-identifier.spec.ts (1)

5-5: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use import type for type-only symbols.

Alert and K8sResourceCommon are only used for type annotations, while AlertStates is used as a value (AlertStates.Firing). Per coding guidelines, type-only symbols should use import type. As per coding guidelines: "Use type imports for symbols that are only used for type checking."

📝 Proposed fix
-import { Alert, AlertStates, K8sResourceCommon } from '`@openshift-console/dynamic-plugin-sdk`';
+import { AlertStates } from '`@openshift-console/dynamic-plugin-sdk`';
+import type { Alert, K8sResourceCommon } from '`@openshift-console/dynamic-plugin-sdk`';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import { AlertStates } from '`@openshift-console/dynamic-plugin-sdk`';
import type { Alert, K8sResourceCommon } from '`@openshift-console/dynamic-plugin-sdk`';
🤖 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 `@web/src/components/agentic-runs/alert-identifier.spec.ts` at line 5, Update
the imports in alert-identifier.spec.ts so Alert and K8sResourceCommon are
brought in through a type-only import, while AlertStates remains a regular value
import because it is used as AlertStates.Firing.

Source: Coding guidelines

web/src/components/agentic-runs/constants.ts (1)

8-12: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update stale "Proposal CR" comments to "AgenticRun CR".

The comments on lines 8 and 12 still reference "Proposal CR" but the constants are named AGENTIC_RUN_*, contradicting the PR's stated objective of renaming proposals to agentic runs.

📝 Proposed fix
-// Proposal CR label keys
+// AgenticRun CR label keys
 export const AGENTIC_RUN_LABEL_FINGERPRINT = 'agentic.openshift.io/alert-fingerprint';
 export const AGENTIC_RUN_LABEL_SOURCE = 'agentic.openshift.io/source';
 
-// Proposal CR values
+// AgenticRun CR values
 export const AGENTIC_RUN_SOURCE_ALERTMANAGER = 'alertmanager';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

// AgenticRun CR label keys
export const AGENTIC_RUN_LABEL_FINGERPRINT = 'agentic.openshift.io/alert-fingerprint';
export const AGENTIC_RUN_LABEL_SOURCE = 'agentic.openshift.io/source';

// AgenticRun CR values
export const AGENTIC_RUN_SOURCE_ALERTMANAGER = 'alertmanager';
🤖 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 `@web/src/components/agentic-runs/constants.ts` around lines 8 - 12, Update the
stale comments surrounding AGENTIC_RUN_LABEL_FINGERPRINT and
AGENTIC_RUN_LABEL_SOURCE in constants.ts, replacing “Proposal CR” with
“AgenticRun CR” while leaving the constants and values unchanged.
web/src/components/agentic-runs/useAgenticRunCheck.ts (1)

1-1: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use import type for type-only symbols.

Alert and K8sResourceCommon are only used for type annotations and type parameters. Per coding guidelines: "Use type imports for symbols that are only used for type checking." As per coding guidelines, type-only symbols should use import type.

📝 Proposed fix
-import { Alert, K8sResourceCommon } from '`@openshift-console/dynamic-plugin-sdk`';
+import type { Alert, K8sResourceCommon } from '`@openshift-console/dynamic-plugin-sdk`';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import type { Alert, K8sResourceCommon } from '`@openshift-console/dynamic-plugin-sdk`';
🤖 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 `@web/src/components/agentic-runs/useAgenticRunCheck.ts` at line 1, Update the
import of Alert and K8sResourceCommon to use a type-only import, since both
symbols are used exclusively in type annotations and parameters.

Source: Coding guidelines

web/src/components/alerting/AlertList/AlertTableRow.tsx (1)

64-79: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard against potential undefined namespace in AgenticRun URL.

Line 68 passes run.metadata.namespace to getAgenticRunUrl without checking for existence. While AgenticRunModel is namespaced, K8sResourceCommon.metadata.namespace is typically optional. If undefined, the URL becomes /lightspeed/runs/undefined/name, producing a broken navigation.

🛡️ Proposed fix
   if (hasAgenticRun) {
     const run = agenticRuns[0];
     const runName = run.metadata?.name;
-    if (runName) {
-      const runUrl = getAgenticRunUrl(run.metadata.namespace, runName);
+    const runNamespace = run.metadata?.namespace;
+    if (runName && runNamespace) {
+      const runUrl = getAgenticRunUrl(runNamespace, runName);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

  if (hasAgenticRun) {
    const run = agenticRuns[0];
    const runName = run.metadata?.name;
    const runNamespace = run.metadata?.namespace;
    if (runName && runNamespace) {
      const runUrl = getAgenticRunUrl(runNamespace, runName);
      dropdownItems.push(
        <DropdownItem
          key="view-ai-investigation"
          icon={<CustomIcon name="ai-experience" />}
          onClick={() => navigate(runUrl)}
          data-test={DataTestIDs.ViewAIInvestigationDropdownItem}
        >
          {t('View AI Investigation')}
        </DropdownItem>,
      );
    }
🤖 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 `@web/src/components/alerting/AlertList/AlertTableRow.tsx` around lines 64 -
79, The AgenticRun URL construction in the hasAgenticRun block must require a
defined namespace before adding the investigation link. Update the guard around
runName and getAgenticRunUrl to validate both run.metadata.namespace and
runName, preserving the existing dropdown behavior when either value is missing.

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
@jgbernalp jgbernalp force-pushed the match-new-ols-routing-and-names branch from ab9a890 to 595655e Compare July 13, 2026 09:09
@jgbernalp jgbernalp marked this pull request as ready for review July 13, 2026 09:09
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2026
@openshift-ci openshift-ci Bot requested a review from PeterYurkovich July 13, 2026 09:11
@openshift-ci

openshift-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@jgbernalp: 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.

@zhuje

zhuje commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@zhuje

zhuje commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 13, 2026
@openshift-ci

openshift-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, zhuje

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

The pull request process is described 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

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants