Skip to content

OU-1422: feat: update perses dependecies to allow to tag the OLS contributed panels - #1045

Open
jgbernalp wants to merge 1 commit into
openshift:mainfrom
jgbernalp:set-tag-on-ols-created-dashboards
Open

OU-1422: feat: update perses dependecies to allow to tag the OLS contributed panels#1045
jgbernalp wants to merge 1 commit into
openshift:mainfrom
jgbernalp:set-tag-on-ols-created-dashboards

Conversation

@jgbernalp

@jgbernalp jgbernalp commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR upgrades the perses dependencies to the version that allow to set the dashboard metadata. This allows to set a tag in the dashboard for dashboards that receive panels from OLS.

Summary by CodeRabbit

  • Enhancements
    • Updated dashboard integrations for improved compatibility with the latest Perses platform components.
    • Improved time-series query handling for Prometheus-backed visualizations.
    • Added automatic ai-assisted metadata to dashboards when externally applied panel changes are processed.

@jgbernalp
jgbernalp requested a review from PeterYurkovich July 8, 2026 14:35
@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 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 8, 2026

Copy link
Copy Markdown

@jgbernalp: This pull request references OU-1422 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:

This PR upgrades the perses dependencies to the version that allow to set the dashboard metadata. This allows to set a tag in the dashboard for dashboards that receive panels from OLS.

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 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 8, 2026
@openshift-ci

openshift-ci Bot commented Jul 8, 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

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-coo-ocp-4.22

@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

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Walkthrough

Perses dependencies and query definitions are migrated to updated package APIs. Externally added panels now ensure dashboards include the ai-assisted metadata tag before applying changes.

Changes

Perses query migration

Layer / File(s) Summary
Perses package and type migration
web/package.json, web/src/features/perses-dashboards/components/PersesWrapper.tsx
Perses packages and imported dashboard, query, and plugin types are updated, and the wrapper now accepts QueryDefinition<Kind, UnknownSpec> queries.
Timeseries query wrapper
web/src/features/perses-dashboards/ols-tool-ui/ShowTimeseries.tsx
Timeseries definitions now wrap Prometheus query details inside a TimeSeriesQuery plugin definition.

External panel tagging

Layer / File(s) Summary
AI-assisted dashboard tagging
web/src/features/perses-dashboards/pages/dashboard-page/ExternalPanelAddition.tsx
The external panel effect conditionally adds the ai-assisted tag before applying queued panel changes and documents its dependency handling.

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

Suggested reviewers: etmurasaki, peteryurkovich

🚥 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 main change: upgrading Perses dependencies to support tagging OLS-contributed panels.
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 test titles were added or changed; the diff only touches implementation files and package dependencies.
Test Structure And Quality ✅ Passed No Ginkgo test files or test-related code were changed; the PR only updates web TS/TSX and package files, so this check is not applicable.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests were added; the PR only changes web frontend Perses wiring and metadata handling.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the changed files are package/UI code only and contain no It/Describe/Context/When test blocks.
Topology-Aware Scheduling Compatibility ✅ Passed Changes are UI/dependency-only; no manifests/controllers or scheduling constraints like affinity, nodeSelector, replicas, or PDBs were added.
Ote Binary Stdout Contract ✅ Passed PR only changes frontend Perses deps/TSX; no process-level binary setup or stdout writes were introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in the PR; touched files are frontend code and package updates only.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB usage or custom crypto/secrets comparison found in changed files; lockfile diff has no weak-crypto additions.
Container-Privileges ✅ Passed The PR only changes web package/TSX files; the diff contains no privileged:true, hostPID/Network/IPC, allowPrivilegeEscalation, SYS_ADMIN, or runAsUser:0 settings.
No-Sensitive-Data-In-Logs ✅ Passed No logging calls or sensitive-data exposures were added; the diff only updates Perses types and dashboard metadata handling.
✨ 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: 2

