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

[Maps] fix Kibana does not recognize a valid geo_shape index when attempting to create a Tracking Containment alert #96633

Merged
merged 10 commits into from
Apr 9, 2021

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Apr 8, 2021

Fixes #95418

This PR switches the implementation of IndexPatternSelect from using indexPatternService.find to instead using a combination of indexPatternService.getIdsWithTitle and indexPatternService.get. This was suggested by @mattkime to avoid using indexPatternService.find with a really large page size.

…empting to create a Tracking Containment alert
@nreese nreese requested a review from a team as a code owner April 8, 2021 18:53
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese
Copy link
Contributor Author

nreese commented Apr 8, 2021

@elasticmachine merge upstream

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

index pattern changes look good to me

@@ -535,6 +535,7 @@ export class IndexPatternsService {
});
indexPattern.id = response.id;
this.indexPatternCache.set(indexPattern.id, Promise.resolve(indexPattern));
this.savedObjectsCache.push(response);
Copy link
Contributor Author

@nreese nreese Apr 8, 2021

Choose a reason for hiding this comment

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

@mattkime Mind taking a look at this change. I was running into a problem where uploading a file in maps, https://www.elastic.co/guide/en/kibana/7.x/import-geospatial-data.html, resulted in getIdsAndTitles not containing the new index pattern. Instead of forcing IndexPatternSelect to call getIdsAndTitles with a force refresh, lets just update the cache when an index pattern is added

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

thx. I tested in alerting and maps and works as expected.

Thanks for creating #96644 as follow-up. That's a really interesting approach; fixing the problem by punting on the issue altogether.

Copy link
Contributor

@kindsun kindsun left a comment

Choose a reason for hiding this comment

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

One minor comment but functionally worked really well. Thanks for the quick fix!

  • code review
  • tested locally in chrome

image

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
data 177.1KB 177.2KB +149.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 787.2KB 787.3KB +62.0B

History

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

@nreese nreese merged commit ec070d3 into elastic:master Apr 9, 2021
nreese added a commit to nreese/kibana that referenced this pull request Apr 9, 2021
…empting to create a Tracking Containment alert (elastic#96633)

* [Maps] fix Kibana does not recognize a valid geo_shape index when attempting to create a Tracking Containment alert

* tslint

* instead of forcing refresh on getIdsAndTitles, update index pattern service to add saved object to cache when index pattern is created

* simplify title check

* revert unneeded changes

* tslint

* api doc updates

* fix functional test

Co-authored-by: Kibana Machine <[email protected]>
nreese added a commit to nreese/kibana that referenced this pull request Apr 9, 2021
…empting to create a Tracking Containment alert (elastic#96633)

* [Maps] fix Kibana does not recognize a valid geo_shape index when attempting to create a Tracking Containment alert

* tslint

* instead of forcing refresh on getIdsAndTitles, update index pattern service to add saved object to cache when index pattern is created

* simplify title check

* revert unneeded changes

* tslint

* api doc updates

* fix functional test

Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md
nreese added a commit that referenced this pull request Apr 9, 2021
…empting to create a Tracking Containment alert (#96633) (#96682)

* [Maps] fix Kibana does not recognize a valid geo_shape index when attempting to create a Tracking Containment alert

* tslint

* instead of forcing refresh on getIdsAndTitles, update index pattern service to add saved object to cache when index pattern is created

* simplify title check

* revert unneeded changes

* tslint

* api doc updates

* fix functional test

Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	docs/development/plugins/data/public/kibana-plugin-plugins-data-public.searchbar.md
nreese added a commit that referenced this pull request Apr 9, 2021
…empting to create a Tracking Containment alert (#96633) (#96681)

* [Maps] fix Kibana does not recognize a valid geo_shape index when attempting to create a Tracking Containment alert

* tslint

* instead of forcing refresh on getIdsAndTitles, update index pattern service to add saved object to cache when index pattern is created

* simplify title check

* revert unneeded changes

* tslint

* api doc updates

* fix functional test

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
phillipb added a commit to phillipb/kibana that referenced this pull request Apr 12, 2021
…to-metrics-tab

* 'master' of github.com:elastic/kibana: (44 commits)
  [Exploratory View]Additional metrics for kpi over time (elastic#96532)
  [Fleet] UI changes on hosted policy detail view (elastic#96337)
  Stacked line charts incorrectly shows one term as 100% (elastic#96203)
  [Fleet] Create enrollment API keys as current user (elastic#96464)
  [Lens] Make table and metric show on top Chart switcher (elastic#96601)
  skip flaky suite (elastic#96691)
  [Lens] Hide "Show more errors" once expanded (elastic#96605)
  [Discover] Unskip histogram hiding test (elastic#95759)
  skip flyout test, add linked issue elastic#96708
  skip copy_to_space_flyout_internal.test.tsx elastic#96708
  fix config validation (elastic#96502)
  Document telemetry fields for stack security features (elastic#96638)
  [Partial Results] Move inspector adapter integration into search source (elastic#96241)
  [RAC] Rule registry plugin (elastic#95903)
  [APM] Run precommit tasks sequentially (elastic#96551)
  [Maps] fix Kibana does not recognize a valid geo_shape index when attempting to create a Tracking Containment alert (elastic#96633)
  [Security Solution] [Cases] Small UI bugfixes (elastic#96511)
  [Actions UI] Changed PagerDuty action form UI to fill payload fields according to the API docs for Resolve and Acknowledge events. (elastic#96363)
  App Search: Result Component Updates (elastic#96184)
  [Alerting] Preconfigured alert history index connector (elastic#94909)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants