Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(slo): preview data no response error #167909

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented Oct 3, 2023

Resolves #167854

🍒 Summary

When the preview API was failing and returning a no data body, the react hook was interpreting the response as an empty string, resulting in a breaking page.
This PR addresses this issue by always returning an empty response in case of runtime error from the API, and also check the response is an Array from the hook, before returning it to the component.

@kdelemme kdelemme self-assigned this Oct 3, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@kdelemme kdelemme added Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.11.0 Feature:SLO labels Oct 3, 2023
@kdelemme kdelemme marked this pull request as ready for review October 3, 2023 16:06
@kdelemme kdelemme requested a review from a team as a code owner October 3, 2023 16:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-observability (Team: Actionable Observability)

@kdelemme kdelemme added the release_note:skip Skip the PR/issue when compiling release notes label Oct 3, 2023
@kdelemme kdelemme added v8.12.0 and removed v8.11.0 labels Oct 3, 2023
@simianhacker simianhacker added the backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) label Oct 4, 2023
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #57 / APM API tests alerts/error_count_threshold.spec.ts basic no archive error count threshold alert create rule without kql filter "after all" hook for "shows no alerts for opbeans-node in the tab"

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 1.0MB 1.0MB +39.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @kdelemme

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

assertNever(type);
}
} catch (err) {
return [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Showing a toast with the error message would help to understand no data is due to an error.

@kdelemme kdelemme merged commit 59257db into elastic:main Oct 5, 2023
22 checks passed
@kdelemme kdelemme deleted the fix/slo-preview-data branch October 5, 2023 13:20
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.11

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 5, 2023
kibanamachine added a commit that referenced this pull request Oct 5, 2023
# Backport

This will backport the following commits from `main` to `8.11`:
- [fix(slo): preview data no response error
(#167909)](#167909)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Kevin
Delemme","email":"kevin.delemme@elastic.co"},"sourceCommit":{"committedDate":"2023-10-05T13:20:09Z","message":"fix(slo):
preview data no response error
(#167909)","sha":"59257dbcc8fcf2f05b9ac62cb4a494213afa75cd","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
Actionable
Observability","backport:prev-minor","Feature:SLO","v8.12.0"],"number":167909,"url":"https://github.com/elastic/kibana/pull/167909","mergeCommit":{"message":"fix(slo):
preview data no response error
(#167909)","sha":"59257dbcc8fcf2f05b9ac62cb4a494213afa75cd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/167909","number":167909,"mergeCommit":{"message":"fix(slo):
preview data no response error
(#167909)","sha":"59257dbcc8fcf2f05b9ac62cb4a494213afa75cd"}}]}]
BACKPORT-->

Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
kdelemme added a commit to kdelemme/kibana that referenced this pull request Oct 6, 2023
dej611 pushed a commit to dej611/kibana that referenced this pull request Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:SLO release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.11.0 v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] Runtime exception on "Edit" view when _preview returns ""
7 participants