From af850bfdd9d42ff975dd5d029fcc0bc3bfd2bc4d Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Mon, 16 Sep 2024 12:05:18 +0100 Subject: [PATCH 01/11] Update pattern regex, and use the deprecation logger --- .../java/org/elasticsearch/common/time/DateUtils.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java index 849a64f307f7a..29510a553fac9 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java @@ -13,7 +13,6 @@ import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.core.Predicates; import org.elasticsearch.core.UpdateForV9; -import org.elasticsearch.logging.LogManager; import java.time.Clock; import java.time.Duration; @@ -391,13 +390,17 @@ public static ZonedDateTime nowWithMillisResolution(Clock clock) { // check for all textual fields, and localized zone offset private static final Predicate CONTAINS_CHANGING_TEXT_SPECIFIERS = System.getProperty("java.locale.providers", "") - .contains("COMPAT") ? Pattern.compile("[EcGaO]|MMM|LLL|eee|ccc|QQQ|ZZZZ").asPredicate() : Predicates.never(); + .contains("COMPAT") ? Pattern.compile("[BEGOavz]|LLL|MMM|QQQ|ccc|eee|ZZZZ").asPredicate() : Predicates.never(); @UpdateForV9 // this can be removed, we will only use CLDR on v9 static void checkTextualDateFormats(String format) { if (CONTAINS_CHANGING_TEXT_SPECIFIERS.test(format)) { - LogManager.getLogger(DateFormatter.class) - .warn("Date format [{}] contains textual field specifiers that could change in JDK 23", format); + deprecationLogger.warn( + DeprecationCategory.PARSING, + "cldr_date_formats_" + format, + "Date format [{}] contains field specifiers that could change in JDK 23", + format + ); } } } From 190632de74d76fd2a4d436abed48f0899b88fe63 Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Mon, 16 Sep 2024 12:28:27 +0100 Subject: [PATCH 02/11] Match only 4 Z Update some tests --- .../rest-api-spec/test/ingest/30_date_processor.yml | 2 ++ .../test/search/180_locale_dependent_mapping.yml | 5 +++++ .../main/java/org/elasticsearch/common/time/DateUtils.java | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml index 78fb895ea791c..c3afc32e78306 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml @@ -97,6 +97,8 @@ teardown: "Test date processor with no timezone configured": - do: + allowed_warnings_regex: + - 'Date format \[dd/MMM/yyyy:H:m:s Z] contains field specifiers that could change in JDK 23' ingest.put_pipeline: id: "my_pipeline" # sample formats from beats, featuring mongodb, icinga, apache diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml index 7c345b7d4d3ac..57f6253978f3a 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml @@ -1,6 +1,11 @@ +setup: + - requires: + test_runner_features: allowed_warnings_regex --- "Test Index and Search locale dependent mappings / dates": - do: + allowed_warnings_regex: + - 'Date format \[E, d MMM yyyy HH:mm:ss Z] contains field specifiers that could change in JDK 23' indices.create: index: test_index body: diff --git a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java index 29510a553fac9..2ec688e03501b 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java @@ -389,8 +389,9 @@ public static ZonedDateTime nowWithMillisResolution(Clock clock) { } // check for all textual fields, and localized zone offset + // the weird thing with Z is to ONLY match 4 in a row, with no Z before or after (but those groups can also be empty) private static final Predicate CONTAINS_CHANGING_TEXT_SPECIFIERS = System.getProperty("java.locale.providers", "") - .contains("COMPAT") ? Pattern.compile("[BEGOavz]|LLL|MMM|QQQ|ccc|eee|ZZZZ").asPredicate() : Predicates.never(); + .contains("COMPAT") ? Pattern.compile("[BEGOavz]|LLL|MMM|QQQ|ccc|eee|(? Date: Mon, 16 Sep 2024 17:09:11 +0100 Subject: [PATCH 03/11] Add warnings as general warnings to ignore --- .../rest-api-spec/test/ingest/30_date_processor.yml | 2 -- .../test/search/180_locale_dependent_mapping.yml | 5 ----- .../org/elasticsearch/common/time/DateUtils.java | 2 +- .../test/rest/yaml/section/DoSection.java | 12 ++++++++++++ .../xpack/esql/qa/rest/RestEsqlTestCase.java | 11 ++++++++++- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml index c3afc32e78306..78fb895ea791c 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml @@ -97,8 +97,6 @@ teardown: "Test date processor with no timezone configured": - do: - allowed_warnings_regex: - - 'Date format \[dd/MMM/yyyy:H:m:s Z] contains field specifiers that could change in JDK 23' ingest.put_pipeline: id: "my_pipeline" # sample formats from beats, featuring mongodb, icinga, apache diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml index 57f6253978f3a..7c345b7d4d3ac 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml @@ -1,11 +1,6 @@ -setup: - - requires: - test_runner_features: allowed_warnings_regex --- "Test Index and Search locale dependent mappings / dates": - do: - allowed_warnings_regex: - - 'Date format \[E, d MMM yyyy HH:mm:ss Z] contains field specifiers that could change in JDK 23' indices.create: index: test_index body: diff --git a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java index 2ec688e03501b..2c3964e35d93d 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java @@ -399,7 +399,7 @@ static void checkTextualDateFormats(String format) { deprecationLogger.warn( DeprecationCategory.PARSING, "cldr_date_formats_" + format, - "Date format [{}] contains field specifiers that could change in JDK 23", + "Date format [{}] contains textual field specifiers that could change in JDK 23", format ); } diff --git a/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java b/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java index 2d8206f759293..fa2b0a0ff8090 100644 --- a/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java +++ b/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java @@ -93,6 +93,16 @@ public static DoSection parseWithLegacyNodeSelectorSupport(XContentParser parser return parse(parser, true); } + /** + * Add the warning from DateUtils as a generally acceptable warning in YAML tests. + * This is so we don't need to go and add this to every single test that uses changing field specifiers; + * they've all already been updated to account for CLDR. + */ + @UpdateForV9 + private static void addAllowedJdkDateWarning(List allowedWarningsRegex) { + allowedWarningsRegex.add(Pattern.compile("Date format \\[.*] contains textual field specifiers that could change in JDK 23")); + } + private static DoSection parse(XContentParser parser, boolean enableLegacyNodeSelectorSupport) throws IOException { String currentFieldName = null; XContentParser.Token token; @@ -106,6 +116,8 @@ private static DoSection parse(XContentParser parser, boolean enableLegacyNodeSe List allowedWarnings = new ArrayList<>(); List allowedWarningsRegex = new ArrayList<>(); + addAllowedJdkDateWarning(allowedWarningsRegex); + if (parser.nextToken() != XContentParser.Token.START_OBJECT) { throw new IllegalArgumentException( "expected [" diff --git a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java index d9d11c3568ab7..64baa60d7553b 100644 --- a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java +++ b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java @@ -20,6 +20,7 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Nullable; @@ -1117,7 +1118,11 @@ private static HttpEntity assertWarnings(Response response, List allowed if (shouldLog()) { LOGGER.info("RESPONSE warnings (after muted)={}", warnings); } - EsqlTestUtils.assertWarnings(warnings, allowedWarnings, allowedWarningsRegex); + EsqlTestUtils.assertWarnings( + warnings, + allowedWarnings, + CollectionUtils.concatLists(allowedWarningsRegex, alwaysAllowedWarningsRegex()) + ); return response.getEntity(); } @@ -1128,6 +1133,10 @@ private static Set mutedWarnings() { ); } + private static Set alwaysAllowedWarningsRegex() { + return Set.of(Pattern.compile("Date format \\[.*] contains textual field specifiers that could change in JDK 23")); + } + private static void bulkLoadTestData(int count) throws IOException { bulkLoadTestData(count, 0, true, RestEsqlTestCase::createDocument); } From 7991380fcae2777ae8195374d4baa7ac1991353a Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 09:09:54 +0100 Subject: [PATCH 04/11] Revert "Add warnings as general warnings to ignore" This reverts commit 7c8b87fd532110b2d801ae629714b40fcb3878f7. --- .../rest-api-spec/test/ingest/30_date_processor.yml | 2 ++ .../test/search/180_locale_dependent_mapping.yml | 5 +++++ .../org/elasticsearch/common/time/DateUtils.java | 2 +- .../test/rest/yaml/section/DoSection.java | 12 ------------ .../xpack/esql/qa/rest/RestEsqlTestCase.java | 11 +---------- 5 files changed, 9 insertions(+), 23 deletions(-) diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml index 78fb895ea791c..c3afc32e78306 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml @@ -97,6 +97,8 @@ teardown: "Test date processor with no timezone configured": - do: + allowed_warnings_regex: + - 'Date format \[dd/MMM/yyyy:H:m:s Z] contains field specifiers that could change in JDK 23' ingest.put_pipeline: id: "my_pipeline" # sample formats from beats, featuring mongodb, icinga, apache diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml index 7c345b7d4d3ac..57f6253978f3a 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml @@ -1,6 +1,11 @@ +setup: + - requires: + test_runner_features: allowed_warnings_regex --- "Test Index and Search locale dependent mappings / dates": - do: + allowed_warnings_regex: + - 'Date format \[E, d MMM yyyy HH:mm:ss Z] contains field specifiers that could change in JDK 23' indices.create: index: test_index body: diff --git a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java index 2c3964e35d93d..2ec688e03501b 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java @@ -399,7 +399,7 @@ static void checkTextualDateFormats(String format) { deprecationLogger.warn( DeprecationCategory.PARSING, "cldr_date_formats_" + format, - "Date format [{}] contains textual field specifiers that could change in JDK 23", + "Date format [{}] contains field specifiers that could change in JDK 23", format ); } diff --git a/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java b/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java index fa2b0a0ff8090..2d8206f759293 100644 --- a/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java +++ b/test/yaml-rest-runner/src/main/java/org/elasticsearch/test/rest/yaml/section/DoSection.java @@ -93,16 +93,6 @@ public static DoSection parseWithLegacyNodeSelectorSupport(XContentParser parser return parse(parser, true); } - /** - * Add the warning from DateUtils as a generally acceptable warning in YAML tests. - * This is so we don't need to go and add this to every single test that uses changing field specifiers; - * they've all already been updated to account for CLDR. - */ - @UpdateForV9 - private static void addAllowedJdkDateWarning(List allowedWarningsRegex) { - allowedWarningsRegex.add(Pattern.compile("Date format \\[.*] contains textual field specifiers that could change in JDK 23")); - } - private static DoSection parse(XContentParser parser, boolean enableLegacyNodeSelectorSupport) throws IOException { String currentFieldName = null; XContentParser.Token token; @@ -116,8 +106,6 @@ private static DoSection parse(XContentParser parser, boolean enableLegacyNodeSe List allowedWarnings = new ArrayList<>(); List allowedWarningsRegex = new ArrayList<>(); - addAllowedJdkDateWarning(allowedWarningsRegex); - if (parser.nextToken() != XContentParser.Token.START_OBJECT) { throw new IllegalArgumentException( "expected [" diff --git a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java index 64baa60d7553b..d9d11c3568ab7 100644 --- a/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java +++ b/x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/RestEsqlTestCase.java @@ -20,7 +20,6 @@ import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.util.CollectionUtils; import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.core.CheckedConsumer; import org.elasticsearch.core.Nullable; @@ -1118,11 +1117,7 @@ private static HttpEntity assertWarnings(Response response, List allowed if (shouldLog()) { LOGGER.info("RESPONSE warnings (after muted)={}", warnings); } - EsqlTestUtils.assertWarnings( - warnings, - allowedWarnings, - CollectionUtils.concatLists(allowedWarningsRegex, alwaysAllowedWarningsRegex()) - ); + EsqlTestUtils.assertWarnings(warnings, allowedWarnings, allowedWarningsRegex); return response.getEntity(); } @@ -1133,10 +1128,6 @@ private static Set mutedWarnings() { ); } - private static Set alwaysAllowedWarningsRegex() { - return Set.of(Pattern.compile("Date format \\[.*] contains textual field specifiers that could change in JDK 23")); - } - private static void bulkLoadTestData(int count) throws IOException { bulkLoadTestData(count, 0, true, RestEsqlTestCase::createDocument); } From ccc4c45545ce8de852c2464ed5ff5bfe8f927514 Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 09:48:38 +0100 Subject: [PATCH 05/11] Remove textual formats --- .../cat/component-templates.asciidoc | 7 ++-- .../indices/index-templates.asciidoc | 3 +- .../indices/put-component-template.asciidoc | 3 +- .../indices/put-index-template-v1.asciidoc | 13 ++++---- .../indices/simulate-template.asciidoc | 23 +++++++------ .../test/ingest/30_date_processor.yml | 7 ++-- .../search/180_locale_dependent_mapping.yml | 6 ++-- .../ComponentTemplatesFileSettingsIT.java | 24 +++++--------- .../elasticsearch/common/time/DateUtils.java | 2 +- ...vedComposableIndexTemplateActionTests.java | 33 +++++++------------ x-pack/plugin/build.gradle | 1 + 11 files changed, 51 insertions(+), 71 deletions(-) diff --git a/docs/reference/cat/component-templates.asciidoc b/docs/reference/cat/component-templates.asciidoc index 596c86befd1b7..f87f400bb8885 100644 --- a/docs/reference/cat/component-templates.asciidoc +++ b/docs/reference/cat/component-templates.asciidoc @@ -6,8 +6,8 @@ [IMPORTANT] ==== -cat APIs are only intended for human consumption using the command line or {kib} -console. They are _not_ intended for use by applications. For application +cat APIs are only intended for human consumption using the command line or {kib} +console. They are _not_ intended for use by applications. For application consumption, use the <>. ==== @@ -82,8 +82,7 @@ PUT _component_template/my-template-2 "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } } diff --git a/docs/reference/indices/index-templates.asciidoc b/docs/reference/indices/index-templates.asciidoc index 66911716ffee2..69936df7feff8 100644 --- a/docs/reference/indices/index-templates.asciidoc +++ b/docs/reference/indices/index-templates.asciidoc @@ -134,8 +134,7 @@ PUT _index_template/template_1 "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, diff --git a/docs/reference/indices/put-component-template.asciidoc b/docs/reference/indices/put-component-template.asciidoc index 0a0e36b63e6cd..6fd54f81d1222 100644 --- a/docs/reference/indices/put-component-template.asciidoc +++ b/docs/reference/indices/put-component-template.asciidoc @@ -26,8 +26,7 @@ PUT _component_template/template_1 "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } } diff --git a/docs/reference/indices/put-index-template-v1.asciidoc b/docs/reference/indices/put-index-template-v1.asciidoc index 86a8a54edd97f..75325edf77696 100644 --- a/docs/reference/indices/put-index-template-v1.asciidoc +++ b/docs/reference/indices/put-index-template-v1.asciidoc @@ -4,8 +4,8 @@ Create or update index template (legacy) ++++ -IMPORTANT: This documentation is about legacy index templates, -which are deprecated and will be replaced by the composable templates introduced in {es} 7.8. +IMPORTANT: This documentation is about legacy index templates, +which are deprecated and will be replaced by the composable templates introduced in {es} 7.8. For information about composable templates, see <>. Creates or updates an index template. @@ -27,8 +27,7 @@ PUT _template/template_1 "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } } @@ -67,8 +66,8 @@ that you can automatically apply when creating new indices. {es} applies templates to new indices based on an index pattern that matches the index name. -NOTE: Composable templates always take precedence over legacy templates. -If no composable template matches a new index, +NOTE: Composable templates always take precedence over legacy templates. +If no composable template matches a new index, matching legacy templates are applied according to their order. Index templates are only applied during index creation. @@ -263,4 +262,4 @@ The API returns the following response: "version" : 123 } } --------------------------------------------------- \ No newline at end of file +-------------------------------------------------- diff --git a/docs/reference/indices/simulate-template.asciidoc b/docs/reference/indices/simulate-template.asciidoc index c7397ace97886..fd825883dc20c 100644 --- a/docs/reference/indices/simulate-template.asciidoc +++ b/docs/reference/indices/simulate-template.asciidoc @@ -26,8 +26,7 @@ PUT _index_template/template_1 "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -74,19 +73,19 @@ privilege>> to use this API. ``:: (Optional, string) Name of the index template to simulate. -To test a template configuration before you add it to the cluster, +To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. [[simulate-template-api-query-params]] ==== {api-query-parms-title} //// `cause`:: -(Optional, string) The reason for using the specified template for the simulation. +(Optional, string) The reason for using the specified template for the simulation. //// `create`:: -(Optional, Boolean) If `true`, the template passed in the body is -only used if no existing templates match the same index patterns. +(Optional, Boolean) If `true`, the template passed in the body is +only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. @@ -114,7 +113,7 @@ include::{es-ref-dir}/indices/put-index-template.asciidoc[tag=index-template-api .Properties of `overlapping` [%collapsible%open] ==== -`index_patterns`:: +`index_patterns`:: (array) Index patterns that the superseded template applies to. `name`:: @@ -123,7 +122,7 @@ include::{es-ref-dir}/indices/put-index-template.asciidoc[tag=index-template-api `template`:: (object) -The settings, mappings, and aliases that would be applied to matching indices. +The settings, mappings, and aliases that would be applied to matching indices. + .Properties of `template` [%collapsible%open] @@ -227,8 +226,8 @@ The response shows the index settings, mappings, and aliases applied by the `fin [[simulate-template-config-ex]] ===== Simulating an arbitrary template configuration -To see what settings will be applied by a template before you add it to the cluster, -you can pass a template configuration in the request body. +To see what settings will be applied by a template before you add it to the cluster, +you can pass a template configuration in the request body. The specified template is used for the simulation if it has a higher priority than existing templates. [source,console] @@ -266,8 +265,8 @@ The response shows any overlapping templates with a lower priority. } }, "mappings" : { - "properties" : { - "@timestamp" : { + "properties" : { + "@timestamp" : { "type" : "date" } } diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml index c3afc32e78306..0b6e0639fbf58 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml @@ -1,3 +1,6 @@ +setup: + - requires: + test_runner_features: allowed_warnings --- teardown: - do: @@ -97,8 +100,8 @@ teardown: "Test date processor with no timezone configured": - do: - allowed_warnings_regex: - - 'Date format \[dd/MMM/yyyy:H:m:s Z] contains field specifiers that could change in JDK 23' + allowed_warnings: + - 'Date format [dd/MMM/yyyy:H:m:s Z] contains textual field specifiers that could change in JDK 23' ingest.put_pipeline: id: "my_pipeline" # sample formats from beats, featuring mongodb, icinga, apache diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml index 57f6253978f3a..079b109d93044 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/search/180_locale_dependent_mapping.yml @@ -1,11 +1,11 @@ setup: - requires: - test_runner_features: allowed_warnings_regex + test_runner_features: allowed_warnings --- "Test Index and Search locale dependent mappings / dates": - do: - allowed_warnings_regex: - - 'Date format \[E, d MMM yyyy HH:mm:ss Z] contains field specifiers that could change in JDK 23' + allowed_warnings: + - 'Date format [E, d MMM yyyy HH:mm:ss Z] contains textual field specifiers that could change in JDK 23' indices.create: index: test_index body: diff --git a/server/src/internalClusterTest/java/org/elasticsearch/reservedstate/service/ComponentTemplatesFileSettingsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/reservedstate/service/ComponentTemplatesFileSettingsIT.java index 45e370a2e2252..e5e8d03d1b835 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/reservedstate/service/ComponentTemplatesFileSettingsIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/reservedstate/service/ComponentTemplatesFileSettingsIT.java @@ -129,8 +129,7 @@ public class ComponentTemplatesFileSettingsIT extends ESIntegTestCase { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -160,8 +159,7 @@ public class ComponentTemplatesFileSettingsIT extends ESIntegTestCase { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -191,8 +189,7 @@ public class ComponentTemplatesFileSettingsIT extends ESIntegTestCase { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -260,8 +257,7 @@ public class ComponentTemplatesFileSettingsIT extends ESIntegTestCase { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -291,8 +287,7 @@ public class ComponentTemplatesFileSettingsIT extends ESIntegTestCase { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -336,8 +331,7 @@ public class ComponentTemplatesFileSettingsIT extends ESIntegTestCase { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -666,8 +660,7 @@ private TransportPutComposableIndexTemplateAction.Request sampleIndexTemplateRes "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -708,8 +701,7 @@ private TransportPutComposableIndexTemplateAction.Request sampleIndexTemplateRes "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, diff --git a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java index 2ec688e03501b..2c3964e35d93d 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java @@ -399,7 +399,7 @@ static void checkTextualDateFormats(String format) { deprecationLogger.warn( DeprecationCategory.PARSING, "cldr_date_formats_" + format, - "Date format [{}] contains field specifiers that could change in JDK 23", + "Date format [{}] contains textual field specifiers that could change in JDK 23", format ); } diff --git a/server/src/test/java/org/elasticsearch/action/admin/indices/template/reservedstate/ReservedComposableIndexTemplateActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/indices/template/reservedstate/ReservedComposableIndexTemplateActionTests.java index f0f4e37f31c19..df07877265dd8 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/indices/template/reservedstate/ReservedComposableIndexTemplateActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/indices/template/reservedstate/ReservedComposableIndexTemplateActionTests.java @@ -171,8 +171,7 @@ public void testComposableIndexValidation() { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -213,8 +212,7 @@ public void testComposableIndexValidation() { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -367,8 +365,7 @@ public void testAddRemoveIndexTemplates() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -398,8 +395,7 @@ public void testAddRemoveIndexTemplates() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -471,8 +467,7 @@ public void testAddRemoveIndexTemplates() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -536,8 +531,7 @@ public void testAddRemoveIndexTemplatesWithOverlap() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -566,8 +560,7 @@ public void testAddRemoveIndexTemplatesWithOverlap() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -611,8 +604,7 @@ public void testAddRemoveIndexTemplatesWithOverlap() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -652,8 +644,7 @@ public void testAddRemoveIndexTemplatesWithOverlap() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -792,8 +783,7 @@ public void testBlockUsingReservedComponentTemplates() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, @@ -857,8 +847,7 @@ public void testTemplatesWithReservedPrefix() throws Exception { "type": "keyword" }, "created_at": { - "type": "date", - "format": "EEE MMM dd HH:mm:ss Z yyyy" + "type": "date" } } }, diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 09ffae9b24be1..24d7e7b596790 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -77,6 +77,7 @@ tasks.named("yamlRestTestV7CompatTest").configure { 'ml/evaluate_data_frame/Test outlier_detection auc_roc include curve', 'ml/evaluate_data_frame/Test classification auc_roc', 'ml/evaluate_data_frame/Test classification auc_roc with default top_classes_field', + 'ingest/30_date_processor/Test date processor with no timezone configured' ].join(',') } From 5ba908f6575488450509cd0a115d8468b89e2025 Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 10:48:47 +0100 Subject: [PATCH 06/11] Add some test ignores --- docs/reference/esql/esql-rest.asciidoc | 1 + .../ingest/common-log-format-example.asciidoc | 3 ++- modules/ingest-common/build.gradle | 14 ++++++++++++++ x-pack/plugin/build.gradle | 3 +-- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/reference/esql/esql-rest.asciidoc b/docs/reference/esql/esql-rest.asciidoc index 2c8c5e81e273d..b2493dc32a211 100644 --- a/docs/reference/esql/esql-rest.asciidoc +++ b/docs/reference/esql/esql-rest.asciidoc @@ -233,6 +233,7 @@ POST /_query } ---- // TEST[setup:library] +// TEST[skip:This can output a warning, and asciidoc doesn't support allowed_warnings] [discrete] [[esql-rest-params]] diff --git a/docs/reference/ingest/common-log-format-example.asciidoc b/docs/reference/ingest/common-log-format-example.asciidoc index 3fd296a167a6a..be20b49cf39f7 100644 --- a/docs/reference/ingest/common-log-format-example.asciidoc +++ b/docs/reference/ingest/common-log-format-example.asciidoc @@ -28,7 +28,7 @@ Pipelines**. image::images/ingest/ingest-pipeline-list.png[Kibana's Ingest Pipelines list view,align="center"] . Click **Create pipeline > New pipeline**. -. Set **Name** to `my-pipeline` and optionally add a description for the +. Set **Name** to `my-pipeline` and optionally add a description for the pipeline. . Add a <> to parse the log message: @@ -128,6 +128,7 @@ PUT _ingest/pipeline/my-pipeline // end::common-log-pipeline[] } ---- +// TEST[skip:This can output a warning, and asciidoc doesn't support allowed_warnings] //// -- diff --git a/modules/ingest-common/build.gradle b/modules/ingest-common/build.gradle index ac4e63c5abb09..bdeed16231aca 100644 --- a/modules/ingest-common/build.gradle +++ b/modules/ingest-common/build.gradle @@ -51,6 +51,20 @@ tasks.named("thirdPartyAudit").configure { ) } +tasks.named("yamlRestTest").configure { + systemProperty 'tests.rest.blacklist', [ + // for some reason, allowed_warnings on the test isn't working here + 'ingest/30_date_processor/Test date processor with no timezone configured', + ].join(',') +} + +tasks.named("yamlRestTestV7CompatTest").configure { + systemProperty 'tests.rest.blacklist', [ + // for some reason, allowed_warnings on the test isn't working here + 'ingest/30_date_processor/Test date processor with no timezone configured', + ].join(',') +} + tasks.named("yamlRestTestV7CompatTransform").configure { task -> task.addAllowedWarningRegex("\\[types removal\\].*") } diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 24d7e7b596790..446d912838587 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -76,8 +76,7 @@ tasks.named("yamlRestTestV7CompatTest").configure { 'ml/evaluate_data_frame/Test outlier_detection auc_roc given actual_field is int', 'ml/evaluate_data_frame/Test outlier_detection auc_roc include curve', 'ml/evaluate_data_frame/Test classification auc_roc', - 'ml/evaluate_data_frame/Test classification auc_roc with default top_classes_field', - 'ingest/30_date_processor/Test date processor with no timezone configured' + 'ml/evaluate_data_frame/Test classification auc_roc with default top_classes_field' ].join(',') } From 27557ed7b831b6466bc58c463deba596ffcf13ab Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 11:44:52 +0100 Subject: [PATCH 07/11] More test updates --- .../rest-api-spec/test/ingest/30_date_processor.yml | 2 ++ .../test/ingest/20_combine_processors.yml | 11 +++++++++++ x-pack/plugin/build.gradle | 3 +-- .../qa/testFixtures/src/main/resources/date.csv-spec | 1 + .../xpack/sql/qa/CustomDateFormatTestCase.java | 4 ++-- .../resources/rest-api-spec/test/esql/70_locale.yml | 1 + 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml index 0b6e0639fbf58..8508534614c4b 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/30_date_processor.yml @@ -170,6 +170,8 @@ teardown: - match: { acknowledged: true } - do: + allowed_warnings: + - 'Date format [dd/MMM/yyyy:H:m:s Z] contains textual field specifiers that could change in JDK 23' index: index: test id: "1" diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/yamlRestTest/resources/rest-api-spec/test/ingest/20_combine_processors.yml b/qa/smoke-test-ingest-with-all-dependencies/src/yamlRestTest/resources/rest-api-spec/test/ingest/20_combine_processors.yml index 9a7444c4ffc6c..301ff636d72be 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/yamlRestTest/resources/rest-api-spec/test/ingest/20_combine_processors.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/yamlRestTest/resources/rest-api-spec/test/ingest/20_combine_processors.yml @@ -1,6 +1,11 @@ +setup: + - requires: + test_runner_features: allowed_warnings --- "Test with date processor": - do: + allowed_warnings: + - 'Date format [dd/MMM/yyyy:HH:mm:ss xx] contains textual field specifiers that could change in JDK 23' ingest.put_pipeline: id: "_id" body: > @@ -41,6 +46,8 @@ - match: { acknowledged: true } - do: + allowed_warnings: + - 'Date format [dd/MMM/yyyy:HH:mm:ss xx] contains textual field specifiers that could change in JDK 23' index: index: test id: "1" @@ -70,6 +77,8 @@ --- "Test with date processor and ECS-v1": - do: + allowed_warnings: + - 'Date format [dd/MMM/yyyy:HH:mm:ss xx] contains textual field specifiers that could change in JDK 23' ingest.put_pipeline: id: "_id" body: > @@ -99,6 +108,8 @@ - match: { acknowledged: true } - do: + allowed_warnings: + - 'Date format [dd/MMM/yyyy:HH:mm:ss xx] contains textual field specifiers that could change in JDK 23' index: index: test id: "1" diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 446d912838587..ff45cc9430633 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -76,7 +76,7 @@ tasks.named("yamlRestTestV7CompatTest").configure { 'ml/evaluate_data_frame/Test outlier_detection auc_roc given actual_field is int', 'ml/evaluate_data_frame/Test outlier_detection auc_roc include curve', 'ml/evaluate_data_frame/Test classification auc_roc', - 'ml/evaluate_data_frame/Test classification auc_roc with default top_classes_field' + 'ml/evaluate_data_frame/Test classification auc_roc with default top_classes_field', ].join(',') } @@ -147,7 +147,6 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task -> task.skipTest("spatial/70_script_doc_values/geoshape value", "error message changed in 8.9.0") task.skipTest("security/authz/14_cat_indices/Test empty request while single authorized index", "not supported for compatibility") task.skipTestsByFilePattern("**/rollup/**", "The rollup yaml tests in the 7.x branch don't know how to fake a cluster with rollup usage") - task.skipTest("data_stream/10_basic/Create hidden data stream", "warning does not exist for compatibility") task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/date.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/date.csv-spec index f9d83641ab4bd..4ec15eb94464c 100644 --- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/date.csv-spec +++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/date.csv-spec @@ -481,6 +481,7 @@ dateFormatLocale from employees | where emp_no == 10049 or emp_no == 10050 | sort emp_no | eval birth_month = date_format("MMMM", birth_date) | keep emp_no, birth_date, birth_month; ignoreOrder:true +warningRegex:Date format \[MMMM] contains textual field specifiers that could change in JDK 23 emp_no:integer | birth_date:datetime | birth_month:keyword 10049 | null | null diff --git a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java index 3f70c52df64b0..a5e5481fc388c 100644 --- a/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java +++ b/x-pack/plugin/sql/qa/server/src/main/java/org/elasticsearch/xpack/sql/qa/CustomDateFormatTestCase.java @@ -35,8 +35,8 @@ public abstract class CustomDateFormatTestCase extends BaseRestSqlTestCase { "HH:mm yyyy-MM-dd", "HH:mm:ss yyyy-dd-MM", "HH:mm:ss VV", - "HH:mm:ss VV z", - "yyyy-MM-dd'T'HH:mm:ss'T'VV'T'z" }; + "HH:mm:ss VV Z", + "yyyy-MM-dd'T'HH:mm:ss'T'VV'T'Z" }; private static String[] nowFunctions = new String[] { "NOW()", "CURRENT_DATE()", "CURRENT_TIME()", "CURRENT_TIMESTAMP()" }; private static String[] operators = new String[] { " < ", " > ", " <= ", " >= ", " = ", " != " }; diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml index e181f77f2bcef..6e7558c89429a 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml @@ -50,6 +50,7 @@ setup: - do: allowed_warnings_regex: - "No limit defined, adding default limit of \\[.*\\]" + - "Date format \[MMMM] contains textual field specifiers that could change in JDK 23" esql.query: body: query: 'FROM events | eval fixed_format = date_format("MMMM", @timestamp), variable_format = date_format(format, @timestamp) | sort @timestamp | keep @timestamp, fixed_format, variable_format' From 00cb512bad0e8d4aea66d75dfb7c337c7f5374c6 Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 11:46:48 +0100 Subject: [PATCH 08/11] whoops --- .../resources/rest-api-spec/test/esql/70_locale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml index 6e7558c89429a..189b85ea24dc8 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml @@ -50,7 +50,7 @@ setup: - do: allowed_warnings_regex: - "No limit defined, adding default limit of \\[.*\\]" - - "Date format \[MMMM] contains textual field specifiers that could change in JDK 23" + - "Date format \\[MMMM] contains textual field specifiers that could change in JDK 23" esql.query: body: query: 'FROM events | eval fixed_format = date_format("MMMM", @timestamp), variable_format = date_format(format, @timestamp) | sort @timestamp | keep @timestamp, fixed_format, variable_format' From da3a31ee11acf514a2782acb78482dce1d689965 Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 11:48:21 +0100 Subject: [PATCH 09/11] And this --- x-pack/plugin/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index ff45cc9430633..09ffae9b24be1 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -147,6 +147,7 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task -> task.skipTest("spatial/70_script_doc_values/geoshape value", "error message changed in 8.9.0") task.skipTest("security/authz/14_cat_indices/Test empty request while single authorized index", "not supported for compatibility") task.skipTestsByFilePattern("**/rollup/**", "The rollup yaml tests in the 7.x branch don't know how to fake a cluster with rollup usage") + task.skipTest("data_stream/10_basic/Create hidden data stream", "warning does not exist for compatibility") task.replaceValueInMatch("_type", "_doc") task.addAllowedWarningRegex("\\[types removal\\].*") From 81655137b7bca4ea7f054f4c87acb4b69907a95f Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 13:13:30 +0100 Subject: [PATCH 10/11] Another test --- .../yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml index 189b85ea24dc8..7c6ea434c12df 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/70_locale.yml @@ -29,6 +29,7 @@ setup: - do: allowed_warnings_regex: - "No limit defined, adding default limit of \\[.*\\]" + - "Date format \\[MMMM] contains textual field specifiers that could change in JDK 23" esql.query: body: query: 'FROM events | eval fixed_format = date_format("MMMM", @timestamp), variable_format = date_format(format, @timestamp) | sort @timestamp | keep @timestamp, fixed_format, variable_format' From 7c0e52246cdac3f1932e814b92a36713c24540c1 Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Thu, 19 Sep 2024 14:25:58 +0100 Subject: [PATCH 11/11] Add qqq --- .../src/main/java/org/elasticsearch/common/time/DateUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java index 2c3964e35d93d..09a72b0810364 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateUtils.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateUtils.java @@ -391,7 +391,7 @@ public static ZonedDateTime nowWithMillisResolution(Clock clock) { // check for all textual fields, and localized zone offset // the weird thing with Z is to ONLY match 4 in a row, with no Z before or after (but those groups can also be empty) private static final Predicate CONTAINS_CHANGING_TEXT_SPECIFIERS = System.getProperty("java.locale.providers", "") - .contains("COMPAT") ? Pattern.compile("[BEGOavz]|LLL|MMM|QQQ|ccc|eee|(?