feat(observability): make project-level log component names clickable#643
feat(observability): make project-level log component names clickable#643kavix wants to merge 11 commits into
Conversation
Signed-off-by: kavix <kavix@yahoo.com>
Signed-off-by: kavix <kavix@yahoo.com>
Signed-off-by: kavix <kavix@yahoo.com>
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesClickable Component Names in Runtime Logs
Test Environment Stabilization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.test.tsx (1)
52-56: ⚡ Quick winAdd a route-preservation assertion for
location.search.The router wrapper is correct, but this setup still doesn’t protect the core behavior added in
LogEntry(carrying query params to the component link). Consider usingMemoryRouter initialEntrieswith a query string and asserting the renderedhrefincludes it.🤖 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 `@plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.test.tsx` around lines 52 - 56, The MemoryRouter wrapper in the render function needs to be configured to pass a query string via initialEntries, and the test needs an assertion to verify that the rendered LogEntry component's link href includes those query parameters. Modify the MemoryRouter to include an initialEntries prop with a URL containing a query string (e.g., path with ?param=value), then add an assertion that checks the href attribute of the rendered link element in LogEntry includes that query string parameter to ensure the component properly preserves route search parameters.
🤖 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 `@plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.tsx`:
- Line 155: The route being built in the `to` prop at line 155 hardcodes
`default/component` in the URL path, but the runtime-logs route requires dynamic
namespace and kind values to work correctly for entities outside the default
namespace. Replace the hardcoded `default/component` with actual entityNamespace
and entityKind values obtained from parent context or a canonical entity
reference, using `default/component` only as an explicit fallback when these
values are not available. This ensures the navigation route correctly matches
the entity's actual namespace and kind.
---
Nitpick comments:
In
`@plugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.test.tsx`:
- Around line 52-56: The MemoryRouter wrapper in the render function needs to be
configured to pass a query string via initialEntries, and the test needs an
assertion to verify that the rendered LogEntry component's link href includes
those query parameters. Modify the MemoryRouter to include an initialEntries
prop with a URL containing a query string (e.g., path with ?param=value), then
add an assertion that checks the href attribute of the rendered link element in
LogEntry includes that query string parameter to ensure the component properly
preserves route search parameters.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: d556478f-92ec-4957-b67e-e8f0a4dc32e6
📒 Files selected for processing (3)
.changeset/clickable-log-components.mdplugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.test.tsxplugins/openchoreo-observability/src/components/RuntimeLogs/LogEntry.tsx
…inks Signed-off-by: kavix <kavix@yahoo.com>
… link and add tests Signed-off-by: kavix <kavix@yahoo.com>
|
@kavix Tests are failing. Shall we fix the failing tests and update the PR |
bca59c4 to
fdeefdd
Compare
|
@stefinie123 Can you check Now? |
|
@kavix tests and linter are failing again. Run |
…g noise Signed-off-by: kavix <kavix@yahoo.com>
dfc746c to
79767f8
Compare
Fix ESLint failures in the openchoreo plugin. ESLint Failure 1: @backstage/no-mixed-plugin-imports - Warning: @openchoreo/backstage-plugin (frontend-plugin) uses forbidden import from @openchoreo/test-utils (node-library). - Reason for change: Changed the package backstage role of @openchoreo/test-utils from "node-library" to "common-library" (and removed the unused @backstage/backend-test-utils dependency). This permits frontend plugins to import the shared test utilities. ESLint Failure 2: no-console - Error: Unexpected console statement in setupTests.ts. - Reason for change: Added /* eslint-disable no-console */ at the top of setupTests.ts to allow overriding console.error to filter out specific act and CSS parsing test environment warnings. Signed-off-by: kavix <kavix@yahoo.com>
79767f8 to
ddda7aa
Compare
…ppage Signed-off-by: kavix <kavix@yahoo.com>
Signed-off-by: kavix <kavix@yahoo.com>
… entry from test-utils workspace Signed-off-by: kavix <kavix@yahoo.com>
Signed-off-by: kavix <kavix@yahoo.com>
74730e4 to
3bbf3b8
Compare
Purpose
Resolves #3436
In the project-level logging view, log records include the component name as plain text. This PR makes the component name a clickable link that navigates directly to that component's logging view, making it much easier to drill down from project logs to component logs.
Goals
componentNamefield in theLogEntrytable a clickable React<Link>.location.searchto the target URL.Approach
LogEntry.tsxinopenchoreo-observabilityto wrap theComponentNamefield with@backstage/core-componentsLink.useLocationfromreact-router-domto dynamically append current URL search params to the target component's route, preserving all active filters and time ranges automatically.LogEntry.test.tsxto wrap the component in a<MemoryRouter>to satisfyreact-router-domhooks..changesetfile for the@openchoreo/backstage-plugin-openchoreo-observabilitypackage.User stories
Release note
Added clickable component names in the project-level logging view to seamlessly navigate to component-scoped logs while preserving active filters.
Documentation
N/A - Minor UI improvement to existing logging view.
Training
N/A
Certification
N/A
Marketing
N/A
Automation tests
Security checks
Samples
N/A
Related PRs
None.
Migrations (if applicable)
N/A
Test environment
Learning
useLocation.Summary by CodeRabbit