Skip to content

Commit

Permalink
[8.x] [ResponseOps][Cases] Remove deprecated date format from telemet…
Browse files Browse the repository at this point in the history
…ry (#200331) (#200658)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ResponseOps][Cases] Remove deprecated date format from telemetry
(#200331)](#200331)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Christos
Nasikas","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T22:30:16Z","message":"[ResponseOps][Cases]
Remove deprecated date format from telemetry (#200331)\n\n##
Summary\r\n\r\nThe Cases telemetry uses a deprecated date format that
will not be\r\nsupported in 9.0. This PR changes the format of the date
set in the\r\n`format` field as suggested
here\r\nhttps://www.elastic.co/blog/locale-changes-elasticsearch-8-16-jdk-23.\r\nSpecifically,
it changes `Y` to `y`. From the docs:\r\n\r\n> In particular, if you are
using the Y specifier as part of a calendar\r\ndate format, you are
probably using it erroneously; Joda time uses Y to\r\nrepresent
year-of-era, but the JDK uses Y to represent week-years. You\r\nneed to
modify your format to use y instead, or change to a
built-in\r\nformat.\r\n\r\nFixes:
https://github.com/elastic/kibana-team/issues/1188\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"7ace26213d6e7e493144c70a4f408cb9939d1fb0","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","Feature:Cases","backport:prev-minor","v8.17.0","v8.18.0"],"title":"[ResponseOps][Cases]
Remove deprecated date format from
telemetry","number":200331,"url":"https://github.com/elastic/kibana/pull/200331","mergeCommit":{"message":"[ResponseOps][Cases]
Remove deprecated date format from telemetry (#200331)\n\n##
Summary\r\n\r\nThe Cases telemetry uses a deprecated date format that
will not be\r\nsupported in 9.0. This PR changes the format of the date
set in the\r\n`format` field as suggested
here\r\nhttps://www.elastic.co/blog/locale-changes-elasticsearch-8-16-jdk-23.\r\nSpecifically,
it changes `Y` to `y`. From the docs:\r\n\r\n> In particular, if you are
using the Y specifier as part of a calendar\r\ndate format, you are
probably using it erroneously; Joda time uses Y to\r\nrepresent
year-of-era, but the JDK uses Y to represent week-years. You\r\nneed to
modify your format to use y instead, or change to a
built-in\r\nformat.\r\n\r\nFixes:
https://github.com/elastic/kibana-team/issues/1188\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"7ace26213d6e7e493144c70a4f408cb9939d1fb0"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200331","number":200331,"mergeCommit":{"message":"[ResponseOps][Cases]
Remove deprecated date format from telemetry (#200331)\n\n##
Summary\r\n\r\nThe Cases telemetry uses a deprecated date format that
will not be\r\nsupported in 9.0. This PR changes the format of the date
set in the\r\n`format` field as suggested
here\r\nhttps://www.elastic.co/blog/locale-changes-elasticsearch-8-16-jdk-23.\r\nSpecifically,
it changes `Y` to `y`. From the docs:\r\n\r\n> In particular, if you are
using the Y specifier as part of a calendar\r\ndate format, you are
probably using it erroneously; Joda time uses Y to\r\nrepresent
year-of-era, but the JDK uses Y to represent week-years. You\r\nneed to
modify your format to use y instead, or change to a
built-in\r\nformat.\r\n\r\nFixes:
https://github.com/elastic/kibana-team/issues/1188\r\n\r\n###
Checklist\r\n\r\nCheck the PR satisfies following conditions.
\r\n\r\nReviewers should verify this PR satisfies this list as
well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"7ace26213d6e7e493144c70a4f408cb9939d1fb0"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Christos Nasikas <[email protected]>
  • Loading branch information
kibanamachine and cnasikas authored Nov 19, 2024
1 parent 6e90b7c commit 1e5dba6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('alerts', () => {
counts: {
date_range: {
field: 'cases-comments.attributes.created_at',
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{
from: 'now-1d',
Expand Down
8 changes: 4 additions & 4 deletions x-pack/plugins/cases/server/telemetry/queries/cases.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ describe('getCasesTelemetryData', () => {
"counts": Object {
"date_range": Object {
"field": "cases.attributes.created_at",
"format": "dd/MM/YYYY",
"format": "dd/MM/yyyy",
"ranges": Array [
Object {
"from": "now-1d",
Expand Down Expand Up @@ -501,7 +501,7 @@ describe('getCasesTelemetryData', () => {
"counts": Object {
"date_range": Object {
"field": "cases.attributes.created_at",
"format": "dd/MM/YYYY",
"format": "dd/MM/yyyy",
"ranges": Array [
Object {
"from": "now-1d",
Expand Down Expand Up @@ -547,7 +547,7 @@ describe('getCasesTelemetryData', () => {
"counts": Object {
"date_range": Object {
"field": "cases.attributes.created_at",
"format": "dd/MM/YYYY",
"format": "dd/MM/yyyy",
"ranges": Array [
Object {
"from": "now-1d",
Expand Down Expand Up @@ -605,7 +605,7 @@ describe('getCasesTelemetryData', () => {
"counts": Object {
"date_range": Object {
"field": "cases.attributes.created_at",
"format": "dd/MM/YYYY",
"format": "dd/MM/yyyy",
"ranges": Array [
Object {
"from": "now-1d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('comments', () => {
counts: {
date_range: {
field: 'cases-comments.attributes.created_at',
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{
from: 'now-1d',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('user_actions', () => {
counts: {
date_range: {
field: 'cases-user-actions.attributes.created_at',
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{
from: 'now-1d',
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/cases/server/telemetry/queries/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ describe('utils', () => {
counts: {
date_range: {
field: 'test.attributes.created_at',
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{ from: 'now-1d', to: 'now' },
{ from: 'now-1w', to: 'now' },
Expand Down Expand Up @@ -1132,7 +1132,7 @@ describe('utils', () => {
counts: {
date_range: {
field: 'test.attributes.created_at',
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{
from: 'now-1d',
Expand Down Expand Up @@ -1261,7 +1261,7 @@ describe('utils', () => {
counts: {
date_range: {
field: 'cases-comments.attributes.created_at',
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{
from: 'now-1d',
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/cases/server/telemetry/queries/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const getCountsAggregationQuery = (savedObjectType: string) => ({
counts: {
date_range: {
field: `${savedObjectType}.attributes.created_at`,
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{ from: 'now-1d', to: 'now' },
{ from: 'now-1w', to: 'now' },
Expand All @@ -52,7 +52,7 @@ export const getAlertsCountsAggregationQuery = () => ({
counts: {
date_range: {
field: `${CASE_COMMENT_SAVED_OBJECT}.attributes.created_at`,
format: 'dd/MM/YYYY',
format: 'dd/MM/yyyy',
ranges: [
{ from: 'now-1d', to: 'now' },
{ from: 'now-1w', to: 'now' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default ({ getService }: FtrProviderContext): void => {
});
});

it('should return the corect total number of alerts attached to cases', async () => {
it('should return the correct total number of alerts attached to cases', async () => {
const firstCase = await createCase(supertest, getPostCaseRequest());
const secondCase = await createCase(supertest, getPostCaseRequest());

Expand Down

0 comments on commit 1e5dba6

Please sign in to comment.