Skip to content

Conversation

@swallez
Copy link
Contributor

@swallez swallez commented Jun 8, 2021

Follow-up to #73434

Ensures that High Level Rest Client is running against a verified
Elasticsearch. When the first request is sent on HLRC, a request to the
info endpoint is made first to verify the product identification and
version.

@swallez swallez requested a review from dakrone June 8, 2021 15:31
@swallez swallez self-assigned this Jun 8, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (Team:Core/Features)

@elasticsearchmachine elasticsearchmachine added the external-contributor Pull request authored by a developer outside the Elasticsearch team label Jun 8, 2021
@swallez
Copy link
Contributor Author

swallez commented Jun 8, 2021

Build failures are because #73434 has not been backported to 7.x (see #73434 (comment)). The code is ready for review though.

@dakrone dakrone requested a review from jbaiera June 8, 2021 17:25
@swallez swallez force-pushed the check-product-compatibility branch from 8cf8b0b to 352f276 Compare June 9, 2021 09:52
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @swallez, I left some comments

@dakrone dakrone added :Core/Features/Java High Level REST Client and removed external-contributor Pull request authored by a developer outside the Elasticsearch team labels Jun 10, 2021
Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for iterating on this. I left a few other minor nits but nothing major.

Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment about how this essentially acts as a memoized method? Before fully understanding this code I assumed it was doing the version check for every request, rather than once and then return a completed future with an optional string.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return Optional.of("Elasticsearch version 6 or more is required");
return Optional.of("Elasticsearch version 6 or higher is required");

Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

A quick note about compatibility coverage that should be addressed before merge:

Copy link
Member

Choose a reason for hiding this comment

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

We should perform additional validation here of build_flavor and taglines.

Copy link
Member

Choose a reason for hiding this comment

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

I think we want to do the tagline validation here as well.

swallez added 6 commits June 16, 2021 19:19
Follow-up to elastic#73434

Ensures that High Level Rest Client is running against a verified
Elasticsearch. When the first request is send on HLRC, a request to the
info endpoint is made first to verify the product identification and
version.
@swallez swallez force-pushed the check-product-compatibility branch from ec19ee3 to 115e9d1 Compare June 16, 2021 17:19
@swallez
Copy link
Contributor Author

swallez commented Jun 17, 2021

@dakrone I added some comments and refactored a bit in 115e9d1 and 94d88f7: cancelFlag is now a cancellationForwarder that is effectively cancelled. This should make things clearer.

@jbaiera I added build flavor and tagline validation in ceb527a and b87302d

Can you both please cross-check? Thanks!

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

I think we need to support OSS builds here also, so we need to change the build flavor check

Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @swallez!

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM also, thanks for doing this @swallez!

@swallez
Copy link
Contributor Author

swallez commented Jun 17, 2021

Thank you both for your patience! Now waiting for CI to hopefully be happy and I'll hit that merge button 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants