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

[Lens] Fix context formula functions #172710

Merged

Conversation

drewdaemon
Copy link
Contributor

@drewdaemon drewdaemon commented Dec 6, 2023

Summary

Fix #170762

Screen.Recording.2023-12-07.at.4.38.49.PM.mov

Checklist

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon drewdaemon added release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Dec 7, 2023
@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon drewdaemon marked this pull request as ready for review December 8, 2023 17:12
@drewdaemon drewdaemon requested review from a team as code owners December 8, 2023 17:12
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@@ -86,7 +86,7 @@ pageLoadAssetSize:
kibanaUsageCollection: 16463
kibanaUtils: 79713
kubernetesSecurity: 77234
lens: 39000
lens: 41000
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Required a limit bump because of the new expression functions which are imported sync.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only went up about 1KB, so we don't have to be this generous....

@botelastic botelastic bot added the Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) label Dec 8, 2023
@drewdaemon drewdaemon added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:Lens labels Dec 8, 2023
Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Data Discovery changes LGTM 👍

@stratoula
Copy link
Contributor

@dej611 can you take this review? You know this code better than me!

drewdaemon added a commit that referenced this pull request Dec 11, 2023
## Summary

While working on #172710 I noticed
how loose our search context types were. This leeway seems like overkill
given how we actually use the expressions framework.

---------

Co-authored-by: kibanamachine <[email protected]>
@drewdaemon
Copy link
Contributor Author

@elasticmachine merge upstream

@drewdaemon
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Left just a minor code nit.
Tested locally and it works great! 🎉


const getTimeRangeAsNumber = (timeRange: TimeRange | undefined, now: number | undefined) => {
if (!timeRange) return 0;
const absoluteTimeRange = getAbsoluteTimeRange(timeRange, now ? { forceNow: new Date(now) } : {});
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const absoluteTimeRange = getAbsoluteTimeRange(timeRange, now ? { forceNow: new Date(now) } : {});
const absoluteTimeRange = getAbsoluteTimeRange(timeRange, now != null ? { forceNow: new Date(now) } : {});

@drewdaemon drewdaemon force-pushed the 170762/fix-formula-context-functions branch from 3503866 to eea236f Compare December 19, 2023 14:12
@drewdaemon drewdaemon enabled auto-merge (squash) December 19, 2023 14:14
@drewdaemon drewdaemon merged commit 99763dc into elastic:main Dec 19, 2023
37 checks passed
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #35 / serverless observability UI Observability Log Explorer Dataset Selector with installed integrations and uncategorized data streams when open on the integrations tab should sort the integrations list by the clicked sorting option

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 1150 1152 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/es-query 206 207 +1
expressions 1749 1752 +3
total +4

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.4MB 1.4MB -156.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 411.0KB 411.0KB +57.0B
expressions 98.4KB 98.4KB +6.0B
lens 37.7KB 38.8KB +1.2KB
total +1.2KB
Unknown metric groups

API count

id before after diff
@kbn/es-query 266 267 +1
expressions 2208 2211 +3
total +4

History

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.12 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 172710

Questions ?

Please refer to the Backport tool documentation

drewdaemon added a commit to drewdaemon/kibana that referenced this pull request Dec 19, 2023
## Summary

While working on elastic#172710 I noticed
how loose our search context types were. This leeway seems like overkill
given how we actually use the expressions framework.

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 570937f)
drewdaemon added a commit that referenced this pull request Dec 20, 2023
# Backport

This will backport the following commits from `main` to `8.12`:
- [[Lens] unify expression search context type
(#172738)](#172738)

This is a prerequisite to backporting
#172710

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-11T14:08:00Z","message":"[Lens]
unify expression search context type (#172738)\n\n##
Summary\r\n\r\nWhile working on
#172710 I noticed\r\nhow loose our
search context types were. This leeway seems like overkill\r\ngiven how
we actually use the expressions
framework.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"570937ff19c500d0d54b605b0602b6ffb2a6fb10","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:ExpressionLanguage","Team:Visualizations","release_note:skip","backport:skip","v8.13.0"],"number":172738,"url":"https://github.com/elastic/kibana/pull/172738","mergeCommit":{"message":"[Lens]
unify expression search context type (#172738)\n\n##
Summary\r\n\r\nWhile working on
#172710 I noticed\r\nhow loose our
search context types were. This leeway seems like overkill\r\ngiven how
we actually use the expressions
framework.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"570937ff19c500d0d54b605b0602b6ffb2a6fb10"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172738","number":172738,"mergeCommit":{"message":"[Lens]
unify expression search context type (#172738)\n\n##
Summary\r\n\r\nWhile working on
#172710 I noticed\r\nhow loose our
search context types were. This leeway seems like overkill\r\ngiven how
we actually use the expressions
framework.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"570937ff19c500d0d54b605b0602b6ffb2a6fb10"}}]}]
BACKPORT-->

Co-authored-by: Kibana Machine <[email protected]>
drewdaemon added a commit to drewdaemon/kibana that referenced this pull request Dec 20, 2023
## Summary
Fix elastic#170762

https://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd

### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit 99763dc)
@drewdaemon
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.12

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

drewdaemon added a commit that referenced this pull request Dec 20, 2023
# Backport

This will backport the following commits from `main` to `8.12`:
- [[Lens] Fix context formula functions
(#172710)](#172710)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-19T15:32:31Z","message":"[Lens]
Fix context formula functions (#172710)\n\n## Summary\r\nFix
https://github.com/elastic/kibana/issues/170762\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd\r\n\r\n\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"99763dc61647c817384019f6603de7ad258eea01","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:ExpressionLanguage","Team:Visualizations","Feature:Lens","backport:prev-minor","v8.13.0"],"number":172710,"url":"https://github.com/elastic/kibana/pull/172710","mergeCommit":{"message":"[Lens]
Fix context formula functions (#172710)\n\n## Summary\r\nFix
https://github.com/elastic/kibana/issues/170762\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd\r\n\r\n\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"99763dc61647c817384019f6603de7ad258eea01"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/172710","number":172710,"mergeCommit":{"message":"[Lens]
Fix context formula functions (#172710)\n\n## Summary\r\nFix
https://github.com/elastic/kibana/issues/170762\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/315764/f5b50ffa-4a03-45ee-bc7a-2f2aca7fa3bd\r\n\r\n\r\n\r\n###
Checklist\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"99763dc61647c817384019f6603de7ad258eea01"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.12.0 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] context formula functions don't update on dashboard
8 participants