Skip to content

OU-1347: fix: avoid throwing error to fallback to global datasource#920

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jgbernalp:fix-global-datasource-discovery
May 12, 2026
Merged

OU-1347: fix: avoid throwing error to fallback to global datasource#920
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
jgbernalp:fix-global-datasource-discovery

Conversation

@jgbernalp
Copy link
Copy Markdown
Contributor

@jgbernalp jgbernalp commented May 11, 2026

Return undefined rather than throwing an error to allow for global or default datasource fallback

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling for missing datasources—now returns gracefully instead of throwing an error when the datasource list is unavailable or empty.

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 11, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 11, 2026

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

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 jgbernalp requested a review from zhuje May 11, 2026 14:01
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2026
@jgbernalp
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-coo-ocp-4.22

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 0037298c-82cf-4fd3-86eb-3ba185806e43

📥 Commits

Reviewing files that changed from the base of the PR and between 3327aad and 048bd22.

📒 Files selected for processing (1)
  • web/src/components/dashboards/perses/datasource-api.ts

Walkthrough

The getDatasource method in the Perses datasource API is modified to return undefined instead of throwing an error when the datasource list is empty or non-array.

Changes

Datasource API Error Handling

Layer / File(s) Summary
Error Handling Logic
web/src/components/dashboards/perses/datasource-api.ts
OcpDatasourceApi.getDatasource returns undefined on empty or non-array datasource list instead of throwing an error.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: avoiding throwing an error to allow fallback to global datasource. It is specific and directly related to the primary modification in the changeset.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

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

@jgbernalp
Copy link
Copy Markdown
Contributor Author

/cherry-pick release-coo-ocp-4.19

@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.19 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-coo-ocp-4.19

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.

@jgbernalp
Copy link
Copy Markdown
Contributor Author

/cherry-pick 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.15 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick 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.

@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 May 11, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 11, 2026

[APPROVALNOTIFIER] This PR is APPROVED

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

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]

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

@jgbernalp
Copy link
Copy Markdown
Contributor Author

/retest ci/prow/okd-scos-images

@jgbernalp
Copy link
Copy Markdown
Contributor Author

/test ci/prow/okd-scos-images

@etmurasaki
Copy link
Copy Markdown
Contributor

/retest

@etmurasaki
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 May 11, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 12, 2026

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

@openshift-merge-bot openshift-merge-bot Bot merged commit 3ba5d1d into openshift:main May 12, 2026
10 checks passed
@openshift-cherrypick-robot
Copy link
Copy Markdown

@jgbernalp: new pull request created: #925

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-cherrypick-robot
Copy link
Copy Markdown

@jgbernalp: new pull request created: #926

Details

In response to this:

/cherry-pick release-coo-ocp-4.19

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-cherrypick-robot
Copy link
Copy Markdown

@jgbernalp: new pull request created: #927

Details

In response to this:

/cherry-pick 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.

5 participants