From 358d02b99f7c3414adda5696bfac83b00d566a30 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 4671fe89f12dcbd467433af14f709521df9c8557 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 69acf16af1..ae4c4c563b 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -85893,11 +85893,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 3f649a3647..72b02bc315 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -105202,7 +105202,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L39-L42" + "specLocation": "watcher/_types/Input.ts#L40-L43" }, { "docId": "cron-expressions", @@ -105384,7 +105384,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L59-L65" + "specLocation": "watcher/_types/Input.ts#L60-L66" }, { "kind": "enum", @@ -105403,7 +105403,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L100-L104" + "specLocation": "watcher/_types/Input.ts#L101-L105" }, { "kind": "enum", @@ -105519,7 +105519,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 bf1df8a3a5..1f95145cfe 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -210803,7 +210803,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L35-L37" + "specLocation": "watcher/_types/Input.ts#L36-L38" }, { "kind": "interface", @@ -210973,7 +210973,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L39-L42" + "specLocation": "watcher/_types/Input.ts#L40-L43" }, { "kind": "type_alias", @@ -211992,7 +211992,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L44-L48" + "specLocation": "watcher/_types/Input.ts#L45-L49" }, { "kind": "interface", @@ -212013,7 +212013,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L50-L52" + "specLocation": "watcher/_types/Input.ts#L51-L53" }, { "kind": "interface", @@ -212045,7 +212045,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L54-L57" + "specLocation": "watcher/_types/Input.ts#L55-L58" }, { "kind": "enum", @@ -212070,7 +212070,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L59-L65" + "specLocation": "watcher/_types/Input.ts#L60-L66" }, { "kind": "interface", @@ -212102,7 +212102,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L67-L70" + "specLocation": "watcher/_types/Input.ts#L68-L71" }, { "kind": "interface", @@ -212277,7 +212277,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L72-L86" + "specLocation": "watcher/_types/Input.ts#L73-L87" }, { "kind": "interface", @@ -212560,7 +212560,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L90-L98", + "specLocation": "watcher/_types/Input.ts#L91-L99", "variants": { "kind": "container" } @@ -212582,7 +212582,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L100-L104" + "specLocation": "watcher/_types/Input.ts#L101-L105" }, { "kind": "interface", @@ -213163,7 +213163,7 @@ "name": "ResponseContentType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L106-L110" + "specLocation": "watcher/_types/Input.ts#L107-L111" }, { "kind": "interface", @@ -213470,7 +213470,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L112-L116" + "specLocation": "watcher/_types/Input.ts#L113-L117" }, { "kind": "interface", @@ -213481,7 +213481,7 @@ "properties": [ { "name": "query", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -213489,9 +213489,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", @@ -213570,7 +213609,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L118-L125" + "specLocation": "watcher/_types/Input.ts#L119-L126" }, { "kind": "interface", @@ -213646,7 +213685,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 4948d3096f..7aa09f6ed0 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -20358,7 +20358,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 9ad40ada11171e2021ff0060aae41185d1af2598 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 27 Nov 2024 09:20:36 +0400 Subject: [PATCH 3/3] Revert "Fix a few watcher.put_watcher tests" This reverts commit 4671fe89f12dcbd467433af14f709521df9c8557. --- 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 ae4c4c563b..69acf16af1 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -85893,19 +85893,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 72b02bc315..3f649a3647 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -105202,7 +105202,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L40-L43" + "specLocation": "watcher/_types/Input.ts#L39-L42" }, { "docId": "cron-expressions", @@ -105384,7 +105384,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L60-L66" + "specLocation": "watcher/_types/Input.ts#L59-L65" }, { "kind": "enum", @@ -105403,7 +105403,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L101-L105" + "specLocation": "watcher/_types/Input.ts#L100-L104" }, { "kind": "enum", @@ -105519,7 +105519,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 1f95145cfe..bf1df8a3a5 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -210803,7 +210803,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L36-L38" + "specLocation": "watcher/_types/Input.ts#L35-L37" }, { "kind": "interface", @@ -210973,7 +210973,7 @@ "name": "ConnectionScheme", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L40-L43" + "specLocation": "watcher/_types/Input.ts#L39-L42" }, { "kind": "type_alias", @@ -211992,7 +211992,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L45-L49" + "specLocation": "watcher/_types/Input.ts#L44-L48" }, { "kind": "interface", @@ -212013,7 +212013,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L51-L53" + "specLocation": "watcher/_types/Input.ts#L50-L52" }, { "kind": "interface", @@ -212045,7 +212045,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L55-L58" + "specLocation": "watcher/_types/Input.ts#L54-L57" }, { "kind": "enum", @@ -212070,7 +212070,7 @@ "name": "HttpInputMethod", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L60-L66" + "specLocation": "watcher/_types/Input.ts#L59-L65" }, { "kind": "interface", @@ -212102,7 +212102,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L68-L71" + "specLocation": "watcher/_types/Input.ts#L67-L70" }, { "kind": "interface", @@ -212277,7 +212277,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L73-L87" + "specLocation": "watcher/_types/Input.ts#L72-L86" }, { "kind": "interface", @@ -212560,7 +212560,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L91-L99", + "specLocation": "watcher/_types/Input.ts#L90-L98", "variants": { "kind": "container" } @@ -212582,7 +212582,7 @@ "name": "InputType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L101-L105" + "specLocation": "watcher/_types/Input.ts#L100-L104" }, { "kind": "interface", @@ -213163,7 +213163,7 @@ "name": "ResponseContentType", "namespace": "watcher._types" }, - "specLocation": "watcher/_types/Input.ts#L107-L111" + "specLocation": "watcher/_types/Input.ts#L106-L110" }, { "kind": "interface", @@ -213470,7 +213470,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L113-L117" + "specLocation": "watcher/_types/Input.ts#L112-L116" }, { "kind": "interface", @@ -213481,7 +213481,7 @@ "properties": [ { "name": "query", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -213489,48 +213489,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", @@ -213609,7 +213570,7 @@ } } ], - "specLocation": "watcher/_types/Input.ts#L119-L126" + "specLocation": "watcher/_types/Input.ts#L118-L125" }, { "kind": "interface", @@ -213685,7 +213646,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 7aa09f6ed0..4948d3096f 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -20358,10 +20358,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 {