Server saved objects client through request context#44143
Merged
rudolf merged 12 commits intoelastic:masterfrom Oct 16, 2019
Merged
Server saved objects client through request context#44143rudolf merged 12 commits intoelastic:masterfrom
rudolf merged 12 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/kibana-platform |
Contributor
💔 Build Failed |
5 tasks
Contributor
💔 Build Failed |
5 tasks
11 tasks
69d32de to
5747758
Compare
Contributor
💚 Build Succeeded |
5747758 to
25e8fb3
Compare
Contributor
💔 Build Failed |
25e8fb3 to
08e8a40
Compare
Contributor
💔 Build Failed |
Contributor
💚 Build Succeeded |
joshdover
reviewed
Oct 3, 2019
mshustov
reviewed
Oct 7, 2019
And use the saved objects mappings instead
Contributor
💔 Build Failed |
Contributor
💔 Build Failed |
mshustov
approved these changes
Oct 14, 2019
src/core/server/saved_objects/migrations/kibana/__mocks__/kibana_migrator.ts
Outdated
Show resolved
Hide resolved
| } as unknown) as SavedObjectsSetupDeps; | ||
|
|
||
| const savedObjectsSetup = await soService.setup(coreSetup); | ||
| expect(savedObjectsSetup.clientProvider).toBeInstanceOf(SavedObjectsClientProvider); |
Contributor
There was a problem hiding this comment.
TypeScript guarantees this. Doesn't it?
| registerSearchRoute(routerMock); | ||
| const handler = routerMock.post.mock.calls[0][1]; | ||
| await handler(mockContext, mockRequest, mockResponse); | ||
| await handler((mockContext as unknown) as RequestHandlerContext, mockRequest, mockResponse); |
Contributor
There was a problem hiding this comment.
shouldn't we provide RequestHandlerContextMock? can be done as a follow up
Contributor
💚 Build Succeeded |
XavierM
reviewed
Oct 15, 2019
XavierM
reviewed
Oct 15, 2019
Contributor
💔 Build Failed |
Contributor
💚 Build Succeeded |
rudolf
added a commit
to rudolf/kibana
that referenced
this pull request
Oct 16, 2019
* Expose Saved Objects client in request context * API Integration test for savedobjects in req context * SavedObjectsClient docs * SavedObjectsClient#find remove dependency on indexPatterns And use the saved objects mappings instead * Review comments * Review comments, fixes and tests * Use correct type for KQL syntax check
rudolf
added a commit
that referenced
this pull request
Oct 16, 2019
* Expose Saved Objects client in request context * API Integration test for savedobjects in req context * SavedObjectsClient docs * SavedObjectsClient#find remove dependency on indexPatterns And use the saved objects mappings instead * Review comments * Review comments, fixes and tests * Use correct type for KQL syntax check
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the Saved Objects client to server-side plugins through the request handler context.
Since this moves the Saved Objects Client Provider into Core I also had to fix #47012 as part of this work. SavedObjects#find with KQL filtering no longer depends on indexPatterns.
KQL uses indexPatterns only for creating queries against scripted fields or optimizing queries where all fields in the index should be returned. Neither of these are relevant to SavedObjects#find. In the future KQL is likely to become more dependant on indexPatterns but I'd rather wait till we have a valuable use case before introducing this dependency.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers