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

ESQL: Make esql version required in REST requests #107433

Merged
merged 28 commits into from
Apr 16, 2024

Conversation

alex-spies
Copy link
Contributor

@alex-spies alex-spies commented Apr 12, 2024

  • Enable corresponding validation in EsqlQueryRequest.
  • Add the ES|QL version to all requests to /_query in integration tests.

For mixed cluster tests, impersonates a language client with version 8.13, the only exception in which we do not require the version to be sent (based on #107497 by @nik9000 ).

Fix #107403
Main part of #104890

This will make the CI blow up and show us what needs updating.
@alex-spies alex-spies force-pushed the esql-version-in-integration-tests branch from 4dc60c1 to 83bb2f6 Compare April 12, 2024 16:08
nik9000 and others added 7 commits April 16, 2024 10:44
In the ESQL quests for upgrading from older versions of Elasticsearch
this will pretend to be and old version of the elasticsearch client and
not send a `version` in the body. Old clients will instead default to
the first version of ESQL. This should allow us to run these tests even
when `version` is required.

Tests against newer versions of Elasticsearch will then specify a
`version`.

Co-authored-by: Nik Everett <[email protected]>
// TODO: make this required
// "https://github.com/elastic/elasticsearch/issues/104890"
// validationException = addValidationError(invalidVersion("is required"), validationException);
validationException = addValidationError(invalidVersion("is required"), validationException);
Copy link
Contributor Author

@alex-spies alex-spies Apr 16, 2024

Choose a reason for hiding this comment

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

I want to revert this before merging and create a separate PR for it, so that the actual - breaking - API change becomes a single, small PR that can be easily reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind, discussed with @nik9000 : we can still revert just this in case something goes wrong.

Copy link
Member

Choose a reason for hiding this comment

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

We're going to keep this in to save the few hours of build time. If something goes wrong we can back out just this line if we have to.

@alex-spies alex-spies added the >test Issues or PRs that are addressing/adding tests label Apr 16, 2024
@@ -44,4 +50,40 @@ private void assertRequestBreakerEmpty() throws Exception {
*/
EsqlSpecTestCase.assertRequestBreakerEmpty();
}

public static Iterable<Object[]> updateEsqlQueryDoSections(Iterable<Object[]> parameters, Function<DoSection, ExecutableSection> modify)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored x-pack/plugin/esql/qa/server/single-node/src/yamlRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/EsqlClientYamlAsyncIT.java a little bit, but failed moving this into a place to be used by multiple yaml tests from :/

Comment on lines +183 to +185
if (version != null) {
builder.field("version", version);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Small improvement stolen from @nik9000

@alex-spies alex-spies added the :Analytics/ES|QL AKA ESQL label Apr 16, 2024
@alex-spies alex-spies marked this pull request as ready for review April 16, 2024 11:39
@alex-spies alex-spies requested a review from a team as a code owner April 16, 2024 11:39
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 16, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@alex-spies alex-spies requested a review from nik9000 April 16, 2024 14:09
@alex-spies alex-spies changed the title ESQL: Version parameter in integration tests ESQL: Make esql version required in REST requests Apr 16, 2024
// TODO: make this required
// "https://github.com/elastic/elasticsearch/issues/104890"
// validationException = addValidationError(invalidVersion("is required"), validationException);
validationException = addValidationError(invalidVersion("is required"), validationException);
Copy link
Member

Choose a reason for hiding this comment

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

We're going to keep this in to save the few hours of build time. If something goes wrong we can back out just this line if we have to.

@alex-spies alex-spies merged commit 1e4d4da into elastic:main Apr 16, 2024
14 checks passed
@alex-spies alex-spies deleted the esql-version-in-integration-tests branch April 16, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.14.0
Projects
None yet
3 participants