🤖 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/package.json`:
- Around line 77-82: The `@perses-dev` dependencies in web/package.json are pinned
to pre-release beta versions, so update the version entries for the affected
`@perses-dev/`* packages to stable releases before merging. Focus on the
dependency block containing `@perses-dev/components`, `@perses-dev/spec`,
`@perses-dev/dashboards`, `@perses-dev/explore`, `@perses-dev/plugin-system`, and
`@perses-dev/client`, and replace the beta pins with non-prerelease versions that
are compatible with the rest of the web build.

In `@web/src/components/dashboards/perses/ExternalPanelAddition.tsx`:
- Around line 85-91: The effect in ExternalPanelAddition is depending on the
full dashboardStore object, which causes unnecessary re-runs on every store
update and can feedback into the setMetadata update path. Remove dashboardStore
from the dependency array in the effect that uses queuedPanel,
dashboardStore.panelEditor, and dashboardStore.panelGroupOrder, and keep only
the specific stable fields and values actually read inside the effect.
🪄 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: 4b11e625-8d9c-41a3-98f4-f310ff28c018

📥 Commits

Reviewing files that changed from the base of the PR and between 097f674 and 0bf0ea8.

⛔ Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • web/package.json
  • web/src/components/dashboards/perses/ExternalPanelAddition.tsx
  • web/src/components/dashboards/perses/PersesWrapper.tsx
  • web/src/components/ols-tool-ui/ShowTimeseries.tsx

Comment thread web/package.json
Comment thread web/src/components/dashboards/perses/ExternalPanelAddition.tsx Outdated
@jgbernalp
jgbernalp force-pushed the set-tag-on-ols-created-dashboards branch from 0bf0ea8 to 2bf750c Compare July 9, 2026 09:49
@jgbernalp
jgbernalp marked this pull request as ready for review July 9, 2026 09:50
@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 9, 2026
@openshift-ci
openshift-ci Bot requested a review from etmurasaki July 9, 2026 09:50
@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
@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

@PeterYurkovich
PeterYurkovich force-pushed the set-tag-on-ols-created-dashboards branch from 2bf750c to eb9fa7e Compare July 14, 2026 23:05
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2026
@PeterYurkovich

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 14, 2026
@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, PeterYurkovich, 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:
  • OWNERS [PeterYurkovich,jgbernalp,zhuje]

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

🧹 Nitpick comments (1)
web/src/features/perses-dashboards/components/PersesWrapper.tsx (1)

41-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use type imports for types.

As per coding guidelines, use type imports for symbols that are only used for type checking.

♻️ Proposed refactor
-import {
+import type {
   BuiltinVariableDefinition,
   DurationString,
   QueryDefinition,
   UnknownSpec,
 } from '`@perses-dev/spec`';
🤖 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/features/perses-dashboards/components/PersesWrapper.tsx` around lines
41 - 46, Update the import from `@perses-dev/spec` in PersesWrapper.tsx so symbols
used only as types are imported via type-only syntax, while preserving any
runtime imports if present.

Source: Coding guidelines

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

Nitpick comments:
In `@web/src/features/perses-dashboards/components/PersesWrapper.tsx`:
- Around line 41-46: Update the import from `@perses-dev/spec` in
PersesWrapper.tsx so symbols used only as types are imported via type-only
syntax, while preserving any runtime imports if present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: d4a0c3f0-2ddc-45a8-b628-0eb52dae7d34

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf750c and eb9fa7e.

⛔ Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • web/package.json
  • web/src/features/perses-dashboards/components/PersesWrapper.tsx
  • web/src/features/perses-dashboards/ols-tool-ui/ShowTimeseries.tsx
  • web/src/features/perses-dashboards/pages/dashboard-page/external-panel-addition.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/package.json

@PeterYurkovich

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 Jul 14, 2026
@PeterYurkovich

Copy link
Copy Markdown
Contributor

Rebased the PR to pull in the latest changes

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD cbab71e and 2 for PR HEAD eb9fa7e in total

@jgbernalp

jgbernalp commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

/hold

This requires changes also in the Perses backend. We have to synchronize the change in konflux when we update the perses fork.

@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 Jul 15, 2026
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 27, 2026
…anels

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
@jgbernalp
jgbernalp force-pushed the set-tag-on-ols-created-dashboards branch from eb9fa7e to bed5a67 Compare July 28, 2026 17:37
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2026
@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

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

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

🧹 Nitpick comments (1)
web/src/features/perses-dashboards/pages/dashboard-page/ExternalPanelAddition.tsx (1)

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

Use a type-only import for ReactElement.

ReactElement is used only for type checking, so split it from the runtime React import.

Proposed fix
-import { ReactElement, useCallback, useEffect, useRef, useState } from 'react';
+import { useCallback, useEffect, useRef, useState } from 'react';
+import type { ReactElement } from 'react';

As per coding guidelines, use type-only imports for symbols used only for type checking.

🤖 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/features/perses-dashboards/pages/dashboard-page/ExternalPanelAddition.tsx`
at line 2, Update the React import in ExternalPanelAddition.tsx to import
ReactElement as a type-only symbol while keeping useCallback, useEffect, useRef,
and useState as runtime imports.

Source: Coding guidelines

🤖 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/features/perses-dashboards/pages/dashboard-page/ExternalPanelAddition.tsx`:
- Around line 71-77: Add a co-located .spec.ts unit test for the dashboard
tagging logic in ExternalPanelAddition, covering dashboards with no tags and
dashboards already containing ai-assisted. Assert that ai-assisted is added
exactly once and existing tags are preserved.

---

Nitpick comments:
In
`@web/src/features/perses-dashboards/pages/dashboard-page/ExternalPanelAddition.tsx`:
- Line 2: Update the React import in ExternalPanelAddition.tsx to import
ReactElement as a type-only symbol while keeping useCallback, useEffect, useRef,
and useState as runtime imports.
🪄 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: Pro Plus

Run ID: f85c1b45-e200-4994-916c-17a8995ae5f9

📥 Commits

Reviewing files that changed from the base of the PR and between eb9fa7e and bed5a67.

⛔ Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • web/package.json
  • web/src/features/perses-dashboards/components/PersesWrapper.tsx
  • web/src/features/perses-dashboards/ols-tool-ui/ShowTimeseries.tsx
  • web/src/features/perses-dashboards/pages/dashboard-page/ExternalPanelAddition.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • web/src/features/perses-dashboards/ols-tool-ui/ShowTimeseries.tsx
  • web/package.json
  • web/src/features/perses-dashboards/components/PersesWrapper.tsx

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@jgbernalp: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-monitoring bed5a67 link true /test e2e-monitoring

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants