Skip to content
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

removing kibana_datatable in favor of datatable` #75184

Merged
merged 18 commits into from
Oct 13, 2020

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Aug 17, 2020

Summary

Removes kibana_datatable and makes all expression functions/renderers use same format of datatable

followup:

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@ppisljar ppisljar added Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) v8.0.0 Team:AppArch v7.10.0 labels Aug 17, 2020
@ppisljar ppisljar requested a review from a team August 17, 2020 16:39
@ppisljar ppisljar requested a review from a team as a code owner August 17, 2020 16:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@ppisljar ppisljar requested a review from a team as a code owner September 22, 2020 13:29
@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Sep 22, 2020
@ppisljar ppisljar added release_note:skip Skip the PR/issue when compiling release notes WIP Work in progress labels Sep 22, 2020
@ppisljar ppisljar force-pushed the expressions/datatable2 branch 2 times, most recently from 5d54df4 to 972a2bc Compare September 24, 2020 14:48
@botelastic botelastic bot added the Feature:Drilldowns Embeddable panel Drilldowns label Sep 24, 2020
Copy link
Member

@lukeelmers lukeelmers left a comment

Choose a reason for hiding this comment

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

Finished a full pass, overall LGTM other than the skipped tests, which I assume were just for debugging

@ppisljar ppisljar removed the WIP Work in progress label Sep 29, 2020
@wylieconlon
Copy link
Contributor

Fixed the latest merge conflicts

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

I mostly went through the Lens part of the code. All of the changes look good to me but I'm not 100% happy with the solution of putting the format hint into meta.params like that - there is no indication this object is allowed to be used like that on the datatable level, right? How is it meant to be used? I'm sure there is some issue describing it, but it would be really to helpful to have that as a comment on the data table types - this is an extremely central type for us and with meta and params and sourceParams and so on I don't think it's intuitive anymore what it's doing. We should document this as well as possible

I fixed a unit test here
7e827bd

And updated snapshots here
03ca92a

There was one failure in the functional tests, not sure whether it's real or not.

@@ -14,8 +14,7 @@ export const desanitizeFilterContext = (
const emptyTextValue = i18n.translate('xpack.lens.indexpattern.emptyTextColumnValue', {
defaultMessage: '(empty)',
});
return {
...context,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's wrong with spreading the context in here?

@flash1293
Copy link
Contributor

fail: runPipeline metricVis pipeline expression tests correctly renders metric with invalid data
15:58:52 │ ScriptTimeoutError: script timeout

@ppisljar I got that test failure locally as well - something is not triggered right on invalid data rendering. Could you take a look at that one?

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Noticed a regression in Lens data table

@@ -105,8 +140,7 @@ describe('datatable_expression', () => {
value: 'shoes',
},
],
negate: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is indicating a real bug - the value should be filtered out but instead it's only filtering for this value.
To reproduce:

  • Go to Lens
  • Create data table
  • Filter out value (clicking on the "-" button appearing when hovering over a cell)
  • Filter gets created filtering only for that value

@@ -14,8 +14,7 @@ export const desanitizeFilterContext = (
const emptyTextValue = i18n.translate('xpack.lens.indexpattern.emptyTextColumnValue', {
defaultMessage: '(empty)',
});
Copy link
Contributor

Choose a reason for hiding this comment

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

@ppisljar The bug in the data table is very likely related to this change - as the rest of the context isn't spreaded anymore, negate is lost.

type IconType = 'string' | 'number' | 'date' | 'boolean' | 'null';

const getIcon = (type: IconType) => {
const getIcon = (type: DatatableColumnType | null) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

i think this is the only change relevant to @elastic/kibana-canvas

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id before after diff
data 571 569 -2
expressions 105 104 -1
total -3

async chunks size

id before after diff
lens 1.0MB 1.0MB -37.0B

distributable file count

id before after diff
default 48453 48452 -1
oss 29194 29193 -1

page load bundle size

id before after diff
data 1.1MB 1.1MB +1.7KB
expressions 194.6KB 192.4KB -2.3KB
lens 79.8KB 79.8KB +65.0B
regionMap 49.9KB 49.9KB -7.0B
tileMap 49.2KB 49.2KB +5.0B
urlDrilldown 18.7KB 18.4KB -370.0B
visTypeMarkdown 15.5KB 15.5KB +18.0B
visTypeMetric 27.1KB 27.1KB +11.0B
visTypeTable 20.2KB 20.1KB -7.0B
visTypeTagcloud 22.0KB 22.1KB +8.0B
visTypeTimelion 36.1KB 36.1KB +18.0B
visTypeVislib 222.5KB 222.5KB -14.0B
visualizations 272.7KB 272.8KB +62.0B
total -779.0B

History

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

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested in Chrome and Lens parts LGTM - left one nit, but not a blocker

@@ -106,7 +141,7 @@ describe('datatable_expression', () => {
},
],
negate: true,
timeFieldName: undefined,
timeFieldName: 'a',
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look correct - a is a string field but it ends up as the "timeFieldName".
Seems like the logic here https://github.com/elastic/kibana/pull/75184/files#diff-9579ca4b06d409542e1c027008518abe610abdd3bf7a3b897f408fec7a324e44R177 is flawed. Not blocking this PR as it doesn't seem like it got introduced here, but we should probably fix it.

@@ -36,4 +36,8 @@ export const desanitizeFilterContext = (
: point
),
};
if (context.timeFieldName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this? seems like the spread takes care of it.

Copy link
Contributor

@crob611 crob611 left a comment

Choose a reason for hiding this comment

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

Canvas changes look fine 👍

@ppisljar ppisljar merged commit 255b865 into elastic:master Oct 13, 2020
ppisljar added a commit to ppisljar/kibana that referenced this pull request Oct 13, 2020
spalger added a commit that referenced this pull request Oct 13, 2020
@spalger
Copy link
Contributor

spalger commented Oct 13, 2020

@ppisljar sorry, needed to revert this as it includes port numbers in snapshots that change based on different deployment scenarios: https://kibana-ci.elastic.co/job/elastic+kibana+master/8872/execution/node/462/log/

jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 13, 2020
…otphase-to-formlib

* 'master' of github.com:elastic/kibana: (59 commits)
  [Security Solution][Resolver] Replace copy-to-clipboard with native navigator.clipboard (elastic#80193)
  [Security Solution] Reduce initial bundle size (elastic#78992)
  [Security Solution][Resolver] Fix Resize node box-shadow bug (elastic#80223)
  Move observability content (elastic#79978)
  skip flaky suite (elastic#79389)
  removing kibana_datatable` in favor of `datatable` (elastic#75184)
  [ML] Fixes for anomaly swim lane  (elastic#80299)
  [Lens] Smokescreen lens test unskip (elastic#80190)
  Improved AlertsClient tests structure by splitting a huge alerts_client.tests.ts file into a specific files defined by its responsibility. (elastic#80088)
  [APM] React key warning when opening popover with external resources (elastic#80328)
  [Step 1] use Observables on server search API (elastic#79874)
  Apply back pressure in Task Manager whenever Elasticsearch responds with a 429 (elastic#75666)
  [Lens] Leverage original http request error (elastic#79831)
  [Security Solution][Case] Improve ServiceConnectorCaseParams type (elastic#80109)
  [SECURITY_SOLUTION] Fix query on alert histogram (elastic#80219)
  [DOCS] Update ingest node pipelines doc (elastic#79187)
  [Ingest Manager] Split up OpenAPI spec file  (elastic#80107)
  [SECURITY_SOLUTION][ENDPOINT] Fix label on Trusted App create name field (elastic#80001)
  [Ingest Manager] Fix agent policy bump revision to create only one POLICY_CHANGE action (elastic#80081)
  Grid layout fixes (elastic#80305)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/data_tier_allocation_field.tsx
#	x-pack/plugins/index_lifecycle_management/public/shared_imports.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Drilldowns Embeddable panel Drilldowns Feature:Embedding Embedding content via iFrame Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) release_note:skip Skip the PR/issue when compiling release notes reverted v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants