force savedObject API consumers to define SO type explicitly#58022
force savedObject API consumers to define SO type explicitly#58022mshustov merged 5 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/kibana-platform (Team:Platform) |
| async index(partial: string) { | ||
| const search = partial ? `${partial}*` : '*'; | ||
| const resp = await savedObjectsClient.find({ | ||
| const resp = await savedObjectsClient.find<IndexPatternAttributes>({ |
There was a problem hiding this comment.
I added an explicit dependency on the IndexPatternAttributes to track all places accessing the data plugin saved object. It should simplify further refactoring.
There was a problem hiding this comment.
@elastic/kibana-app-arch let me know it it's okay
joshdover
left a comment
There was a problem hiding this comment.
Core changes LGTM. Definitely need each team to review their changes. Some teams that are not included: @elastic/siem (for some reason Github won't let me add as a reviewer??)
rylnd
left a comment
There was a problem hiding this comment.
SIEM changes look good to me, thanks!
rudolf
left a comment
There was a problem hiding this comment.
Left some comments, but I'll defer to the app-arch team for those, so for me this is 👍 🎉
walterra
left a comment
There was a problem hiding this comment.
ML changes LGTM. We can follow up with adding the types where this PR adds <any>.
flash1293
left a comment
There was a problem hiding this comment.
Kibana App changes LGTM
x-pack/plugins/security/server/saved_objects/secure_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
crob611
left a comment
There was a problem hiding this comment.
Canvas changes look good
…#58022) * force savedObject consumers to define type explicitly * address comments * regen docs
…_improve-advanced-settings-save * commit '98aa1d2d4f974f72a9a5397b1b91f11509f6fb7a': [SIEM] [Case] Enable case by default. Snake to camel on UI (elastic#57936) [File upload] Update remaining File Upload dependencies for NP migration (elastic#58128) Use EuiTokens for ES field types (elastic#57911) Added UI support for the default action group for Alert Type Model (elastic#57603) force savedObject API consumers to define SO type explicitly (elastic#58022) Update dependency @elastic/charts to ^17.1.1 (elastic#57634)
…-out-of-legacy * 'master' of github.com:elastic/kibana: [SIEM] [Case] Enable case by default. Snake to camel on UI (elastic#57936) [File upload] Update remaining File Upload dependencies for NP migration (elastic#58128) Use EuiTokens for ES field types (elastic#57911) Added UI support for the default action group for Alert Type Model (elastic#57603) force savedObject API consumers to define SO type explicitly (elastic#58022) Update dependency @elastic/charts to ^17.1.1 (elastic#57634) [Endpoint] Add a flyout to alert list. (elastic#57926) Make sure index pattern has fields before parsing (elastic#58242) Sanitize workpad before sending to API (elastic#57704) [ML] Transform: Support multi-line JSON notation in advanced editor (elastic#58015) [Endpoint] Refactor Management List Tests (elastic#58148) [kbn/optimizer] include bootstrap cache key in optimizer cache key (elastic#58176) Do not refresh color scale on each lookup (elastic#57792) Updating to @elastic/lodash@3.10.1-kibana4 (elastic#54662) Trigger context (elastic#57870) [ML] Transforms: Adds clone feature to transforms list. (elastic#57837) [ML] New Platform server shim: update fields service routes (elastic#58060) [Endpoint] EMT-184: change endpoints to metadata up and down the code base. (elastic#58038)
💔 Build FailedTest FailuresKibana Pipeline / kibana-intake-agent / Jest Integration Tests.packages/kbn-plugin-generator/integration_tests.running the plugin-generator via 'node scripts/generate_plugin.js plugin-name' with default config then running with es instance 'yarn start' should result in the spec plugin being initialized on kibana's stdoutStandard OutStack TraceKibana Pipeline / kibana-oss-agent / Chrome UI Functional Tests.test/functional/apps/discover/_errors·js.discover app errors invalid scripted field error is renderedStandard OutStack TraceKibana Pipeline / kibana-oss-agent / Chrome UI Functional Tests.test/functional/apps/discover/_errors·js.discover app errors invalid scripted field error is renderedStandard OutStack TraceHistory
To update your PR or re-run it, just comment with: |
Closes #47334
Dev Docs
The new interface enforces API consumers to specify SO type explicitly. Plugins can use
SavedObjectAttributesto ensure their type are serializable, but it shouldn't be used as their domain-specific type.