Skip to content

Move saved objects loader to dashboard plugin#124708

Merged
rudolf merged 4 commits intoelastic:mainfrom
rudolf:move-saved-objects-loader
Feb 10, 2022
Merged

Move saved objects loader to dashboard plugin#124708
rudolf merged 4 commits intoelastic:mainfrom
rudolf:move-saved-objects-loader

Conversation

@rudolf
Copy link
Contributor

@rudolf rudolf commented Feb 4, 2022

Summary

When creating the NP the Core team decided not to port src/legacy/ui/public/saved_objects/ due to concerns with the architecture, code quality and test coverage. In order to unblock teams this code was temporarily moved into a new saved_objects plugin #57452 We've since asked teams to remove dependencies on this plugin #46435

Now that the dashboard plugin is the only consumer of the SavedObjectsLoader I have moved this dependency into the dashboard plugin.

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@rudolf rudolf changed the title Move saved objects loader Move saved objects loader to dashboard plugin Feb 4, 2022
@rudolf rudolf force-pushed the move-saved-objects-loader branch from 24806b9 to 04782fb Compare February 4, 2022 16:27
@rudolf rudolf added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v8.1.0 auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes labels Feb 4, 2022
@rudolf rudolf force-pushed the move-saved-objects-loader branch from 13e2700 to ce8d004 Compare February 8, 2022 11:40
@rudolf rudolf marked this pull request as ready for review February 8, 2022 11:43
@rudolf rudolf requested a review from a team as a code owner February 8, 2022 11:44
@elasticmachine
Copy link
Contributor

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

@rudolf rudolf added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// label Feb 8, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@kibana-ci
Copy link

💛 Build succeeded, but was flaky

Test Failures

  • [job] [logs] Default CI Group #15 / machine learning permissions for user with full ML access with no data loaded (ft_ml_poweruser) should display elements on ML Overview page correctly

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 259 261 +2
savedObjects 39 37 -2
total -0

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
savedObjects 177 151 -26

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
savedObjects 3 2 -1

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
dashboard 13 14 +1

Page load bundle

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

id before after diff
dashboard 64.5KB 65.8KB +1.3KB
savedObjects 30.5KB 29.1KB -1.4KB
total -98.0B
Unknown metric groups

API count

id before after diff
savedObjects 221 192 -29

References to deprecated APIs

id before after diff
dashboard 84 78 -6

History

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

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Thanks for doing this @rudolf, we will absolutely be moving away from the Saved Objects Loader class soon - it is on our tech debt roadmap.

Code review only, but all the changes in this PR make sense - LGTM!

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

lgtm

} from 'kibana/public';
import { SavedObject } from '../types';
import { StringUtils } from './helpers/string_utils';
import { SavedObject } from '../../../saved_objects/public';
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: import type (even if the target is an interface)

@rudolf rudolf merged commit 00fb06c into elastic:main Feb 10, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Feb 10, 2022
@rudolf rudolf deleted the move-saved-objects-loader branch February 10, 2022 09:33
@kibanamachine
Copy link
Contributor

The following labels were identified as gaps in your version labels and will be added automatically:

  • v8.2.0

If any of these should not be on your pull request, please manually remove them.

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 10, 2022
* Move SavedObjectLoader into the dashboard plugin

* Remove old comment recommending savedobjectloader

* Fix types

(cherry picked from commit 00fb06c)
@rudolf rudolf removed the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// label Feb 10, 2022
@rudolf
Copy link
Contributor Author

rudolf commented Feb 10, 2022

Removed Team:Presentation label to see if we can get it to sync to Jira

kibanamachine added a commit that referenced this pull request Feb 15, 2022
* Move saved objects loader to dashboard plugin (#124708)

* Move SavedObjectLoader into the dashboard plugin

* Remove old comment recommending savedobjectloader

* Fix types

(cherry picked from commit 00fb06c)

* Fix types

Co-authored-by: Rudolf Meijering <rudolf.meijering@elastic.co>
Co-authored-by: Rudolf Meijering <skaapgif@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Deprecated - use backport:version if exact versions are needed backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// v8.1.0 v8.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants