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

[Canvas] Adds support for uppercase cluster names in esdocs and other datasource bug fixes #44311

Merged
merged 6 commits into from
Sep 6, 2019

Conversation

cqliu1
Copy link
Contributor

@cqliu1 cqliu1 commented Aug 28, 2019

Summary

Closes #27099.
Closes #44135.
Closes #44141.

This fixes a few bugs surrounding default index patterns used in datasources, specifically in esdocs.

When initially visiting the Data tab to configure the datasource using Elasticsearch raw documents, the index argument in esdocs will be updated in the expression to the default index instead of leaving it out of the expression.

The 2nd fix resolves the error thrown by the Data tab when you navigate to it without having any default index pattern set by checking that a default index pattern exists before trying to retrieve the saved object from Elasticsearch.

The last fix adds support for uppercase cluster names by removing toLowerCase transforms on index names. Every instance of the index name was lowercased because Elasticsearch doesn't allow uppercase letters in the index names, but remote clusters do allow upper case letters in the cluster names.

To test support for case sensitive index names:

  1. Install one of the sample data sets like kibana_sample_data_ecommerce.

  2. Go into the Kibana dev console, and run this API call to create a remote cluster

PUT _cluster/settings
{
  "persistent": {
    "cluster": {
      "remote": {
        "cluster_ONE": {
          "seeds": [
            "127.0.0.1:9300"
          ]
        }
      }
    }
  }
}
  1. Create an element that queries that index from the cluster_ONE remote cluster. Here's a sample expression:
filters
| esdocs index="cluster_ONE:kibana_sample_data_ecommerce" fields="taxful_total_price, user, order_date"
| alterColumn "order_date" name="Date Ordered"
| table
| render
  1. If it works, the element should display data and not throw the error described in Canvas doesn't support upper case remote cluster names  #27099.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

- [ ] This was checked for cross-browser compatibility, including a check against IE11
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [ ] Documentation was added for features that require explanation or tutorials
- [ ] Unit or functional tests were updated or added to match the most common scenarios
- [ ] This was checked for keyboard-only and screenreader accessibility

For maintainers

@cqliu1 cqliu1 added bug Fixes for quality problems that affect the customer experience review release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort v8.0.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. v7.4.0 labels Aug 28, 2019
@cqliu1 cqliu1 requested a review from a team as a code owner August 28, 2019 18:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@cqliu1 cqliu1 requested a review from ryankeairns August 28, 2019 18:43
@cqliu1 cqliu1 force-pushed the fix/esdocs-default-index branch from 7bd1aeb to 4c4274e Compare August 28, 2019 19:00
@ryankeairns
Copy link
Contributor

ryankeairns commented Aug 28, 2019

I'm seeing the following error on step 3 when I 1) create the cluster then 2) add sample data:

Screenshot 2019-08-28 14 32 24

When I reverse those steps and do 1) add sample data then 2) create the cluster then I see:

Screenshot 2019-08-28 14 40 30

@spalger
Copy link
Contributor

spalger commented Aug 28, 2019

retest

@elasticmachine
Copy link
Contributor

💔 Build Failed

@cqliu1 cqliu1 force-pushed the fix/esdocs-default-index branch from 4c4274e to 7c4e7fb Compare August 29, 2019 20:15
@nik9000
Copy link
Member

nik9000 commented Aug 29, 2019

@elasticmachine run elasticsearch-ci/docs

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

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

Nice set of fixes. LGTM.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cqliu1 cqliu1 added the v7.5.0 label Sep 3, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Pulled down the latest, followed the steps, and successfully rendered the element!

@cqliu1 cqliu1 merged commit 39424f5 into elastic:master Sep 6, 2019
@cqliu1 cqliu1 deleted the fix/esdocs-default-index branch September 6, 2019 18:17
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Sep 6, 2019
… datasource bug fixes (elastic#44311)

* Sets index argument value as default index when index is not provided

* Checks if default index exists before retrieving the index pattern saved object

* Removed toLowerCase on index names

* Removed lower casing of index names
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Sep 6, 2019
… datasource bug fixes (elastic#44311)

* Sets index argument value as default index when index is not provided

* Checks if default index exists before retrieving the index pattern saved object

* Removed toLowerCase on index names

* Removed lower casing of index names
cqliu1 added a commit that referenced this pull request Sep 12, 2019
… datasource bug fixes (#44311) (#45035)

* Sets index argument value as default index when index is not provided

* Checks if default index exists before retrieving the index pattern saved object

* Removed toLowerCase on index names

* Removed lower casing of index names
cqliu1 added a commit that referenced this pull request Sep 13, 2019
… datasource bug fixes (#44311) (#45034)

* Sets index argument value as default index when index is not provided

* Checks if default index exists before retrieving the index pattern saved object

* Removed toLowerCase on index names

* Removed lower casing of index names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:fix review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.4.0 v7.5.0 v8.0.0
Projects
None yet
6 participants