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

allow cross cluster index pattern negation - remove index pattern validation code #147970

Conversation

mattkime
Copy link
Contributor

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.

Closes #147926

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@mattkime mattkime changed the title lets try deleting some code allow cross cluster index pattern negation - remove index pattern validation code Dec 22, 2022
Comment on lines -71 to -75
let patternListActive: string[] = patternList;
// if only one pattern, don't bother with validation. We let getFieldCapabilities fail if the single pattern is bad regardless
if (patternList.length > 1 && !allowNoIndices) {
patternListActive = await this.validatePatternListActive(patternList);
}
Copy link
Member

Choose a reason for hiding this comment

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

For me this looks redundant if we decide no longer to show the message for existing data views without matching indices. Seems it was introduced in #90170?

mattkime added a commit that referenced this pull request Dec 29, 2022
## Summary

The data views api examines comma delimited sections to see if there are
matching indices before fetching the field list. The existing code
checked for index pattern negation - patterns that started with a `-`.
However, it didn't check for this in cross cluster case -
`this_cluster:-kibana*`. The code now handles the cross cluster case
appropriately.

Still, its unclear to me whether this logic is necessary, hence why I
opened #147970 - I was able to
resolve the failed tests most familiar to me but I will need to work
with engineers from other teams to investigate other failures.

Closes #147926
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 29, 2022
## Summary

The data views api examines comma delimited sections to see if there are
matching indices before fetching the field list. The existing code
checked for index pattern negation - patterns that started with a `-`.
However, it didn't check for this in cross cluster case -
`this_cluster:-kibana*`. The code now handles the cross cluster case
appropriately.

Still, its unclear to me whether this logic is necessary, hence why I
opened elastic#147970 - I was able to
resolve the failed tests most familiar to me but I will need to work
with engineers from other teams to investigate other failures.

Closes elastic#147926

(cherry picked from commit e3cac21)
kibanamachine added a commit that referenced this pull request Dec 29, 2022
… (#148206)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[data views] allow cross cluster index pattern negation
(#147968)](#147968)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Matthew
Kime","email":"matt@mattki.me"},"sourceCommit":{"committedDate":"2022-12-29T15:51:20Z","message":"[data
views] allow cross cluster index pattern negation (#147968)\n\n##
Summary\r\n\r\nThe data views api examines comma delimited sections to
see if there are\r\nmatching indices before fetching the field list. The
existing code\r\nchecked for index pattern negation - patterns that
started with a `-`.\r\nHowever, it didn't check for this in cross
cluster case -\r\n`this_cluster:-kibana*`. The code now handles the
cross cluster case\r\nappropriately.\r\n\r\nStill, its unclear to me
whether this logic is necessary, hence why I\r\nopened
#147970 - I was able to\r\nresolve
the failed tests most familiar to me but I will need to work\r\nwith
engineers from other teams to investigate other failures.\r\n\r\nCloses
https://github.com/elastic/kibana/issues/147926","sha":"e3cac218f011b3de0b39700feed1500f6129fd99","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Feature:Data
Views","Team:DataDiscovery","backport:prev-minor","v8.7.0"],"number":147968,"url":"https://github.com/elastic/kibana/pull/147968","mergeCommit":{"message":"[data
views] allow cross cluster index pattern negation (#147968)\n\n##
Summary\r\n\r\nThe data views api examines comma delimited sections to
see if there are\r\nmatching indices before fetching the field list. The
existing code\r\nchecked for index pattern negation - patterns that
started with a `-`.\r\nHowever, it didn't check for this in cross
cluster case -\r\n`this_cluster:-kibana*`. The code now handles the
cross cluster case\r\nappropriately.\r\n\r\nStill, its unclear to me
whether this logic is necessary, hence why I\r\nopened
#147970 - I was able to\r\nresolve
the failed tests most familiar to me but I will need to work\r\nwith
engineers from other teams to investigate other failures.\r\n\r\nCloses
https://github.com/elastic/kibana/issues/147926","sha":"e3cac218f011b3de0b39700feed1500f6129fd99"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/147968","number":147968,"mergeCommit":{"message":"[data
views] allow cross cluster index pattern negation (#147968)\n\n##
Summary\r\n\r\nThe data views api examines comma delimited sections to
see if there are\r\nmatching indices before fetching the field list. The
existing code\r\nchecked for index pattern negation - patterns that
started with a `-`.\r\nHowever, it didn't check for this in cross
cluster case -\r\n`this_cluster:-kibana*`. The code now handles the
cross cluster case\r\nappropriately.\r\n\r\nStill, its unclear to me
whether this logic is necessary, hence why I\r\nopened
#147970 - I was able to\r\nresolve
the failed tests most familiar to me but I will need to work\r\nwith
engineers from other teams to investigate other failures.\r\n\r\nCloses
https://github.com/elastic/kibana/issues/147926","sha":"e3cac218f011b3de0b39700feed1500f6129fd99"}}]}]
BACKPORT-->

Co-authored-by: Matthew Kime <matt@mattki.me>
@kibana-ci
Copy link
Collaborator

kibana-ci commented Jan 11, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Rules, Alerts and Exceptions ResponseOps Cypress Tests on Security Solution / Detections : Page Filters Alert list is updated when the alerts are updated
  • [job] [logs] Rules, Alerts and Exceptions ResponseOps Cypress Tests on Security Solution / Detections : Page Filters Alert list is updated when the alerts are updated
  • [job] [logs] FTR Configs #15 / discover/group1 discover sidebar renders field groups should work correctly for a data view for a missing index
  • [job] [logs] FTR Configs #15 / discover/group1 discover sidebar renders field groups should work correctly for a data view for a missing index
  • [job] [logs] Jest Tests #3 / server/index_patterns/service/lib/es_api #callFieldCapsApi() sets ignore_unavailable, allow_no_indices, and fields params

Metrics [docs]

Page load bundle

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

id before after diff
dataViews 45.8KB 45.8KB -36.0B
Unknown metric groups

API count

id before after diff
data 3300 3298 -2
dataViews 1032 1030 -2
total -4

History

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

@mattkime mattkime closed this Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data views] index negation doesn't work with cross cluster search
3 participants