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

[Asset Manager] Creates baseline public asset client for use in public plugins #167191

Merged
merged 25 commits into from
Sep 28, 2023

Conversation

jasonrhodes
Copy link
Member

@jasonrhodes jasonrhodes commented Sep 25, 2023

Closes #167075

Summary

Adds a public asset client available in the setup lifecycle hook for plugins that depend on this one. getHosts is the only method available on this client for now.

TODO, before merge:

  • Add docs for the server client
  • Add docs for the public client
  • Remove REST docs from plugin docs, not needed
  • Add unit tests for public client

Testing this PR

One way of testing this new client is to apply the attached test-assets.patch file locally, adjust the date range in the getHosts query that is added in the infra plugin, and then start Kibana and navigate to the infra app. You should see print out in the browser console.

test-assets.patch

@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!)

@jasonrhodes jasonrhodes marked this pull request as ready for review September 26, 2023 14:51
@jasonrhodes jasonrhodes requested a review from a team as a code owner September 26, 2023 14:51
@jasonrhodes jasonrhodes added release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. release_note:skip Skip the PR/issue when compiling release notes and removed release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. labels Sep 26, 2023
@jasonrhodes jasonrhodes requested a review from a team as a code owner September 26, 2023 16:13
Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

limits.yml

Comment on lines +19 to +25
The "enabled" tests are NOT run by CI yet, to prevent blocking Kibana development for a
test failure in this alpha, tech preview plugin. They will be moved into the right place
to make them run for CI before the plugin is enabled by default. To run them manually:

```shell
$ node scripts/functional_tests_server --config x-pack/test/api_integration/apis/asset_manager/config.ts
$ node scripts/functional_test_runner --config=x-pack/test/api_integration/apis/asset_manager/config.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

The original config.ts test was split in two configurations, one for testing apis with assets source and the other for signals. Currently the signals test suite is enabled

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh ok good call out, I'll take a look and maybe adjust slightly in my next PR

any Kibana plugin without any dependency restrictions. To gain access to the asset data,
this component or tool can require the appropriate asset client to be passed in.

TODO: need to move main client types to a package so that they can be depended on by
Copy link
Contributor

Choose a reason for hiding this comment

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

can the packages import types from assetmanager plugin instead ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should packages import from plugins? That sounds wrong, but maybe it's allowed for types only? Not sure it's a good idea...

Copy link
Contributor

Choose a reason for hiding this comment

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

packages already do that (eg kbn-data-service, alert_details..) but I don't know if that's recommended

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll try to poke around and think on that a bit.

Copy link
Contributor

@klacabane klacabane left a comment

Choose a reason for hiding this comment

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

LGTM

@jasonrhodes
Copy link
Member Author

This recently merged PR is going to cause conflicts for this PR -- I'll fix.

@neptunian
Copy link
Contributor

I think there is an issue with public access to the config. I can't seem to enable the public plugin because my config isn't being read.

@jasonrhodes jasonrhodes enabled auto-merge (squash) September 28, 2023 18:46
@jasonrhodes jasonrhodes requested a review from a team as a code owner September 28, 2023 19:24
Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

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

Change to test/plugin_functional/test_suites/core_plugins/rendering.ts LGTM

@jrodewig
Copy link
Contributor

@kibanamachine run elasticsearch-ci/docs

1 similar comment
@jasonrhodes
Copy link
Member Author

@kibanamachine run elasticsearch-ci/docs

@jasonrhodes jasonrhodes merged commit 859ae9e into elastic:main Sep 28, 2023
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #36 / serverless security UI Case View page "before all" hook for "should show the case view page correctly"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
assetManager - 6 +6

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
assetManager 2 9 +7

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
assetManager 0 2 +2

Page load bundle

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

id before after diff
assetManager - 2.2KB +2.2KB
Unknown metric groups

API count

id before after diff
assetManager 2 9 +7

History

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

@kibanamachine kibanamachine added v8.11.0 backport:skip This commit does not require backporting labels Sep 28, 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 v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Asset Manager] Create TS assetClient (server and browser), add methods for getting host assets
9 participants