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

Updating Console to work with ES 5.0 APIs #6925

Merged
merged 9 commits into from
Apr 27, 2016

Conversation

ycombinator
Copy link
Contributor

@ycombinator ycombinator commented Apr 14, 2016

Resolves #6913

@ycombinator ycombinator self-assigned this Apr 14, 2016
@ycombinator ycombinator changed the title Updating Console to work with ES 5.0 APIs [WIP] Updating Console to work with ES 5.0 APIs Apr 14, 2016
@ycombinator ycombinator changed the title [WIP] Updating Console to work with ES 5.0 APIs Updating Console to work with ES 5.0 APIs Apr 14, 2016
@ycombinator ycombinator assigned spalger and unassigned ycombinator Apr 14, 2016
@ycombinator
Copy link
Contributor Author

I made these changes by looking at https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-5.0.html and all the sub-pages linked off that page.

@rashidkpc
Copy link
Contributor

I'm not familiar with the Sense code base. How the heck do we test these sort of changes?

@ycombinator
Copy link
Contributor Author

ycombinator commented Apr 14, 2016

I manually tested them by issuing the bad (no longer supported) requests to Elasticsearch 5.0, made sure Elasticsearch returned an error, then removed the corresponding autocomplete rules from Console.

'properties': {
'*': {
type: {
__one_of: ['string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',
__one_of: ['text', 'keyword', 'string', 'float', 'double', 'byte', 'short', 'integer', 'long', 'date', 'boolean',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove string

@ycombinator
Copy link
Contributor Author

General comment: Remove deprecated stuff. Its more important that Console nudges users in the right direction than support everything that's valid for a particular version of ES.

}
});
api.addEndpointDescription(endpoint, {
match: endpoint,
Copy link
Contributor

Choose a reason for hiding this comment

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

These don't also get a methods like below?

Copy link
Contributor Author

@ycombinator ycombinator Apr 27, 2016

Choose a reason for hiding this comment

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

It looks like this is so because methods defaults to ['GET'] as per https://github.com/ycombinator/kibana/blob/gh-6913/src/plugins/console/api_server/api.js#L27-L31. That being said, I agree that this is inconsistent — sometimes methods: ['GET'] is explicitly specified in the call to addEndpointDescription and sometimes it is not.

I think this should be cleaned up and made consistent but I'd like to scope this cleanup to the code under the es_5_0 folder only, as the scope of this PR is to make Console work with ES 5.0 APIs. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would have to agree with you man! No worries I was mainly asking here to try and assess the differences between this function and the one below it. I would have to definitely agree that this should be deferred to the scope of another PR.

script: {
// populated by a global rule
}
}, field_metric = {
Copy link
Contributor

Choose a reason for hiding this comment

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

This goes against our style guide with comma separated var instantiation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @panda01. I think the entire Console codebase needs to be brought up to speed with the Kibana style guide, now that Console is part of Kibana core. I would prefer to do that outside this PR to keep the changes here scoped to making Console work with Elasticsearch 5.0 APIs. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

As i mentioned above, this is cool to be pushed to something else, this is a big PR already.

var version = es.getVersion() || [];
var api;

switch (version[0]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sexy...

@epixa
Copy link
Contributor

epixa commented Apr 27, 2016

LGTM

@ycombinator ycombinator merged commit 68a198c into elastic:master Apr 27, 2016
@ycombinator ycombinator deleted the gh-6913 branch April 27, 2016 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants