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

[Telemetry] Use soClient in FTRs #155175

Merged
merged 3 commits into from
Apr 18, 2023

Conversation

afharo
Copy link
Member

@afharo afharo commented Apr 18, 2023

Summary

Use the Saved Objects client in the FTRs instead of writing to .kibana via ES client.

Doing it now because it facilitates the efforts in #154888

Checklist

For maintainers

@afharo afharo added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Telemetry Feature:Saved Objects technical debt Improvement of the software architecture and operational architecture release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Apr 18, 2023
@afharo afharo self-assigned this Apr 18, 2023
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed because it's a duplicate to test/api_integration/apis/telemetry/opt_in.ts and there's no different behaviour in X-Pack

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed because it's a duplicate to test/api_integration/apis/telemetry/telemetry_optin_notice_seen.ts and there's no different behaviour in X-Pack

Comment on lines +122 to +124
if (err.response?.status === 404) {
return {};
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the hardest part of our SO client... handling 404s... 😜

@afharo afharo added the Epic:ScaleMigrations Scale upgrade migrations to millions of saved objects label Apr 18, 2023
@afharo afharo marked this pull request as ready for review April 18, 2023 15:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@afharo afharo requested a review from a team April 18, 2023 15:39
Copy link
Contributor

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

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

LGTM, nice cleanup!


import { TelemetrySavedObjectAttributes } from '@kbn/telemetry-plugin/server/saved_objects';
import SuperTest from 'supertest';
import { KbnClient } from '@kbn/test';
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT can be imported as a type

@afharo afharo enabled auto-merge (squash) April 18, 2023 16:00
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 432 435 +3

Total ESLint disabled count

id before after diff
securitySolution 512 515 +3

History

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

cc @afharo

@afharo afharo merged commit 613619b into elastic:main Apr 18, 2023
@afharo afharo deleted the telemetry/use-soClient-on-ftrs branch April 18, 2023 19:38
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 Epic:ScaleMigrations Scale upgrade migrations to millions of saved objects Feature:Saved Objects Feature:Telemetry release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc technical debt Improvement of the software architecture and operational architecture v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants