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

[ML] Fix categorization job view examples link when datafeed uses multiple indices #100789

Merged
merged 3 commits into from
May 28, 2021

Conversation

peteharverson
Copy link
Contributor

@peteharverson peteharverson commented May 27, 2021

Summary

Fixes the link to view examples from the anomalies table for a categorization anomaly detection job in Discover when the datafeed uses more than one index.

Previously the View examples link would only use the first index in the list, so would not correctly select the comma separated index pattern used by the job when opening Discover.

Example for a job which has this indices setting in the datafeed:

    "indices": [
      "gallery-2019-12",
      "gallery-2020-01",
      "gallery-2020-02"
    ],

Before (tries to select the first index in the list):
image

After:
image

Also fixed the default index pattern selection when creating a Discover type custom URL when the index pattern used by the job contains more than one index.

Before (selects first index from the list):
image

After (defaults to index pattern used by the job):
image

Checklist

Fixes #100328

@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)


kibanaSettings.discoverIndexPatternId = defaultIndexPattern.id;
const defaultIndexPatternId =
getIndexPatternIdFromName(datafeedConfig.indices.join()) || indexPatterns[0].id;
Copy link
Member

@jgowdyelastic jgowdyelastic May 28, 2021

Choose a reason for hiding this comment

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

we should use ?? rather than || for checks like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 920f98c

Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

Added a nit pick, but otherwise code LGTM

@qn895
Copy link
Member

qn895 commented May 28, 2021

Tested and LGTM

@peteharverson
Copy link
Contributor Author

@elasticmachine merge upstream

@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
ml 5.9MB 5.9MB +56.0B
Unknown metric groups

References to deprecated APIs

id before after diff
canvas 29 25 -4
crossClusterReplication 8 6 -2
fleet 22 20 -2
globalSearch 4 2 -2
indexManagement 12 7 -5
infra 261 149 -112
lens 67 45 -22
licensing 18 15 -3
lists 239 236 -3
maps 286 208 -78
ml 121 115 -6
monitoring 109 56 -53
securitySolution 386 342 -44
stackAlerts 101 95 -6
total -342

History

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

cc @peteharverson

@peteharverson peteharverson merged commit 5dbec05 into elastic:master May 28, 2021
@peteharverson peteharverson deleted the ml-view-examples-indices branch May 28, 2021 16:43
peteharverson added a commit to peteharverson/kibana that referenced this pull request May 28, 2021
…tiple indices (elastic#100789)

* [ML] Fix categorization job view examples link when datafeed uses multiple indices

* [ML] Fix operator in index pattern check

Co-authored-by: Kibana Machine <[email protected]>
peteharverson added a commit that referenced this pull request May 28, 2021
…tiple indices (#100789) (#100923)

* [ML] Fix categorization job view examples link when datafeed uses multiple indices

* [ML] Fix operator in index pattern check

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

Co-authored-by: Kibana Machine <[email protected]>
gmmorris added a commit to gmmorris/kibana that referenced this pull request May 28, 2021
* master: (77 commits)
  [RAC][Security Solution] Register Security Detection Rules with Rule Registry (elastic#96015)
  [Enterprise Search] Log warning for Kibana/EntSearch version mismatches (elastic#100809)
  updating the saved objects test to include more saved object types (elastic#100828)
  [ML] Fix categorization job view examples link when datafeed uses multiple indices (elastic#100789)
  Fixing ES archive mapping failure (elastic#100835)
  Fix bug with Observability > APM header navigation (elastic#100845)
  [Security Solution][Endpoint] Add event filters summary card to the fleet endpoint tab (elastic#100668)
  [Actions] Taking space id into account when creating email footer link (elastic#100734)
  Ensure comments on parameters in arrow functions are captured in the docs and ci metrics. (elastic#100823)
  [Security Solution] Improve find rule and find rule status route performance (elastic#99678)
  [DOCS] Adds video to introduction (elastic#100906)
  [Fleet] Improve combo box for fleet settings (elastic#100603)
  [Security Solution][Endpoint] Endpoint generator and data loader support for Host Isolation (elastic#100813)
  [DOCS] Adds Lens video (elastic#100898)
  [TSVB] [Table tab] Fix "Math" aggregation (elastic#100765)
  chore(NA): moving @kbn/io-ts-utils into bazel (elastic#100810)
  [Alerting] Adding feature flag for enabling/disabling rule import and export (elastic#100718)
  [TSVB] Fix Upgrading from 7.12.1 to 7.13.0 breaks TSVB (elastic#100864)
  [Lens] Adds dynamic table cell coloring (elastic#95217)
  [Security Solution][Endpoint] Do not display searchbar in security-trusted apps if there are no items (elastic#100853)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants