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

[Reporting] Add searchSourceStart.create error handling #197238

Conversation

kowalczyk-krzysztof
Copy link
Member

@kowalczyk-krzysztof kowalczyk-krzysztof commented Oct 22, 2024

Summary

This PR adds a new type of error (ReportingSavedObjectNotFoundError) which gets thrown when passed in saved object doesn't exist.

This produces a log like this:

[2024-10-22T15:09:26.768+02:00][ERROR][plugins.reporting.runTask] Error: ReportingError(code: reporting_saved_object_not_found) "Error: Saved object [index-pattern/ff959d40-b880-11e8-a6d9-e546fe2bba5f] not found"

Closes: #191548
Closes: #196620

@kowalczyk-krzysztof kowalczyk-krzysztof added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting SharedUX/fix-it-week Bugs that have been groomed and queued up for the team's next fix it week Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Feature:Reporting:CSV Reporting issues pertaining to CSV file export labels Oct 22, 2024
@kowalczyk-krzysztof kowalczyk-krzysztof self-assigned this Oct 22, 2024
@kowalczyk-krzysztof kowalczyk-krzysztof requested a review from a team as a code owner October 22, 2024 13:17
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

const reportingError = new ReportingSavedObjectNotFoundError(err);
throw createTaskRunError(reportingError, TaskErrorSource.USER);
}
throw new Error(err);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be

Suggested change
throw new Error(err);
throw err;

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops. That's right. I'll change this 👍🏻

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #49 / Rule execution logic API Detection Engine - Execution logic @ess @serverless Indicator match type rules, alert suppression Code execution path: events count is greater than threats count deduplicates new alerts if they were previously created without suppression

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/reporting-common 86 89 +3

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
reporting 53.3KB 53.5KB +208.0B
Unknown metric groups

API count

id before after diff
@kbn/reporting-common 96 99 +3

cc @kowalczyk-krzysztof

@kowalczyk-krzysztof kowalczyk-krzysztof merged commit ae0ac74 into elastic:main Oct 22, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Reporting:CSV Reporting issues pertaining to CSV file export release_note:skip Skip the PR/issue when compiling release notes SharedUX/fix-it-week Bugs that have been groomed and queued up for the team's next fix it week Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v9.0.0
Projects
None yet
5 participants