Skip to content

COO-1725: fix: Troubleshooting panel cannot focus on node URLs.#224

Open
alanconway wants to merge 1 commit intoopenshift:mainfrom
alanconway:coo-1725-node-url
Open

COO-1725: fix: Troubleshooting panel cannot focus on node URLs.#224
alanconway wants to merge 1 commit intoopenshift:mainfrom
alanconway:coo-1725-node-url

Conversation

@alanconway
Copy link
Contributor

  • Prefer core resources when matching paths to resources.
  • Avoid showing an "Empty Query" while a search is in progress.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 16, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 16, 2026

@alanconway: This pull request references COO-1725 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

  • Prefer core resources when matching paths to resources.
  • Avoid showing an "Empty Query" while a search is in progress.

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.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1c072e4a-6696-46e2-abfe-d2d952e68d23

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Adjusts Korrel8rPanel mount/fetch logic and focus/tooltip behavior; enhances k8s.findResource to accept GVK or plain Kind and prefer core models; removes all-domains aggregation and its test; useDomains now constructs domains explicitly.

Changes

Cohort / File(s) Summary
Korrel8r panel
web/src/components/Korrel8rPanel.tsx
Init effect now dispatches a default search when locationQuery exists or an explicit Empty result when no query; early fetch returns when queryStr is missing; isFocused includes result?.isError; tooltip copy updated; dependency list adjusted.
Kubernetes resource lookup
web/src/korrel8r/k8s.ts
findResource accepts GVK or bare Kind (tries findGVK('', 'v1', resource)), maps projectsnamespaces, iterates cached models preferring core (no apiGroup) matches with watch and returns undefined if none.
Domains construction
web/src/hooks/useDomains.tsx, web/src/korrel8r/all-domains.ts
Removed all-domains aggregation; useDomains now imports and instantiates domain classes explicitly (AlertDomain, K8sDomain, LogDomain, MetricDomain, NetflowDomain, TraceDomain); all-domains.ts deleted.
Tests removed
web/src/__tests__/all-domains.spec.ts
Deleted the Domains round‑trip test suite and associated fixtures.
Diff metadata
(multiple files)
Lines changed across diffs as reported in PR summary (adds/removals across the listed files).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

@openshift-ci openshift-ci bot requested review from shwetaap and zhuje March 16, 2026 15:16
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2026
@alanconway alanconway force-pushed the coo-1725-node-url branch 3 times, most recently from 311c1f3 to 0588c9c Compare March 18, 2026 19:55
@alanconway
Copy link
Contributor Author

/cc @PeterYurkovich

@openshift-ci openshift-ci bot requested a review from PeterYurkovich March 18, 2026 19:55
Copy link

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@web/src/korrel8r/k8s.ts`:
- Around line 186-198: The code path claims to handle plain Kind but only
handles G~V~K and resource path; add a plain-Kind lookup before the
resource-path loop: after const [g,v,k] = resource.split('~') and when k is
falsy, attempt to match resource against cached model kinds (e.g., iterate
getCachedResources()?.models and compare resource to m.kind, using
case-insensitive match) and return a core model first (m.apiGroup falsy) or the
first matched model; if no kind match, then proceed with the existing
m.path-based logic and existing preference for core models; use existing helpers
findGVK and getCachedResources to locate models.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f38c716-54e5-4aa0-a2a2-587e983c2396

📥 Commits

Reviewing files that changed from the base of the PR and between 311c1f3 and 0588c9c.

📒 Files selected for processing (5)
  • web/src/__tests__/all-domains.spec.ts
  • web/src/components/Korrel8rPanel.tsx
  • web/src/hooks/useDomains.tsx
  • web/src/korrel8r/all-domains.ts
  • web/src/korrel8r/k8s.ts
💤 Files with no reviewable changes (2)
  • web/src/tests/all-domains.spec.ts
  • web/src/korrel8r/all-domains.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/src/hooks/useDomains.tsx

Copy link

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@web/src/components/Korrel8rPanel.tsx`:
- Around line 74-86: The effect that seeds the initial result should only run
once on mount to avoid overwriting user actions: replace the current
multi-dependency React.useEffect with a guarded-once pattern (e.g., add an
initializedRef via useRef(false) and an initialLocationQueryRef =
useRef(locationQuery) or similar) and inside the effect check
initializedRef.current before running the logic, set initializedRef.current =
true after dispatching, and stop including reactive deps like search?.queryStr
or result so the dispatchSearch/dispatchResult call only happens on the first
render; keep references to defaultSearch, locationQuery (captured once),
dispatchSearch and dispatchResult to locate where to apply this change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef67ea93-2b22-4529-b923-7bdf6d58caba

📥 Commits

Reviewing files that changed from the base of the PR and between 0588c9c and ce5c076.

📒 Files selected for processing (5)
  • web/src/__tests__/all-domains.spec.ts
  • web/src/components/Korrel8rPanel.tsx
  • web/src/hooks/useDomains.tsx
  • web/src/korrel8r/all-domains.ts
  • web/src/korrel8r/k8s.ts
💤 Files with no reviewable changes (2)
  • web/src/korrel8r/all-domains.ts
  • web/src/tests/all-domains.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • web/src/hooks/useDomains.tsx
  • web/src/korrel8r/k8s.ts

- Prefer core resources when matching paths to resources.
- Avoid showing an "Empty Query" while a search is in progress.
- Enable focus button if result is an error.
- Merge all-domains into useDomains - simpler & more readable.
@openshift-ci
Copy link

openshift-ci bot commented Mar 19, 2026

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

@jgbernalp
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [alanconway,jgbernalp]

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

@jgbernalp jgbernalp assigned anpingli and unassigned jgbernalp Mar 19, 2026
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.

4 participants