From 796d6a0b6a4db300a8f71343b81fc698b4333da1 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 27 Nov 2024 09:13:26 +0400 Subject: [PATCH 1/3] Use git recordings for pull request validation (#3182) (cherry picked from commit 81005994d0dc9ef1d0abef021322f3932216eebd) --- .github/workflows/validate-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 915eecd7b3..511d1ac0c2 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -59,7 +59,7 @@ jobs: else branch=$GITHUB_REF_NAME fi - node scripts/upload-recording/download.js --branch $branch + node scripts/upload-recording/download.js --branch $branch --git node scripts/clone-elasticsearch/index.js --branch $branch env: GCS_CREDENTIALS: ${{ secrets.GCS_CREDENTIALS }} From c3ca54879be3501af60dd6b9e98c22ce4d1b49c5 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 26 Nov 2024 21:43:20 +0400 Subject: [PATCH 2/3] Fix a few watcher.put_watcher tests --- output/openapi/elasticsearch-openapi.json | 16 +++-- output/schema/schema-serverless.json | 8 +-- output/schema/schema.json | 71 ++++++++++++++++++----- output/typescript/types.ts | 5 +- specification/watcher/_types/Input.ts | 16 ++++- 5 files changed, 89 insertions(+), 27 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 90f6b4ac3e..5baa266bf2 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -85701,11 +85701,19 @@ "properties": { "query": { "$ref": "#/components/schemas/_types.query_dsl:QueryContainer" + }, + "aggregations": { + "description": "Defines the aggregations that are run as part of the search request.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/_types.aggregations:AggregationContainer" + } + }, + "size": { + "description": "The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.", + "type": "number" } - }, - "required": [ - "query" - ] + } }, "watcher._types:SearchTemplateRequestBody": { "type": "object", diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index c950d26754..6c68217373 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -105178,7 +105178,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L39-L42" + "specLocation": "watcher/_types/Input.ts#L40-L43" }, { "docId": "cron-expressions", @@ -105360,7 +105360,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L59-L65" + "specLocation": "watcher/_types/Input.ts#L60-L66" }, { "kind": "enum", @@ -105379,7 +105379,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L100-L104" + "specLocation": "watcher/_types/Input.ts#L101-L105" }, { "kind": "enum", @@ -105495,7 +105495,7 @@ "name": "ResponseContentType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L106-L110" + "specLocation": "watcher/_types/Input.ts#L107-L111" }, { "codegenNames": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index f6cf034138..28b1015ba2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -210346,7 +210346,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L35-L37" + "specLocation": "watcher/_types/Input.ts#L36-L38" }, { "kind": "interface", @@ -210516,7 +210516,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L39-L42" + "specLocation": "watcher/_types/Input.ts#L40-L43" }, { "kind": "type_alias", @@ -211535,7 +211535,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L44-L48" + "specLocation": "watcher/_types/Input.ts#L45-L49" }, { "kind": "interface", @@ -211556,7 +211556,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L50-L52" + "specLocation": "watcher/_types/Input.ts#L51-L53" }, { "kind": "interface", @@ -211588,7 +211588,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L54-L57" + "specLocation": "watcher/_types/Input.ts#L55-L58" }, { "kind": "enum", @@ -211613,7 +211613,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L59-L65" + "specLocation": "watcher/_types/Input.ts#L60-L66" }, { "kind": "interface", @@ -211645,7 +211645,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L67-L70" + "specLocation": "watcher/_types/Input.ts#L68-L71" }, { "kind": "interface", @@ -211820,7 +211820,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L72-L86" + "specLocation": "watcher/_types/Input.ts#L73-L87" }, { "kind": "interface", @@ -212103,7 +212103,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L90-L98", + "specLocation": "watcher/_types/Input.ts#L91-L99", "variants": { "kind": "container" } @@ -212125,7 +212125,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L100-L104" + "specLocation": "watcher/_types/Input.ts#L101-L105" }, { "kind": "interface", @@ -212706,7 +212706,7 @@ "name": "ResponseContentType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L106-L110" + "specLocation": "watcher/_types/Input.ts#L107-L111" }, { "kind": "interface", @@ -213013,7 +213013,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L112-L116" + "specLocation": "watcher/_types/Input.ts#L113-L117" }, { "kind": "interface", @@ -213024,7 +213024,7 @@ "properties": [ { "name": "query", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -213032,9 +213032,48 @@ "namespace": "_types.query_dsl" } } + }, + { + "aliases": [ + "aggs" + ], + "description": "Defines the aggregations that are run as part of the search request.", + "name": "aggregations", + "required": false, + "type": { + "kind": "dictionary_of", + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "AggregationContainer", + "namespace": "_types.aggregations" + } + } + } + }, + { + "description": "The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.", + "name": "size", + "required": false, + "serverDefault": 10, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } } ], - "specLocation": "watcher/_types/Input.ts#L147-L149" + "specLocation": "watcher/_types/Input.ts#L148-L161" }, { "kind": "interface", @@ -213113,7 +213152,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L118-L125" + "specLocation": "watcher/_types/Input.ts#L119-L126" }, { "kind": "interface", @@ -213189,7 +213228,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L128-L145" + "specLocation": "watcher/_types/Input.ts#L129-L146" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 71edde2dac..cc578876d3 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -20326,7 +20326,10 @@ export interface WatcherSearchInput { } export interface WatcherSearchInputRequestBody { - query: QueryDslQueryContainer + query?: QueryDslQueryContainer + aggregations?: Record + aggs?: Record + size?: integer } export interface WatcherSearchInputRequestDefinition { diff --git a/specification/watcher/_types/Input.ts b/specification/watcher/_types/Input.ts index 7504ab6c9e..943fcb45fb 100644 --- a/specification/watcher/_types/Input.ts +++ b/specification/watcher/_types/Input.ts @@ -19,6 +19,7 @@ import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' +import { AggregationContainer } from '@_types/aggregations/AggregationContainer' import { Id, IndexName, @@ -28,7 +29,7 @@ import { Username } from '@_types/common' import { Host } from '@_types/Networking' -import { uint } from '@_types/Numeric' +import { integer, uint } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Duration } from '@_types/Time' @@ -145,7 +146,18 @@ export class SearchTemplateRequestBody { } export class SearchInputRequestBody { - query: QueryContainer + query?: QueryContainer + /** + * Defines the aggregations that are run as part of the search request. + * @aliases aggs */ // ES uses "aggregations" in serialization + aggregations?: Dictionary + /** + * The number of hits to return. + * By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. + * To page through more hits, use the `search_after` parameter. + * @server_default 10 + */ + size?: integer } export class SimpleInput { From 679382d0f15293ea0be935d9af8e9aeaf431441b Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 27 Nov 2024 09:19:10 +0400 Subject: [PATCH 3/3] Revert "Fix a few watcher.put_watcher tests" This reverts commit c3ca54879be3501af60dd6b9e98c22ce4d1b49c5. --- output/openapi/elasticsearch-openapi.json | 16 ++--- output/schema/schema-serverless.json | 8 +-- output/schema/schema.json | 71 +++++------------------ output/typescript/types.ts | 5 +- specification/watcher/_types/Input.ts | 16 +---- 5 files changed, 27 insertions(+), 89 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 5baa266bf2..90f6b4ac3e 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -85701,19 +85701,11 @@ "properties": { "query": { "$ref": "#/components/schemas/_types.query_dsl:QueryContainer" - }, - "aggregations": { - "description": "Defines the aggregations that are run as part of the search request.", - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/_types.aggregations:AggregationContainer" - } - }, - "size": { - "description": "The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.", - "type": "number" } - } + }, + "required": [ + "query" + ] }, "watcher._types:SearchTemplateRequestBody": { "type": "object", diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 6c68217373..c950d26754 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -105178,7 +105178,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L40-L43" + "specLocation": "watcher/_types/Input.ts#L39-L42" }, { "docId": "cron-expressions", @@ -105360,7 +105360,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L60-L66" + "specLocation": "watcher/_types/Input.ts#L59-L65" }, { "kind": "enum", @@ -105379,7 +105379,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L101-L105" + "specLocation": "watcher/_types/Input.ts#L100-L104" }, { "kind": "enum", @@ -105495,7 +105495,7 @@ "name": "ResponseContentType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L107-L111" + "specLocation": "watcher/_types/Input.ts#L106-L110" }, { "codegenNames": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 28b1015ba2..f6cf034138 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -210346,7 +210346,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L36-L38" + "specLocation": "watcher/_types/Input.ts#L35-L37" }, { "kind": "interface", @@ -210516,7 +210516,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L40-L43" + "specLocation": "watcher/_types/Input.ts#L39-L42" }, { "kind": "type_alias", @@ -211535,7 +211535,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L45-L49" + "specLocation": "watcher/_types/Input.ts#L44-L48" }, { "kind": "interface", @@ -211556,7 +211556,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L51-L53" + "specLocation": "watcher/_types/Input.ts#L50-L52" }, { "kind": "interface", @@ -211588,7 +211588,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L55-L58" + "specLocation": "watcher/_types/Input.ts#L54-L57" }, { "kind": "enum", @@ -211613,7 +211613,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L60-L66" + "specLocation": "watcher/_types/Input.ts#L59-L65" }, { "kind": "interface", @@ -211645,7 +211645,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L68-L71" + "specLocation": "watcher/_types/Input.ts#L67-L70" }, { "kind": "interface", @@ -211820,7 +211820,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L73-L87" + "specLocation": "watcher/_types/Input.ts#L72-L86" }, { "kind": "interface", @@ -212103,7 +212103,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L91-L99", + "specLocation": "watcher/_types/Input.ts#L90-L98", "variants": { "kind": "container" } @@ -212125,7 +212125,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L101-L105" + "specLocation": "watcher/_types/Input.ts#L100-L104" }, { "kind": "interface", @@ -212706,7 +212706,7 @@ "name": "ResponseContentType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L107-L111" + "specLocation": "watcher/_types/Input.ts#L106-L110" }, { "kind": "interface", @@ -213013,7 +213013,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L113-L117" + "specLocation": "watcher/_types/Input.ts#L112-L116" }, { "kind": "interface", @@ -213024,7 +213024,7 @@ "properties": [ { "name": "query", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -213032,48 +213032,9 @@ "namespace": "_types.query_dsl" } } - }, - { - "aliases": [ - "aggs" - ], - "description": "Defines the aggregations that are run as part of the search request.", - "name": "aggregations", - "required": false, - "type": { - "kind": "dictionary_of", - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - "singleKey": false, - "value": { - "kind": "instance_of", - "type": { - "name": "AggregationContainer", - "namespace": "_types.aggregations" - } - } - } - }, - { - "description": "The number of hits to return.\nBy default, you cannot page through more than 10,000 hits using the `from` and `size` parameters.\nTo page through more hits, use the `search_after` parameter.", - "name": "size", - "required": false, - "serverDefault": 10, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } } ], - "specLocation": "watcher/_types/Input.ts#L148-L161" + "specLocation": "watcher/_types/Input.ts#L147-L149" }, { "kind": "interface", @@ -213152,7 +213113,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L119-L126" + "specLocation": "watcher/_types/Input.ts#L118-L125" }, { "kind": "interface", @@ -213228,7 +213189,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L129-L146" + "specLocation": "watcher/_types/Input.ts#L128-L145" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index cc578876d3..71edde2dac 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -20326,10 +20326,7 @@ export interface WatcherSearchInput { } export interface WatcherSearchInputRequestBody { - query?: QueryDslQueryContainer - aggregations?: Record - aggs?: Record - size?: integer + query: QueryDslQueryContainer } export interface WatcherSearchInputRequestDefinition { diff --git a/specification/watcher/_types/Input.ts b/specification/watcher/_types/Input.ts index 943fcb45fb..7504ab6c9e 100644 --- a/specification/watcher/_types/Input.ts +++ b/specification/watcher/_types/Input.ts @@ -19,7 +19,6 @@ import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { AggregationContainer } from '@_types/aggregations/AggregationContainer' import { Id, IndexName, @@ -29,7 +28,7 @@ import { Username } from '@_types/common' import { Host } from '@_types/Networking' -import { integer, uint } from '@_types/Numeric' +import { uint } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Duration } from '@_types/Time' @@ -146,18 +145,7 @@ export class SearchTemplateRequestBody { } export class SearchInputRequestBody { - query?: QueryContainer - /** - * Defines the aggregations that are run as part of the search request. - * @aliases aggs */ // ES uses "aggregations" in serialization - aggregations?: Dictionary - /** - * The number of hits to return. - * By default, you cannot page through more than 10,000 hits using the `from` and `size` parameters. - * To page through more hits, use the `search_after` parameter. - * @server_default 10 - */ - size?: integer + query: QueryContainer } export class SimpleInput {