Skip to content

[Management] Index pattern creation wizard enhancements#13960

Merged
chrisronline merged 6 commits intoelastic:masterfrom
chrisronline:fix/index_pattern_page_minor
Oct 6, 2017
Merged

[Management] Index pattern creation wizard enhancements#13960
chrisronline merged 6 commits intoelastic:masterfrom
chrisronline:fix/index_pattern_page_minor

Conversation

@chrisronline
Copy link
Copy Markdown
Contributor

Fixes #13956
Fixes #13689
Partially fixes #13735

#13956 is a straightforward fix.

For #13689, I changed the default search query from *,*:* to just *. This will only perform a single cluster search. Users should be able to manually type in a query that will search a single cluster, or across all of them (<clusterName>:<index_name>). @spalger Does that sound right?

For #13735, I think the first issue is because we are limiting our ES query to 20 results, but filtering those results based on system indices. It becomes possible that one search will show 14 results whereas the next one (which is more specific) could show 19 results. I've changed it so we double how many ES returns and filter it down to 20. I've tested this through a few scenarios (like the above mentioned one) and the counts look right to me.

@alexfrancoeur

- Ensure consistent counts by searching for twice as many as we show in the UI, this should avoid count issues due to system indices filtering (elastic#13735)
return indices.filter(index => !index.name.startsWith('.'));
const filtered = indices.filter(index => !index.name.startsWith('.'));
if (filtered.length > MAX_NUMBER_OF_MATCHING_INDICES) {
return filtered.slice(0, MAX_NUMBER_OF_MATCHING_INDICES);
Copy link
Copy Markdown
Member

@tylersmalley tylersmalley Sep 13, 2017

Choose a reason for hiding this comment

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

Thoughts on removing the if block and always return the slice?

const filtered = indices.filter(index => !index.name.startsWith('.'));
return filtered.slice(0, MAX_NUMBER_OF_MATCHING_INDICES);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can do that!

@tylersmalley
Copy link
Copy Markdown
Member

Also, since we are now putting a limit on the return - should we have an indication in the UI that there might be more results?

@chrisronline
Copy link
Copy Markdown
Contributor Author

@tylersmalley I'm not sure I follow. We've always had a limit on the return. Are you suggesting that because we have a limit, we should indicate to the user that more might exist? Definitely good feedback @alexfrancoeur

@tylersmalley
Copy link
Copy Markdown
Member

I see, we're setting upper bounds since we are filtering internal indices.

Yes, I believe that if we ever limit results that we need some indication to the user that they are limited. It's outside the scope of this PR and I will let @alexfrancoeur weigh in on it.

@chrisronline
Copy link
Copy Markdown
Contributor Author

@tylersmalley All fixed up!

@tylersmalley
Copy link
Copy Markdown
Member

Build failure is due to S3 upload, so otherwise successful - #13786

@alexfrancoeur
Copy link
Copy Markdown

alexfrancoeur commented Sep 13, 2017

@tylersmalley @chrisronline I agree with acknowledging that there are more indices if we are limiting the results. I honestly didn't know we were. Are we excluding more than just the internal indices? If so we could take a similar approach that discover does showing the total number of hits and then only presenting 500 documents. You can imagine a descriptive sentence similar to this:

Showing 500 of the 1,232 indices in this cluster. Filter down by creating an index pattern. If you'd like to create an index pattern across multiple clusters, follow this documentation.

^^ That's a bit overkill but was the first thing that came to mind. It seems that we should call out the indices shown are only for the local cluster unless a CCS index pattern is defined. I'm also skeptical about adding more text to this page, the goal of this new UI was to slim it down.

@chrisronline
Copy link
Copy Markdown
Contributor Author

chrisronline commented Sep 20, 2017

Roping in @cjcenizal for some thoughts here. I'm working on a proto version of what Alex is describing, but curious to other thoughts before I go too far with it.

@tylersmalley
Copy link
Copy Markdown
Member

@chrisronline @alexfrancoeur, since we are already limiting the results, how about moving forward with getting this in and opening up a new PR to communicate the truncation?

@chrisronline
Copy link
Copy Markdown
Contributor Author

I can get down with that!

@cjcenizal
Copy link
Copy Markdown
Contributor

It's been awhile since my head has been in this code, but I think the idea behind filtering the results was that beyond a certain number of results, this information just becomes noise -- what does it matter if you match 20, 100, or 1,000 indices? There's probably going to be a pattern to how you've named your indices so once you match ~20, you have a good idea of the others you'll match. Or so the thinking went.

So the idea is that this is just a sample of the matching indices, so you know that you're matching something and you have a general idea of which kinds of indices you're matching. If that's the idea, then how do we best communicate it?

I think the best way would be to show a very short message (hat tip to Alex's point about keeping text to a minimum at this point), e.g. "Representative sample", which hopefully gets the point across. I'd use kuiSubduedText on this to make it less prominent and put it on the right side of the table header.

Thoughts?

@chrisronline
Copy link
Copy Markdown
Contributor Author

@cjcenizal
screen shot 2017-09-25 at 10 29 26 am

Next to the pagination controls?

@cjcenizal
Copy link
Copy Markdown
Contributor

@chrisronline Yep, e.g. "1-10 of 40 (representative sample only)"

@chrisronline
Copy link
Copy Markdown
Contributor Author

@cjcenizal Added!

@chrisronline chrisronline requested review from cjcenizal and removed request for pickypg October 3, 2017 15:12
@tylersmalley
Copy link
Copy Markdown
Member

This good to go in?

@chrisronline
Copy link
Copy Markdown
Contributor Author

Just looking for a second reviewer, then yes

@cjcenizal
Copy link
Copy Markdown
Contributor

I'm reviewing this right now. 🔍

Copy link
Copy Markdown
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Looking really good! I just have a few suggestions.


// All system indices begin with a period.
return indices.filter(index => !index.name.startsWith('.'));
return indices.filter(index => !index.name.startsWith('.')).slice(0, MAX_NUMBER_OF_MATCHING_INDICES);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will only apply the cap to queries which exclude system indices. Wouldn't we want to apply it to queries which also include system indices? Something like this:

const whiteListIndices = indices => {
  if (!indices) {
    return indices;
  }

  const acceptableIndices =
    this.doesIncludeSystemIndices
    ? indices
    // Exclude system indices, which begin with a period.
    : indices.filter(index => !index.name.startsWith('.'));

  return acceptableIndices.slice(0, MAX_NUMBER_OF_MATCHING_INDICES);
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nice catch!

Notifier,
Promise
) {
const MAX_SEARCH_SIZE = 40;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did we choose 40 again? Might be worth a brief comment here.

this.fetchExistingIndices = () => {
this.isFetchingExistingIndices = true;
const allExistingLocalAndRemoteIndicesPattern = '*,*:*';
const allExistingLocalAndRemoteIndicesPattern = '*';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this variable name still make sense? If I recall correctly, the *,*:* pattern is a cross-cluster search pattern, which is what the "remote" indices part of the variable name refers to. So maybe this variable name now needs to be just allExistingIndices?

ng-model-options="{ updateOn: 'default blur', debounce: {'default': 500, 'blur': 0} }"
validate-index-pattern
allow-wildcard
validate-index-pattern-allow-wildcard
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bah good catch.


<span
ng-if="matchingIndicesList.hasMultiplePages()"
className="kuiSubduedText"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You've been living in React-land for too long my friend. This should be class, not className. 😄

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hahaha oh man nice find

@chrisronline
Copy link
Copy Markdown
Contributor Author

@cjcenizal All set for another pass!

Copy link
Copy Markdown
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

🐲 LGTM!

@cjcenizal
Copy link
Copy Markdown
Contributor

Looks like there's a failing dashboard test. I pinged @stacey-gammon about it.

@stacey-gammon
Copy link
Copy Markdown

Failure:

16:48:42 04:48:42.017      └-: time changes
16:48:42 04:48:42.017        └-> preserved during navigation
16:48:42 04:48:42.017          └-> "before each" hook: global before each
16:48:42 04:48:42.022            │ debg  Kibana uiSettings are in elasticsearch and the server is reporting a green status
16:48:42 04:48:42.037          │ debg  ensureTimePickerIsOpen: true
16:48:42 04:48:42.037          │ debg  --Clicking Quick button
16:48:42 04:48:42.208          │ debg  click Visualize tab
16:48:42 04:48:42.209          │ debg  clickSelector(a[href*='visualize'])
16:48:42 04:48:42.304          │ debg  TestSubjects.exists(top-nav)
16:48:42 04:48:42.304          │ debg  existsByDisplayedByCssSelector [data-test-subj~="top-nav"]
16:48:42 04:48:42.346          │ debg  isGlobalLoadingIndicatorHidden
16:48:42 04:48:42.346          │ debg  findByCssSelector [data-test-subj="globalLoadingIndicator"].ng-hide
16:48:42 04:48:42.360          │ debg  click Dashboard tab
16:48:42 04:48:42.361          │ debg  clickSelector(a[href*='dashboard'])
16:48:42 04:48:42.470          │ debg  TestSubjects.exists(top-nav)
16:48:42 04:48:42.471          │ debg  existsByDisplayedByCssSelector [data-test-subj~="top-nav"]
16:48:42 04:48:42.511          │ debg  isGlobalLoadingIndicatorHidden
16:48:42 04:48:42.512          │ debg  findByCssSelector [data-test-subj="globalLoadingIndicator"].ng-hide
16:48:42 04:48:42.527          │ debg  TestSubjects.find(globalTimepickerRange)
16:48:42 04:48:42.527          │ debg  in displayedByCssSelector: [data-test-subj~="globalTimepickerRange"]
16:48:52 04:48:52.543          │ debg  --- tryForTime failure: An element command could not be completed because the element is not visible on the page.
16:49:03 04:49:03.115          │ debg  --- tryForTime failed again with the same message  ...
16:49:13 04:49:13.632          │ debg  --- tryForTime failed again with the same message  ...
16:49:24 04:49:24.232          │ debg  --- tryForTime failed again with the same message  ...
16:49:24 04:49:24.777          │ debg  --- tryForTime failure: tryForTime timeout: ElementNotVisible: An element command could not be completed because the element is not visible on the page.
16:49:24 04:49:24.778          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/leadfoot/lib/findDisplayed.js:37:21
16:49:24 04:49:24.778          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/dojo/Promise.js:156:41
16:49:24 04:49:24.778          │           at runCallbacks (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/dojo/Promise.js:19:22)
16:49:24 04:49:24.778          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/dojo/Promise.js:103:21
16:49:24 04:49:24.778          │           at run (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/dojo/Promise.js:51:33)
16:49:24 04:49:24.778          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/dojo/nextTick.js:35:17
16:49:24 04:49:24.778          │           at _combinedTickCallback (internal/process/next_tick.js:73:7)
16:49:24 04:49:24.778          │           at process._tickDomainCallback (internal/process/next_tick.js:128:9)
16:49:24 04:49:24.778          │           at Command.findDisplayed (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/leadfoot/Command.js:23:10)
16:49:24 04:49:24.778          │           at Command.prototype.(anonymous function) [as findDisplayedByCssSelector] (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/leadfoot/lib/strategies.js:33:16)
16:49:24 04:49:24.778          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:86:29
16:49:24 04:49:24.778          │           at undefined.next (native)
16:49:24 04:49:24.778          │           at step (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:8:191)
16:49:24 04:49:24.778          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:8:437
16:49:24 04:49:24.778          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:8:99
16:49:24 04:49:24.778          │           at _this7._ensureElementWithTimeout (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:85:20)
16:49:24 04:49:24.779          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:32:33
16:49:24 04:49:24.779          │           at undefined.next (native)
16:49:24 04:49:24.779          │           at step (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:8:191)
16:49:24 04:49:24.779          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:8:437
16:49:24 04:49:24.779          │           at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/find.js:8:99
16:49:24 04:49:24.779          │           at tryCatcher (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/util.js:26:23)
16:49:24 04:49:24.779          │           at Function.Promise.attempt.Promise.try (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/method.js:31:24)
16:49:24 04:49:24.779          │           at attempt (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/common/services/retry.js:22:16)
16:49:24 04:49:24.779          │           at tryCatcher (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/util.js:26:23)
16:49:24 04:49:24.779          │           at Promise._settlePromiseFromHandler (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/promise.js:503:31)
16:49:24 04:49:24.779          │           at Promise._settlePromiseAt (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/promise.js:577:18)
16:49:24 04:49:24.779          │           at Promise._settlePromises (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/promise.js:693:14)
16:49:24 04:49:24.779          │           at Async._drainQueue (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/async.js:123:16)
16:49:24 04:49:24.779          │           at Async._drainQueues (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/async.js:133:10)
16:49:24 04:49:24.779          │           at Immediate.Async.drainQueues (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/node_modules/bluebird/js/main/async.js:15:14)
16:49:24 04:49:24.780          │           at runCallback (timers.js:672:20)
16:49:24 04:49:24.780          │           at tryOnImmediate (timers.js:645:5)
16:49:24 04:49:24.780          │           at processImmediate [as _immediateCallback] (timers.js:617:5)
16:49:25 04:49:25.322          │ debg  Taking screenshot "/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/screenshots/failure/dashboard app dashboard time time changes preserved during navigation.png"
16:49:25 04:49:25.482        └- ✖ fail: "dashboard app dashboard time time changes preserved during navigation"
16:49:25 04:49:25.482        │        tryForTime timeout: Error: tryForTime timeout: ElementNotVisible: An element command could not be completed because the element is not visible on the page.

with screenshot:
dashboard app dashboard time time changes preserved during navigation

It seems like when clicking to Visualize and back to dashboard, the landing page is loading instead of the previously opened dashboard.

Doesn't look like your PR changes should have caused this. lets run again, and if it's flaky, I'll file an issue for it.

Jenkins, test this

@chrisronline chrisronline merged commit a92d78c into elastic:master Oct 6, 2017
chrisronline added a commit that referenced this pull request Oct 6, 2017
* Ensure we allow wildcards, #13956

* - Only search a single cluster by default (#13689)
- Ensure consistent counts by searching for twice as many as we show in the UI, this should avoid count issues due to system indices filtering (#13735)

* PR feedback

* Just return it

* Add representative sample copy

* PR feedback
@chrisronline
Copy link
Copy Markdown
Contributor Author

Backport:

6.x: 2ce5608

@chrisronline chrisronline deleted the fix/index_pattern_page_minor branch October 6, 2017 14:06
@chrisronline chrisronline restored the fix/index_pattern_page_minor branch October 6, 2017 19:10
@chrisronline chrisronline deleted the fix/index_pattern_page_minor branch October 6, 2017 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants