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

Fix spec issues reported in the Java client #1723

Merged
merged 5 commits into from
May 24, 2022
Merged

Fix spec issues reported in the Java client #1723

merged 5 commits into from
May 24, 2022

Conversation

swallez
Copy link
Member

@swallez swallez commented May 23, 2022

This PR fixes a number of API spec issues that were reported in the Java client. We're experimenting a batch processing of these issue, as they are most of the time very tiny problems such as missing fields or required fields that should be optional.

This PR has 2 larger changes: the new dynamic_property property type, and a refactoring of Higlight and HighlightField with a common base class, as they have most attribute in common (same in the ES code base).

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Changes look good to me, had one question about the Slices type:

* Uses sliced scroll to parallelize process. Using `auto` chooses a reasonable number for most data streams
* and indices.
*
* @codegen_names value, auto
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the name auto here still make sense if another value is added to the enum?

Copy link
Contributor

Choose a reason for hiding this comment

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

It does, auto is a special value for this field which is translated to 0 on ES side. Providing 0 in the payload doesn't apply the same behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

After a discussion with @technige we ended up considering that all is the name of a function used to compute the number of slices. There's only one such function as of now, but there could be others. So this becomes:

/**
 * Slices configuration used to parallelize a process.
 *
 * @codegen_names value, computed
 */
export type Slices = integer | SlicesCalculation

/**
 * Named computations to calculate the number of slices
 */
export enum SlicesCalculation {
  /**
   * Let Elasticsearch choose a reasonable number for most data streams and indices.
   */
  auto
}

@github-actions
Copy link
Contributor

Following you can find the validation results for the APIs you have changed.

API Status Request Response
delete_by_query 🟢 5/5 4/4
ilm.delete_lifecycle 🟢 2/2 2/2
ilm.explain_lifecycle 🟢 5/5 5/5
ilm.get_lifecycle 🟢 8/8 8/8
ilm.get_status 🟢 4/4 4/4
ilm.migrate_to_data_tiers Missing test Missing test
ilm.move_to_step Missing test Missing test
ilm.put_lifecycle 🟢 6/6 6/6
ilm.remove_policy 🟢 5/5 5/5
ilm.retry Missing test Missing test
ilm.start Missing test Missing test
ilm.stop 🟢 4/4 4/4
indices.analyze 🟢 20/20 20/20
msearch 🟢 17/17 16/16
reindex 🟢 15/15 14/14
search 🔴 1491/1526 1505/1508
security.create_api_key 🔴 18/25 16/16
security.get_service_accounts Missing test Missing test
termvectors 🟢 7/7 7/7
update_by_query 🟢 5/5 4/4

You can validate these APIs yourself by using the make validate target.

@swallez swallez merged commit da53b6e into main May 24, 2022
@swallez swallez deleted the misc-java-fixes branch May 24, 2022 14:40
@github-actions
Copy link
Contributor

The backport to 7.17 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.17 7.17
# Navigate to the new working tree
cd .worktrees/backport-7.17
# Create a new branch
git switch --create backport-1723-to-7.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 da53b6e6dc15c9a721c96aee24c4d25c0747fd6a
# Push it to GitHub
git push --set-upstream origin backport-1723-to-7.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.17

Then, create a pull request where the base branch is 7.17 and the compare/head branch is backport-1723-to-7.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants