Skip to content

Commit

Permalink
Revert "[Response Ops][Alerting] Backfill actions schema changes for …
Browse files Browse the repository at this point in the history
…intermediate release (elastic#203184)" (elastic#204218)

This reverts commit b9bac16.

## Summary

Reverting to investigate `Failed to poll for work: Invalid interval
"PT1M". Intervals must be of the form {number}m. Example: 5m.` logs
which may be caused by the updated task schema
  • Loading branch information
ymao1 authored Dec 13, 2024
1 parent 5791d36 commit 42693ca
Show file tree
Hide file tree
Showing 16 changed files with 9 additions and 194 deletions.
5 changes: 1 addition & 4 deletions packages/kbn-check-mappings-update-cli/current_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"actionTypeId",
"name"
],
"action_task_params": [
"apiKeyId"
],
"action_task_params": [],
"ad_hoc_run_params": [
"apiKeyId",
"createdAt",
Expand Down Expand Up @@ -1100,7 +1098,6 @@
"enabled",
"ownerId",
"partition",
"priority",
"retryAt",
"runAt",
"schedule",
Expand Down
9 changes: 1 addition & 8 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
},
"action_task_params": {
"dynamic": false,
"properties": {
"apiKeyId": {
"type": "keyword"
}
}
"properties": {}
},
"ad_hoc_run_params": {
"dynamic": false,
Expand Down Expand Up @@ -3634,9 +3630,6 @@
"partition": {
"type": "integer"
},
"priority": {
"type": "integer"
},
"retryAt": {
"type": "date"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ describe('checking migration metadata changes on all registered SO types', () =>
expect(hashMap).toMatchInlineSnapshot(`
Object {
"action": "0e6fc0b74c7312a8c11ff6b14437b93a997358b8",
"action_task_params": "2e475d8b62e2de50b77f58cda309efb537e1d543",
"ad_hoc_run_params": "c7419760e878207231c3c8a25ec4d78360e07bf7",
"action_task_params": "b50cb5c8a493881474918e8d4985e61374ca4c30",
"ad_hoc_run_params": "d4e3c5c794151d0a4f5c71e886b2aa638da73ad2",
"alert": "556a03378f5ee1c31593c3a37c66b54555ee14ff",
"api_key_pending_invalidation": "8f5554d1984854011b8392d9a6f7ef985bcac03c",
"apm-custom-dashboards": "b67128f78160c288bd7efe25b2da6e2afd5e82fc",
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"synthetics-private-location": "8cecc9e4f39637d2f8244eb7985c0690ceab24be",
"synthetics-privates-locations": "f53d799d5c9bc8454aaa32c6abc99a899b025d5c",
"tag": "e2544392fe6563e215bb677abc8b01c2601ef2dc",
"task": "ca8020259e46f713965a754ffae286c02d3cf05d",
"task": "3c89a7c918d5b896a5f8800f06e9114ad7e7aea3",
"telemetry": "7b00bcf1c7b4f6db1192bb7405a6a63e78b699fd",
"threshold-explorer-view": "175306806f9fc8e13fcc1c8953ec4ba89bda1b70",
"ui-metric": "d227284528fd19904e9d972aea0a13716fc5fe24",
Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/actions/server/saved_objects/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ export const actionMappings: SavedObjectsTypeMappingDefinition = {
export const actionTaskParamsMappings: SavedObjectsTypeMappingDefinition = {
dynamic: false,
properties: {
apiKeyId: {
type: 'keyword',
},
// NO NEED TO BE INDEXED
// actionId: {
// type: 'keyword',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,13 @@
*/

import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server';
import { actionTaskParamsSchemaV1, actionTaskParamsSchemaV2 } from '../schemas/action_task_params';
import { actionTaskParamsSchemaV1 } from '../schemas/action_task_params';

export const actionTaskParamsModelVersions: SavedObjectsModelVersionMap = {
'1': {
changes: [],
schemas: {
forwardCompatibility: actionTaskParamsSchemaV1.extends({}, { unknowns: 'ignore' }),
create: actionTaskParamsSchemaV1,
},
},
'2': {
changes: [
{
type: 'mappings_addition',
addedMappings: {
apiKeyId: { type: 'keyword' },
},
},
],
schemas: {
forwardCompatibility: actionTaskParamsSchemaV2.extends({}, { unknowns: 'ignore' }),
create: actionTaskParamsSchemaV2,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export { actionTaskParamsSchema as actionTaskParamsSchemaV1 } from './v1';
export { actionTaskParamsSchema as actionTaskParamsSchemaV2 } from './v2';

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const scheduleBodySchema = schema.arrayOf(
rule_id: schema.string(),
start: schema.string(),
end: schema.maybe(schema.string()),
run_actions: schema.maybe(schema.boolean()),
},
{
validate({ start, end }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
*/

import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server';
import {
rawAdHocRunParamsSchemaV1,
rawAdHocRunParamsSchemaV2,
} from '../schemas/raw_ad_hoc_run_params';
import { rawAdHocRunParamsSchemaV1 } from '../schemas/raw_ad_hoc_run_params';

export const adHocRunParamsModelVersions: SavedObjectsModelVersionMap = {
'1': {
Expand All @@ -19,11 +16,4 @@ export const adHocRunParamsModelVersions: SavedObjectsModelVersionMap = {
create: rawAdHocRunParamsSchemaV1,
},
},
'2': {
changes: [],
schemas: {
forwardCompatibility: rawAdHocRunParamsSchemaV2.extends({}, { unknowns: 'ignore' }),
create: rawAdHocRunParamsSchemaV2,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export { rawAdHocRunParamsSchema as rawAdHocRunParamsSchemaV1 } from './v1';
export { rawAdHocRunParamsSchema as rawAdHocRunParamsSchemaV2 } from './v2';

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const rawAdHocRunSchedule = schema.object({
runAt: schema.string(),
});

export const rawAdHocRunParamsRuleSchema = schema.object({
const rawAdHocRunParamsRuleSchema = schema.object({
name: schema.string(),
tags: schema.arrayOf(schema.string()),
alertTypeId: schema.string(),
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions x-pack/plugins/task_manager/server/saved_objects/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ export const taskMappings: SavedObjectsTypeMappingDefinition = {
partition: {
type: 'integer',
},
priority: {
type: 'integer',
},
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server';
import { taskSchemaV1, taskSchemaV2, taskSchemaV3 } from '../schemas/task';
import { taskSchemaV1, taskSchemaV2 } from '../schemas/task';

export const taskModelVersions: SavedObjectsModelVersionMap = {
'1': {
Expand Down Expand Up @@ -35,18 +35,4 @@ export const taskModelVersions: SavedObjectsModelVersionMap = {
create: taskSchemaV2,
},
},
'3': {
changes: [
{
type: 'mappings_addition',
addedMappings: {
priority: { type: 'integer' },
},
},
],
schemas: {
forwardCompatibility: taskSchemaV3.extends({}, { unknowns: 'ignore' }),
create: taskSchemaV3,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,3 @@ export const taskSchemaV1 = schema.object({
export const taskSchemaV2 = taskSchemaV1.extends({
partition: schema.maybe(schema.number()),
});

export const taskSchemaV3 = taskSchemaV2.extends({
priority: schema.maybe(schema.number()),
});

0 comments on commit 42693ca

Please sign in to comment.