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

Replace usage of public SO client with Fleet get Bulk Assets api #159653

Merged
merged 10 commits into from
Jun 20, 2023

Conversation

criamico
Copy link
Contributor

@criamico criamico commented Jun 14, 2023

Closes #158598

Summary

Removes usage of deprecated SO client to fetch dashboard assets; Replaced with a call to the new Fleet endpoint epm/bulk_assets (openapi)

Testing

I'm not very familiar with stack monitoring, so I tried to reproduce what's described in the PR that originally introduced this dashboard; I couldn't trigger the modal but I can see the endpoint in the network requests:

Screenshot 2023-06-14 at 09 57 34

It should be enough to test this change since is very small.

@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.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@criamico criamico added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.9.0 labels Jun 14, 2023
@criamico criamico self-assigned this Jun 14, 2023
@criamico criamico added the release_note:skip Skip the PR/issue when compiling release notes label Jun 14, 2023
@criamico criamico marked this pull request as ready for review June 14, 2023 08:15
@criamico criamico requested review from a team as code owners June 14, 2023 08:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Jun 14, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

const { assetIds } = request.body;
const savedObjectsClient = (await context.fleet).internalSoClient;
const assets = await getBulkAssets(savedObjectsClient, assetIds as AssetSOObject[]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I refactored this as I was trying to export it with PackageService from /server/plugin, so I decided to keep this change even if it's not strictly related to this PR

@criamico criamico requested a review from juliaElastic June 15, 2023 08:03
@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Fleet Cypress Tests / View agents list Bulk actions should allow to bulk upgrade agents and cancel that upgrade

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
fleet 1067 1069 +2

Async chunks

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

id before after diff
monitoring 461.1KB 461.2KB +173.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
fleet 33 34 +1

Page load bundle

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

id before after diff
fleet 130.8KB 130.8KB +32.0B
Unknown metric groups

API count

id before after diff
fleet 1183 1185 +2

ESLint disabled line counts

id before after diff
enterpriseSearch 13 15 +2
securitySolution 411 415 +4
total +6

References to deprecated APIs

id before after diff
monitoring 5 3 -2

Total ESLint disabled count

id before after diff
enterpriseSearch 14 16 +2
securitySolution 494 498 +4
total +6

History

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

cc @criamico

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

@criamico criamico merged commit 58ec0a4 into elastic:main Jun 20, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 20, 2023
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 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack Monitoring] Remove dependency on public saved objects HTTP APIs
7 participants