Skip to content

OBSINTA-1397: fix(perses): fall back to metadata.name when dashboard display name is missing#998

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
rajusem:OBSINTA-1397
Jun 16, 2026
Merged

OBSINTA-1397: fix(perses): fall back to metadata.name when dashboard display name is missing#998
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
rajusem:OBSINTA-1397

Conversation

@rajusem

@rajusem rajusem commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fall back to metadata.name when spec.display.name is missing in the Perses dashboard listtable.

Problem

When new PersesDashboard CRs are created (e.g. during an MCO→MCOA right-sizing mode switch), thedashboard list page shows blank names until the Perses operator reconciles them.

image-5

Screenshot shows: 4 right-sizing dashboards with blank names in observability-analytics,while 2 pre-existing COO dashboards in openshift-cluster-observability-operator display names correctly.

Data flow

Creator (e.g. MCOA) → PersesDashboard CR (has spec.config.display.name) → Perses operatorreconciles → Perses server API → monitoring-plugin reads /api/v1/dashboards
The CRs have the display name set correctly from the start. The issue is that themonitoring-plugin reads from the Perses server API, not from the CRs. Before the Perses operator reconciles the CR into the server, spec.displayname is not available in the API response — resulting in blank rows.

Root Cause

dashboard-list.tsx line 229 reads only board?.spec?.display?.name with no fallback:

- const displayName = board?.spec?.display?.name;
+ const displayName = board?.spec?.display?.name || metadata?.name;

Existing pattern
The same fallback is already used elsewhere in this codebase:

  • useDashboardsData.ts: spec?.display?.name || name
  • dashboard-import-dialog.tsx: spec?.display?.name || metadata.name

Summary by CodeRabbit

  • Bug Fixes
    • Improved dashboard name display to show the appropriate name consistently, even when certain configuration data is unavailable.

…s missing

Newly created PersesDashboard CRs show blank names in the list page
until the Perses operator reconciles them. Fall back to metadata.name
so dashboards are identifiable immediately. This matches the pattern
already used in useDashboardsData.ts and dashboard-import-dialog.tsx.

Signed-off-by: Raj Zalavadia <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
@openshift-ci openshift-ci Bot requested review from etmurasaki and jgbernalp June 15, 2026 07:26
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Walkthrough

In DashboardsTable, the displayName variable is updated to fall back to board.metadata?.name when board.spec.display.name is absent, instead of producing undefined for dashboards without a spec.display field.

Changes

Dashboard Display Name Fallback

Layer / File(s) Summary
displayName fallback to metadata.name
web/src/components/dashboards/perses/dashboard-list.tsx
displayName now evaluates board.spec.display.name ?? board.metadata?.name, falling back to metadata.name when spec.display is not present.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 No Ginkgo tests present in PR. The repo uses standard Go testing (TestFunctions with *testing.T), not Ginkgo BDD framework. Check is not applicable.
Test Structure And Quality ✅ Passed PR modifies only TypeScript/React component (dashboard-list.tsx), not Ginkgo test code. Custom check for Ginkgo test quality is not applicable to frontend component changes.
Microshift Test Compatibility ✅ Passed This PR modifies only frontend UI code (dashboard-list.tsx) with no Ginkgo e2e tests added. The custom check applies only to new Ginkgo tests, making it not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR modifies only TypeScript/React frontend code (web/src/components/dashboards/perses/dashboard-list.tsx), not Ginkgo e2e tests. The custom check applies only to new Go e2e tests and is not applica...
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies only a React UI component (dashboard-list.tsx) to improve display logic with a fallback for dashboard names. It contains no deployment manifests, operator code, controllers, or sch...
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract check is inapplicable to this PR. The modified file (dashboard-list.tsx) is a TypeScript React web component, not a Go test binary, and contains no process-level code...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies a TypeScript React component (dashboard-list.tsx), not Ginkgo e2e tests. No new Ginkgo tests (It(), Describe(), Context(), When()) found. Check is not applicable.
No-Weak-Crypto ✅ Passed PR modifies only a UI fallback pattern for dashboard names (line 229). No cryptographic code, weak crypto algorithms, custom implementations, or secret comparisons are present or added.
Container-Privileges ✅ Passed PR only modifies web UI TypeScript component; no container/Kubernetes manifests present to check for privileged configurations.
No-Sensitive-Data-In-Logs ✅ Passed No logging statements found in the modified file. The change only adds a fallback for dashboard display names in UI, using standard non-sensitive metadata.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a fallback to metadata.name when dashboard display name is missing in the Perses component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@jgbernalp

Copy link
Copy Markdown
Contributor

/lgtm

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

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2026
@jgbernalp jgbernalp changed the title fix(perses): fall back to metadata.name when dashboard display name is missing OBSINTA-1397: fix(perses): fall back to metadata.name when dashboard display name is missing Jun 15, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 15, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 15, 2026

Copy link
Copy Markdown

@rajusem: This pull request references OBSINTA-1397 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 "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

Fall back to metadata.name when spec.display.name is missing in the Perses dashboard listtable.

Problem

When new PersesDashboard CRs are created (e.g. during an MCO→MCOA right-sizing mode switch), thedashboard list page shows blank names until the Perses operator reconciles them.

image-5

Screenshot shows: 4 right-sizing dashboards with blank names in observability-analytics,while 2 pre-existing COO dashboards in openshift-cluster-observability-operator display names correctly.

Data flow

Creator (e.g. MCOA) → PersesDashboard CR (has spec.config.display.name) → Perses operatorreconciles → Perses server API → monitoring-plugin reads /api/v1/dashboards
The CRs have the display name set correctly from the start. The issue is that themonitoring-plugin reads from the Perses server API, not from the CRs. Before the Perses operator reconciles the CR into the server, spec.displayname is not available in the API response — resulting in blank rows.

Root Cause

dashboard-list.tsx line 229 reads only board?.spec?.display?.name with no fallback:

- const displayName = board?.spec?.display?.name;
+ const displayName = board?.spec?.display?.name || metadata?.name;

Existing pattern
The same fallback is already used elsewhere in this codebase:

  • useDashboardsData.ts: spec?.display?.name || name
  • dashboard-import-dialog.tsx: spec?.display?.name || metadata.name

Summary by CodeRabbit

  • Bug Fixes
  • Improved dashboard name display to show the appropriate name consistently, even when certain configuration data is unavailable.

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.

@jgbernalp

Copy link
Copy Markdown
Contributor

/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Jun 15, 2026
@jgbernalp

Copy link
Copy Markdown
Contributor

/hold

for COO 1.5.0 release

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 15, 2026
@jgbernalp

Copy link
Copy Markdown
Contributor

/cherry-pick release-coo-ocp-4.22 release-coo-ocp-4.19 release-coo-ocp-4.15

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jgbernalp: once the present PR merges, I will cherry-pick it on top of release-coo-ocp-4.22 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-coo-ocp-4.22 release-coo-ocp-4.19 release-coo-ocp-4.15

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.

@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

@rajusem: 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
Copy Markdown
Contributor

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 16, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit ffe0d01 into openshift:main Jun 16, 2026
10 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown

@jgbernalp: new pull request created: #1005

Details

In response to this:

/cherry-pick release-coo-ocp-4.22 release-coo-ocp-4.19 release-coo-ocp-4.15

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.

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. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants