Skip to content

Comments

Support selecting an explicit method for apis in YAML specs.#141698

Merged
mosche merged 7 commits intoelastic:mainfrom
mosche:tests/yaml_do_method
Feb 6, 2026
Merged

Support selecting an explicit method for apis in YAML specs.#141698
mosche merged 7 commits intoelastic:mainfrom
mosche:tests/yaml_do_method

Conversation

@mosche
Copy link
Contributor

@mosche mosche commented Feb 3, 2026

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.

Relates to #140948

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
@mosche mosche marked this pull request as ready for review February 3, 2026 08:17
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.4.0 labels Feb 3, 2026
@mosche mosche added >test Issues or PRs that are addressing/adding tests :Core/Infra/Core Core issues without another label and removed needs:triage Requires assignment of a team area label v9.4.0 labels Feb 3, 2026
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 3, 2026
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@mosche mosche added auto-backport Automatically create backport pull requests when merged branch:9.2 branch:9.1 branch:8.19 branch:9.3 and removed Team:Core/Infra Meta label for core/infra team labels Feb 3, 2026
@mosche mosche requested a review from a team February 3, 2026 08:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for explicitly specifying HTTP methods in YAML test specifications to address backward compatibility (BWC) test issues. When an API specification defines multiple HTTP methods, tests previously randomly selected one, which could cause failures if certain methods weren't available in earlier versions. This change allows test authors to explicitly specify which method to use.

Changes:

  • Added a method parameter to API call infrastructure that propagates from YAML parsing through to HTTP request execution
  • Updated YAML parser to recognize and extract the method field from test specifications
  • Added validation to ensure explicitly specified methods are supported by the target API
  • Updated all YAML test client implementations to accept and forward the method parameter

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ApiCallSection.java Added method field with getter/setter and copy support
DoSection.java Updated parser to extract method parameter and pass it to ApiCallSection
DoSectionTests.java Added test case for parsing explicit method specification
ClientYamlTestClient.java Added method validation and selection logic with priority over random selection
ClientYamlTestExecutionContext.java Added method parameter to callApi methods with proper overload chaining
ClientYamlTestExecutionContextTests.java Updated test mocks to include method parameter
ImpersonateOfficialClientTestClient.java Added method parameter forwarding in override
ClientYamlDocsTestClient.java Added method parameter with proper variable naming to avoid conflicts with raw requests
CcsCommonYamlTestSuiteIT.java Added method parameter to override signature
cat.count/10_basic.yml Added explicit method: GET specifications to test cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mosche and others added 2 commits February 6, 2026 10:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mosche mosche merged commit 0241be6 into elastic:main Feb 6, 2026
35 checks passed
mosche added a commit to mosche/elasticsearch that referenced this pull request Feb 6, 2026
…#141698)

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
mosche added a commit to mosche/elasticsearch that referenced this pull request Feb 6, 2026
…#141698)

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
mosche added a commit to mosche/elasticsearch that referenced this pull request Feb 6, 2026
…#141698)

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
mosche added a commit to mosche/elasticsearch that referenced this pull request Feb 6, 2026
…#141698)

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.3
9.1
8.19
9.2

elasticsearchmachine pushed a commit that referenced this pull request Feb 6, 2026
#141999)

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
elasticsearchmachine pushed a commit that referenced this pull request Feb 6, 2026
#142000)

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
elasticsearchmachine pushed a commit that referenced this pull request Feb 6, 2026
#142002)

If a specification defines multiple methods for an api, the client randomly picks one. This can lead to BWC test issues if some method is not available in earlier versions and requires to explicitly select the method to use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v8.19.12 v9.1.11 v9.2.6 v9.3.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants