-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
removes vis dependency from response handlers #22583
Conversation
💔 Build Failed |
07e4644
to
b72745a
Compare
💔 Build Failed |
…ult response from courier request handler
b72745a
to
ba7db19
Compare
💔 Build Failed |
@@ -100,6 +98,6 @@ export default function HistogramVisType(Private) { | |||
]) | |||
}, | |||
hierarchicalData: true, | |||
responseConverter: buildHierarchicalData, | |||
responseHandler: 'vislib_slices', |
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.
vislib now registers two response handlers: vislib_slices and vislib_series ....
responseConverter was removed
import expect from 'expect.js'; | ||
import ngMock from 'ng_mock'; | ||
import { LegacyResponseHandlerProvider } from 'ui/vis/response_handlers/legacy'; | ||
import { VisProvider } from 'ui/vis'; | ||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; | ||
import { AppStateProvider } from 'ui/state_management/app_state'; | ||
import { tabifyAggResponse } from '../../../../ui/public/agg_response/tabify'; |
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 tests we used elasticsearch stubbed responses before, now we need to tabify them first.
this is far from ideal, but should be ok short term solution, as we plan to migrate our tests to the pipeline as soon as that is available.
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.
can't we write this import as import { tabifyAggResponse } from 'ui/agg_response/tabify';
?
|
||
return function (vis, esResponse) { | ||
if (lastEsResponse === esResponse) { |
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.
this is handled on visualize_data_loader level, response handler (any) will not be called if input data did not change
@@ -155,20 +155,26 @@ const CourierRequestHandlerProvider = function () { | |||
|
|||
searchSource.finalResponse = resp; | |||
|
|||
searchSource.tabifiedResponse = tabifyAggResponse(aggs, resp, { |
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.
courier now returns tabified data
const LegacyResponseHandlerProvider = function () { | ||
|
||
return { | ||
name: 'legacy', | ||
handler: function (vis, response) { | ||
handler: function (table) { |
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.
response handlers accept only tabified data as an argument
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.
You should also fix the typing in response_handler.d.ts
to remove the vis
param from it.
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.
its already removed right ?
💔 Build Failed |
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.
Code LGTM. nits: about the imports: sometimes absolute paths are more readable than relative paths specially if you are importing things from different separated modules.
import expect from 'expect.js'; | ||
import ngMock from 'ng_mock'; | ||
import { LegacyResponseHandlerProvider } from 'ui/vis/response_handlers/legacy'; | ||
import { VisProvider } from 'ui/vis'; | ||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; | ||
import { AppStateProvider } from 'ui/state_management/app_state'; | ||
import { tabifyAggResponse } from '../../../../ui/public/agg_response/tabify'; |
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.
can't we write this import as import { tabifyAggResponse } from 'ui/agg_response/tabify';
?
lastGeoJsonResponse = convertToGeoJson(tabifiedResponse); | ||
|
||
return lastGeoJsonResponse; | ||
return convertToGeoJson(table); |
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.
what about rewriting this like
export function makeGeoJsonResponseHandler() {
return convertToGeoJson;
}
@@ -24,13 +24,35 @@ import fixtures from 'fixtures/fake_hierarchical_data'; | |||
import { LegacyResponseHandlerProvider } from '../../vis/response_handlers/legacy'; | |||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; | |||
import { VisProvider } from '../../vis'; | |||
import { tabifyAggResponse } from '../../agg_response/tabify'; |
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.
can we use also here absolute paths from 'ui/agg_response/tabify
?
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.
nope, should use absolute paths inside the same module
@@ -26,6 +26,8 @@ import sinon from 'sinon'; | |||
import { LegacyResponseHandlerProvider } from '../../vis/response_handlers/legacy'; | |||
import FixturesStubbedLogstashIndexPatternProvider from 'fixtures/stubbed_logstash_index_pattern'; | |||
import { VisProvider } from '../../vis'; | |||
import { tabifyAggResponse } from '../../agg_response/tabify'; |
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.
Same as comment above
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
ca5b92d
to
98c73e5
Compare
💔 Build Failed |
retest |
💔 Build Failed |
retest |
💔 Build Failed |
retest |
💔 Build Failed |
💚 Build Succeeded |
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.
Code LGTM assumign tests pass. We already should cleanup courier request handler to build the isnpector response on top of tabify, but not in this PR
💚 Build Succeeded |
💔 Build Failed |
preparation for #19813
qa: nothing should change functionally