Skip to content

Update API spec from results of the Java flight records loader #2019

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 2 commits into from
Feb 6, 2023

Conversation

swallez
Copy link
Member

@swallez swallez commented Feb 2, 2023

A collection or API spec fixes using flight-recorder recordings from a recent 8.7.0 snapshot and running them through the Java client's flight recordings validator. This validator is more strict than our JS/TS validator, and also reports unknown fields.

I've added the backport 7.17 label, even if only a limited number of fixes actually apply to that branch. I'll cherry-pick those that are relevant.

@@ -75,7 +61,7 @@ export class AggregationProfileDelegateDebugFilter {
}

export class AggregationProfile {
breakdown: AggregationBreakdown
breakdown: Dictionary<string, long>
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 made it a generic dictionary since this is what it is on the ES server, and the field names evolve quite often.

Copy link
Member

Choose a reason for hiding this comment

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

It'd be nice if we could ship the spec with an AggregrationBreakdownKeys that encodes known key constants into these dictionaries.

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.

I think I prefer the breakdowns as objects here over dictionaries since my understanding is the values aren't variable? Otherwise LGTM

@swallez
Copy link
Member Author

swallez commented Feb 6, 2023

I've reverted the changes to breakdowns, so that we can move forward with the other changes and take the time to think carefully about them. I've opened #2021 for this.

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.

LGTM

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

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

API Status Request Response
cat.aliases 🟢 24/24 24/24
cat.allocation 🟢 10/10 10/10
cat.component_templates Missing test Missing test
cat.count 🟢 9/9 9/9
cat.fielddata 🟢 6/6 6/6
cat.health 🟢 5/5 5/5
cat.help Missing test Missing test
cat.indices 🟢 33/33 32/32
cat.master 🟢 1/1 1/1
cat.ml_data_frame_analytics 🟢 5/5 5/5
cat.ml_datafeeds 🟢 4/4 4/4
cat.ml_jobs 🟢 4/4 4/4
cat.ml_trained_models 🟢 5/5 5/5
cat.nodeattrs 🟢 5/5 5/5
cat.nodes 🟢 11/11 11/11
cat.pending_tasks 🟢 1/1 1/1
cat.plugins 🟢 2/2 2/2
cat.recovery 🟢 6/6 6/6
cat.repositories 🟢 6/6 6/6
cat.segments 🟢 9/9 9/9
cat.shards 🟢 10/10 10/10
cat.snapshots 🟢 4/4 4/4
cat.tasks 🟢 11/11 11/11
cat.templates 🟢 14/14 14/14
cat.thread_pool 🟢 9/9 9/9
cat.transforms 🟢 5/5 5/5
cluster.reroute 🟢 6/6 5/5
cluster.stats 🔴 10/10 0/10
indices.rollover 🟢 26/26 26/26
indices.segments 🔴 6/6 5/6
indices.shard_stores 🔴 5/5 4/5
indices.stats 🟢 85/85 84/84
ml.clear_trained_model_deployment_cache 🟢 1/1 1/1
ml.close_job 🟢 64/64 63/63
ml.delete_calendar_event 🟢 4/4 4/4
ml.delete_calendar_job 🟢 3/3 3/3
ml.delete_calendar 🟢 5/5 5/5
ml.delete_data_frame_analytics 🟢 2/2 2/2
ml.delete_datafeed 🟢 3/3 3/3
ml.delete_expired_data 🟢 5/5 5/5
ml.delete_filter 🟢 27/27 27/27
ml.delete_forecast 🟢 3/3 3/3
ml.delete_job 🟢 47/47 47/47
ml.delete_model_snapshot 🟢 2/2 2/2
ml.delete_trained_model_alias 🟢 3/3 3/3
ml.delete_trained_model 🟢 3/3 3/3
ml.estimate_model_memory 🟢 16/16 16/16
ml.evaluate_data_frame 🟢 22/22 22/22
ml.explain_data_frame_analytics 🟢 7/7 7/7
ml.flush_job 🟢 15/15 15/15
ml.forecast 🟢 1/1 1/1
ml.get_buckets 🟢 14/14 14/14
ml.get_calendar_events 🟢 17/17 17/17
ml.get_calendars 🟢 17/17 17/17
ml.get_categories 🟢 12/12 12/12
ml.get_data_frame_analytics_stats 🟢 12/12 12/12
ml.get_data_frame_analytics 🟢 17/17 17/17
ml.get_datafeed_stats 🟢 27/27 27/27
ml.get_datafeeds 🟢 20/20 20/20
ml.get_filters 🟢 13/13 13/13
ml.get_influencers 🟢 11/11 11/11
ml.get_job_stats 🟢 32/32 32/32
ml.get_jobs 🔴 31/31 29/31
ml.get_memory_stats 🟢 6/6 6/6
ml.get_model_snapshot_upgrade_stats 🟢 3/3 3/3
ml.get_model_snapshots 🟢 18/18 18/18
ml.get_overall_buckets 🟢 16/16 15/15
ml.get_records 🟢 8/8 8/8
ml.get_trained_models_stats 🔴 16/16 10/16
ml.get_trained_models 🔴 23/29 29/29
ml.infer_trained_model 🔴 8/8 6/8
ml.info 🔴 10/10 2/10
ml.open_job 🟢 83/83 83/83
ml.post_calendar_events 🟢 21/21 21/21
ml.post_data 🔴 9/11 14/18
ml.preview_data_frame_analytics 🟢 3/3 3/3
ml.preview_datafeed 🔴 10/17 8/17
ml.put_calendar_job 🔴 11/12 12/12
ml.put_calendar 🟢 135/135 135/135
ml.put_data_frame_analytics 🟢 33/33 33/33
ml.put_datafeed 🔴 70/71 71/71
ml.put_filter 🟢 27/27 27/27
ml.put_job 🔴 219/227 224/225
ml.put_trained_model_alias 🟢 12/12 12/12
ml.put_trained_model_definition_part Missing test Missing test
ml.put_trained_model_vocabulary Missing test Missing test
ml.put_trained_model 🟢 4/4 4/4
ml.reset_job 🟢 2/2 2/2
ml.revert_model_snapshot 🟢 2/2 2/2
ml.set_upgrade_mode 🟢 6/6 6/6
ml.start_data_frame_analytics 🟢 1/1 1/1
ml.start_datafeed 🟢 24/24 24/24
ml.start_trained_model_deployment 🟢 9/9 9/9
ml.stop_data_frame_analytics 🟢 5/5 5/5
ml.stop_datafeed 🟢 17/17 17/17
ml.stop_trained_model_deployment 🟢 5/5 5/5
ml.update_data_frame_analytics 🟢 2/2 2/2
ml.update_datafeed 🟢 7/7 7/7
ml.update_filter 🟢 3/3 3/3
ml.update_job 🔴 4/5 1/5
ml.update_model_snapshot 🟢 3/3 3/3
ml.update_trained_model_deployment 🟠 Missing type Missing type
ml.upgrade_job_snapshot 🟢 3/3 3/3
ml.validate_detector 🟢 2/2 2/2
ml.validate 🟢 3/3 3/3
nodes.clear_repositories_metering_archive Missing test Missing test
nodes.get_repositories_metering_info Missing test Missing test
nodes.hot_threads 🔴 5/5 0/5
nodes.info 🔴 110/110 16/110
nodes.reload_secure_settings 🟢 2/2 2/2
nodes.stats 🔴 45/45 43/45
nodes.usage 🟢 1/1 1/1
rollup.get_rollup_caps 🟢 3/3 3/3
search_mvt 🔴 34/34 0/34
search 🔴 1638/1682 1625/1664
transform.get_transform_stats 🟢 32/32 32/32
xpack.usage 🔴 22/22 1/18

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

@swallez swallez merged commit 94dced0 into main Feb 6, 2023
@swallez swallez deleted the spec-fixes branch February 6, 2023 17:18
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

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-2019-to-7.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 94dced0edf8426138a83c8ff5ee7b33e25280ace
# Push it to GitHub
git push --set-upstream origin backport-2019-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-2019-to-7.17.

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.

3 participants