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

[Fleet] Move to ISavedObjectsRepository for Saved Object access #121824

Closed

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Dec 21, 2021

Summary

As of #120517 we no longer use the functionality of the spaces or security wrapper in the SavedObjectsClient, this means that we are able to move to using the ISavedObjectsRepository interface for accessing saved objects across the board.

This offers two main benefits:

  • simplify our access to saved objects e.g there is now no distinction between inernalSOClient and soClient (all our access is now "internal")
  • makes our API more explicit to dependent plugins, for example before we had no way of enforcing that a caller provided an "internal" client, by exposing ISavedObjectsRepository we now enforce this.

A high level list of the changes I have made:

  • Change SavedObjectsClientContract type to ISavedObjectsRepository
  • Modify the calling plugins to supply ISavedObjectsRepository to fleet APIs
  • Rename all of our soClient savedObjectsClient variable names to "repo" variable names to be more explicit

@hop-dev hop-dev self-assigned this Dec 21, 2021
@hop-dev hop-dev added the Team:Fleet Team label for Observability Data Collection Fleet team label Dec 21, 2021
Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

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

Looking great, thanks for doing this cleanup. It simplifies what we need to think about and eliminates several potential bugs for consumers of Fleet's plugin APIs

x-pack/plugins/fleet/server/plugin.ts Outdated Show resolved Hide resolved
@hop-dev hop-dev force-pushed the user-internal-repository-for-so-access branch from 171de21 to fe23fd0 Compare January 4, 2022 10:29
@hop-dev hop-dev marked this pull request as ready for review January 4, 2022 16:51
@hop-dev hop-dev requested review from a team as code owners January 4, 2022 16:51
@hop-dev hop-dev requested review from pzl and dasansol92 January 4, 2022 16:51
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@hop-dev hop-dev changed the title User internal repository for so access [Fleet] Move to ISavedObjectsRepository for Saved Object access Jan 4, 2022
@hop-dev hop-dev added auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v8.1.0 labels Jan 4, 2022
@hop-dev hop-dev requested a review from joshdover January 5, 2022 09:25
@hop-dev hop-dev force-pushed the user-internal-repository-for-so-access branch from e93f5b3 to c3f8a6c Compare January 12, 2022 17:46
@hop-dev hop-dev force-pushed the user-internal-repository-for-so-access branch from c3f8a6c to 3f9c46b Compare January 25, 2022 15:45
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Jan 25, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@hop-dev hop-dev marked this pull request as draft January 25, 2022 17:51
@kibana-ci
Copy link
Collaborator

kibana-ci commented Feb 8, 2022

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #5 / PackageService asInternalUser calls ensureInstalledPackage and returns results
  • [job] [logs] Jest Tests #5 / PackageService asInternalUser calls getInstallation and returns results
  • [job] [logs] Jest Tests #5 / PackageService asScoped with required privileges calls ensureInstalledPackage and returns results
  • [job] [logs] Jest Tests #5 / PackageService asScoped with required privileges calls getInstallation and returns results

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
apm 15 14 -1
securitySolution 67 66 -1
uptime 5 4 -1
total -3

ESLint disabled line counts

id before after diff
apm 86 83 -3
fleet 40 38 -2
uptime 48 42 -6
total -11

References to deprecated APIs

id before after diff
fleet 14 10 -4

Total ESLint disabled count

id before after diff
apm 101 97 -4
fleet 48 46 -2
securitySolution 515 514 -1
uptime 53 46 -7
total -14

History

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

cc @hop-dev

@shahzad31 shahzad31 removed the request for review from a team February 8, 2022 17:47
@hop-dev hop-dev added v8.2.0 and removed auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 labels Feb 9, 2022
@hop-dev hop-dev closed this Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support Team:Fleet Team label for Observability Data Collection Fleet team v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants