-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[data.search] Move SearchSource to common directory. #77823
Conversation
9933faf
to
78c3c14
Compare
78c3c14
to
88dec35
Compare
describe('defaultSearchStrategy', function () { | ||
describe('search', function () { | ||
describe('defaultSearchStrategy', () => { | ||
describe('search', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test file, I needed to move a few things around because it was testing callMsearch
, which lives in public
. So I instead mocked callMsearch
and simply tested that the function was called with the correct args.
Then I moved the existing logic asserting that http.post
was called correctly into a separate unit test which lives alongside callMsearch
.
import { Observable } from 'rxjs'; | ||
import { IEsSearchRequest, IEsSearchResponse, ISearchOptions } from '../../common/search'; | ||
|
||
export type ISearch = ( | ||
request: IKibanaSearchRequest, | ||
options?: ISearchOptions | ||
) => Observable<IKibanaSearchResponse>; | ||
|
||
export type ISearchGeneric = < | ||
SearchStrategyRequest extends IEsSearchRequest = IEsSearchRequest, | ||
SearchStrategyResponse extends IEsSearchResponse = IEsSearchResponse | ||
>( | ||
request: SearchStrategyRequest, | ||
options?: ISearchOptions | ||
) => Observable<SearchStrategyResponse>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the purposes of this PR, these were the only types from public/search/types
which needed to be relocated to common
.
Pinging @elastic/kibana-app-arch (Team:AppArch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maps changes LGTM
code review
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes lgtm
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
page load bundle size
distributable file count
History
To update your PR or re-run it, just comment with: |
Part of #65069
This is the second-to-last PR in migrating SearchSource to the server. To keep things simple, all this PR does is relocate the various files required by SearchSource from the
public
directory to thecommon
directory, and update imports accordingly.data/public/search/search_source
moved tocommon
maps
andvisualizations
pluginsfetch
andlegacy
directories nested inside ofsearch_source
since they aren't used externallycommon
importing code frompublic
(see review notes)The next/final PR will actually handle exposing the service on the server.
No functional changes have been introduced here; just moving code around.