Skip to content

Fix indices/ validation errors #4018

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

Merged
merged 1 commit into from
Mar 19, 2025
Merged

Fix indices/ validation errors #4018

merged 1 commit into from
Mar 19, 2025

Conversation

pquentin
Copy link
Member

The remaining indices.put_template error is on the rest-api-spec side.

Copy link
Contributor

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

API Status Request Response
indices.analyze 🟢 243/243 243/243
indices.clear_cache 🟢 4/4 4/4
indices.exists_index_template Missing test Missing test
indices.field_usage_stats 🟢 5/5 5/5
indices.put_settings 🔴 56/58 58/58
indices.reload_search_analyzers 🟢 2/2 2/2
indices.rollover 🔴 26/26 1/26
indices.simulate_index_template 🔴 6/7 5/7
indices.simulate_template 🔴 5/5 4/5

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

Comment on lines +62 to +70
query_parameters: {
/**
* Index used to derive the analyzer.
* If specified, the `analyzer` or field parameter overrides this value.
* If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer.
* @doc_id analysis-standard-analyzer
*/
index?: IndexName
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +57 to +62
/**
* Comma-separated list of data streams, indices, and aliases used to limit the request.
* Supports wildcards (`*`).
* To target all data streams and indices, omit this parameter or use `*` or `_all`.
*/
index?: Indices
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +45 to +54
/**
* If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node.
* @server_default false
*/
local?: boolean
/**
* If true, returns settings in flat format.
* @server_default false
*/
flat_settings?: boolean
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know where those settings are read, but can confirm that they are accepted by the API. It's a bit weird because they don't have any practical effect, but that's how HEAD works and the symmetry with the get_index_template API can be useful.

Copy link
Contributor

Choose a reason for hiding this comment

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

somewhere here I suspect. and yes it's exactly the same API so let's keep them in sync

Copy link
Contributor

Choose a reason for hiding this comment

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

ah here's local

Comment on lines -77 to -82
/**
* The number of shard copies that must be active before proceeding with the operation.
* Set to all or any positive integer up to the total number of shards in the index (`number_of_replicas+1`).
* @server_default 1
*/
wait_for_active_shards?: WaitForActiveShards
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +108 to +114
/**
* Whether to close and reopen the index to apply non-dynamic settings.
* If set to `true` the indices to which the settings are being applied
* will be closed temporarily and then reopened in order to apply the changes.
* @server_default false
*/
reopen?: boolean
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +58 to +61
/**
* Changed resource to reload analyzers from if applicable
*/
resource?: string
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +121 to +126
/**
* If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write.
* Only allowed on data streams.
* @server_default false
*/
lazy?: boolean
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +45 to +53
/**
* Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one
* @server_default false
*/
create?: boolean
/** User defined reason for dry-run creating the new template for simulation purposes
* @server_default false
*/
cause?: string
Copy link
Member Author

Choose a reason for hiding this comment

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

Comment on lines +60 to +63
/**
* User defined reason for dry-run creating the new template for simulation purposes
*/
cause?: string
Copy link
Member Author

Choose a reason for hiding this comment

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

@pquentin pquentin requested review from flobernd and l-trotta March 19, 2025 07:17
Comment on lines 107 to 112
"indices.put_template": {
"request": [
"Request: query parameter 'cause' does not exist in the json spec"
],
"response": []
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@l-trotta l-trotta 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 thoroughly checking all of these!

@pquentin pquentin merged commit 10af925 into main Mar 19, 2025
15 of 16 checks passed
@pquentin pquentin deleted the indices-validation-errors branch March 19, 2025 10:55
Copy link
Contributor

The backport to 8.x 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-8.x 8.x
# Navigate to the new working tree
cd .worktrees/backport-8.x
# Create a new branch
git switch --create backport-4018-to-8.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 10af925072a632ec236ef50dc72a0c039314db2a
# Push it to GitHub
git push --set-upstream origin backport-4018-to-8.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.x

Then, create a pull request where the base branch is 8.x and the compare/head branch is backport-4018-to-8.x.

Copy link
Contributor

The backport to 8.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-8.17 8.17
# Navigate to the new working tree
cd .worktrees/backport-8.17
# Create a new branch
git switch --create backport-4018-to-8.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 10af925072a632ec236ef50dc72a0c039314db2a
# Push it to GitHub
git push --set-upstream origin backport-4018-to-8.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.17

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

Copy link
Contributor

The backport to 8.18 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-8.18 8.18
# Navigate to the new working tree
cd .worktrees/backport-8.18
# Create a new branch
git switch --create backport-4018-to-8.18
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 10af925072a632ec236ef50dc72a0c039314db2a
# Push it to GitHub
git push --set-upstream origin backport-4018-to-8.18
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.18

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

github-actions bot pushed a commit that referenced this pull request Mar 19, 2025
pquentin added a commit that referenced this pull request Mar 19, 2025
(cherry picked from commit 10af925)

# Conflicts:
#	output/openapi/elasticsearch-serverless-openapi.json
#	output/schema/validation-errors.json
pquentin added a commit that referenced this pull request Mar 19, 2025
(cherry picked from commit 10af925)

# Conflicts:
#	output/openapi/elasticsearch-serverless-openapi.json
#	output/schema/validation-errors.json
@pquentin
Copy link
Member Author

💔 Some backports could not be created

Status Branch Result
8.x
8.18
8.17 Conflict resolution was aborted by the user

Manual backport

To create the backport manually run:

backport --pr 4018

Questions ?

Please refer to the Backport tool documentation

pquentin added a commit that referenced this pull request Mar 19, 2025
(cherry picked from commit 10af925)

# Conflicts:
#	output/openapi/elasticsearch-serverless-openapi.json
#	output/schema/validation-errors.json
pquentin added a commit that referenced this pull request Mar 19, 2025
(cherry picked from commit 10af925)

# Conflicts:
#	output/openapi/elasticsearch-serverless-openapi.json
#	output/schema/validation-errors.json
pquentin added a commit that referenced this pull request Mar 19, 2025
(cherry picked from commit 10af925)

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
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.

2 participants