Skip to content

Commit

Permalink
Add blog links to locale deprecation warnings (elastic#113474)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoop committed Sep 25, 2024
1 parent 20d56d0 commit bb8ceec
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
setup:
- requires:
test_runner_features: allowed_warnings
test_runner_features: allowed_warnings_regex
---
teardown:
- do:
Expand Down Expand Up @@ -100,8 +100,8 @@ teardown:
"Test date processor with no timezone configured":

- do:
allowed_warnings:
- 'Date format [dd/MMM/yyyy:H:m:s Z] contains textual field specifiers that could change in JDK 23'
allowed_warnings_regex:
- '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
Expand Down Expand Up @@ -170,8 +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'
allowed_warnings_regex:
- 'Date format \[dd/MMM/yyyy:H:m:s Z] contains textual field specifiers that could change in JDK 23.*'
index:
index: test
id: "1"
Expand Down Expand Up @@ -211,8 +211,8 @@ teardown:
---
"Test week based date parsing":
- do:
allowed_warnings:
- 'Date format [YYYY-ww] contains week-date field specifiers that are changing in JDK 23'
allowed_warnings_regex:
- 'Date format \[YYYY-ww] contains week-date field specifiers that are changing in JDK 23.*'
indices.create:
index: test
body:
Expand All @@ -223,8 +223,8 @@ teardown:
format: YYYY-ww

- do:
allowed_warnings:
- 'Date format [YYYY-ww] contains week-date field specifiers that are changing in JDK 23'
allowed_warnings_regex:
- 'Date format \[YYYY-ww] contains week-date field specifiers that are changing in JDK 23.*'
ingest.put_pipeline:
id: "my_pipeline"
body: >
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
setup:
- requires:
test_runner_features: allowed_warnings
test_runner_features: allowed_warnings_regex
---
"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'
allowed_warnings_regex:
- '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: >
Expand Down Expand Up @@ -46,8 +46,8 @@ setup:
- 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'
allowed_warnings_regex:
- 'Date format \[dd/MMM/yyyy:HH:mm:ss xx] contains textual field specifiers that could change in JDK 23.*'
index:
index: test
id: "1"
Expand Down Expand Up @@ -77,8 +77,8 @@ setup:
---
"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'
allowed_warnings_regex:
- '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: >
Expand Down Expand Up @@ -108,8 +108,8 @@ setup:
- 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'
allowed_warnings_regex:
- 'Date format \[dd/MMM/yyyy:HH:mm:ss xx] contains textual field specifiers that could change in JDK 23.*'
index:
index: test
id: "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
setup:
- requires:
test_runner_features: allowed_warnings
test_runner_features: allowed_warnings_regex
---
"Test Index and Search locale dependent mappings / dates":
- do:
allowed_warnings:
- 'Date format [E, d MMM yyyy HH:mm:ss Z] contains textual field specifiers that could change in JDK 23'
allowed_warnings_regex:
- '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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,17 @@ 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 textual field specifiers that could change in JDK 23."
+ " For more information, see https://ela.st/jdk-23-locales",
format
);
}
if (CONTAINS_WEEK_DATE_SPECIFIERS.test(format)) {
deprecationLogger.warn(
DeprecationCategory.PARSING,
"cldr_week_dates_" + format,
"Date format [{}] contains week-date field specifiers that are changing in JDK 23",
"Date format [{}] contains week-date field specifiers that are changing in JDK 23."
+ " For more information, see https://ela.st/jdk-23-locales",
format
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +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
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ setup:
"Date format with default locale":
- do:
allowed_warnings_regex:
- "No limit defined, adding default limit of \\[.*\\]"
- "Date format \\[MMMM] contains textual field specifiers that could change in JDK 23"
- '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'
Expand All @@ -51,7 +51,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'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
setup:
- requires:
test_runner_features: allowed_warnings
test_runner_features: allowed_warnings_regex
- skip:
features: headers

Expand Down Expand Up @@ -56,8 +56,8 @@ teardown:
}
- do:
allowed_warnings:
- 'Date format [YYYY.MM] contains week-date field specifiers that are changing in JDK 23'
allowed_warnings_regex:
- 'Date format \[YYYY\.MM] contains week-date field specifiers that are changing in JDK 23.*'
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
bulk:
body:
Expand Down Expand Up @@ -93,8 +93,8 @@ teardown:
}
- do:
allowed_warnings:
- 'Date format [YYYY.MM] contains week-date field specifiers that are changing in JDK 23'
allowed_warnings_regex:
- 'Date format \[YYYY\.MM] contains week-date field specifiers that are changing in JDK 23.*'
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
bulk:
body:
Expand All @@ -121,8 +121,8 @@ teardown:
---
"Test bulk indexing with datemath when only some are allowed":
- do:
allowed_warnings:
- 'Date format [YYYY] contains week-date field specifiers that are changing in JDK 23'
allowed_warnings_regex:
- 'Date format \[YYYY] contains week-date field specifiers that are changing in JDK 23.*'
headers: { Authorization: "Basic dGVzdF91c2VyOngtcGFjay10ZXN0LXBhc3N3b3Jk" } # test_user
bulk:
body:
Expand Down

0 comments on commit bb8ceec

Please sign in to comment.