Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RAM] ResponseOps saved object updates #152857

Merged
merged 44 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
43eb8df
bring tests
XavierM Feb 8, 2023
b0ecc29
Merge branch 'main' of github.com:elastic/kibana
XavierM Feb 14, 2023
a68aec7
Merge branch 'main' of github.com:elastic/kibana
XavierM Feb 14, 2023
561b6e0
Merge branch 'main' of github.com:elastic/kibana
XavierM Feb 14, 2023
db8a5f6
Merge branch 'main' of github.com:elastic/kibana
XavierM Feb 17, 2023
182ed1f
Merge branch 'main' of github.com:elastic/kibana
XavierM Feb 21, 2023
7bcac6c
Merge branch 'main' of github.com:elastic/kibana
XavierM Feb 24, 2023
bd02789
Merge branch 'main' of github.com:elastic/kibana
XavierM Mar 1, 2023
2a02b2c
Merge branch 'main' of github.com:elastic/kibana
XavierM Mar 1, 2023
c7a2993
fix rac privileges
XavierM Mar 1, 2023
3bd34da
Merge branch 'main' of github.com:elastic/kibana
XavierM Mar 2, 2023
1cc5f39
first round on removing attributes from our saved object
XavierM Mar 7, 2023
fdf0ab5
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Mar 7, 2023
3aba90b
fix some mistake with not using mapings json
XavierM Mar 8, 2023
769868e
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Mar 8, 2023
2750afd
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Mar 20, 2023
e484499
bring back few attributes used in security
XavierM Mar 20, 2023
7108ab6
need this attributes
XavierM Mar 21, 2023
36ff7d9
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Mar 27, 2023
a708fee
update mapping for tests to pass
XavierM Mar 27, 2023
f049f61
add back scope in task SO
XavierM Mar 28, 2023
f664556
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Mar 28, 2023
d10460d
bring back scheduleAt
XavierM Apr 10, 2023
8684854
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Apr 10, 2023
2890a86
add new property for health API to work
XavierM Apr 10, 2023
ed8678b
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Apr 10, 2023
ca3a337
update core snapshot
XavierM Apr 10, 2023
fcdea93
need throttle and notifyWhen
XavierM Apr 11, 2023
e4c0842
update core
XavierM Apr 12, 2023
6577821
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Apr 12, 2023
0199f45
remove flapping properties
XavierM Apr 13, 2023
2880938
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Apr 13, 2023
04c4be6
update rule settings SO
XavierM Apr 13, 2023
5b8fc18
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Apr 13, 2023
c349928
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Apr 13, 2023
8d6a817
test without params
XavierM Apr 13, 2023
446c22b
Merge branch 'alerting-saved-object-updates' of github.com:XavierM/ki…
XavierM Apr 13, 2023
d5c1f1e
remove state from task management so
XavierM Apr 14, 2023
7c4d24b
Merge branch 'main' into alerting-saved-object-updates
XavierM Apr 16, 2023
2b023c8
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Apr 17, 2023
2336116
update core
XavierM Apr 17, 2023
9993eb7
Merge branch 'main' into alerting-saved-object-updates
XavierM Apr 17, 2023
20769ab
Merge branch 'main' of github.com:elastic/kibana into alerting-saved-…
XavierM Apr 18, 2023
247d385
Merge branch 'alerting-saved-object-updates' of github.com:XavierM/ki…
XavierM Apr 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ describe('checking migration metadata changes on all registered SO types', () =>

expect(hashMap).toMatchInlineSnapshot(`
Object {
"action": "6cfc277ed3211639e37546ac625f4a68f2494215",
"action_task_params": "5f419caba96dd8c77d0f94013e71d43890e3d5d6",
"alert": "7bec97d7775a025ecf36a33baf17386b9e7b4c3c",
"action": "12c6b25ef1fffb36d8de893318f8a2bc5d6a46a6",
"action_task_params": "c725c37de66135934150465f9b1e76fe349e8a23",
"alert": "0cd1f1921014004a9ff5c0a9333ca9bde14bf748",
"api_key_pending_invalidation": "16e7bcf8e78764102d7f525542d5b616809a21ee",
"apm-indices": "d19dd7fb51f2d2cbc1f8769481721e0953f9a6d2",
"apm-server-schema": "1d42f17eff9ec6c16d3a9324d9539e2d123d0a9a",
Expand All @@ -77,7 +77,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"cases-user-actions": "8ad74294b71edffa58fad7a40eea2388209477c9",
"config": "97e16b8f5dc10c404fd3b201ef36bc6c3c63dc80",
"config-global": "d9791e8f73edee884630e1cb6e4954ae513ce75e",
"connector_token": "fb05ff5afdcb6e2f20c9c6513ff7a1ab12b66f36",
"connector_token": "aff1aa0ebc0a6b44b570057972af25178b0bca42",
"core-usage-stats": "b3c04da317c957741ebcdedfea4524049fdc79ff",
"csp-rule-template": "099c229bf97578d9ca72b3a672d397559b84ee0b",
"dashboard": "71e3f8dfcffeb5fbd410dec81ce46f5691763c43",
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"osquery-pack-asset": "18e08979d46ee7e5538f54c080aec4d8c58516ca",
"osquery-saved-query": "f5e4e303f65c7607248ea8b2672f1ee30e4fb15e",
"query": "ec6000b775f06f81470df42d23f7a88cb31d64ba",
"rules-settings": "9854495c3b54b16a6625fb250c35e5504da72266",
"rules-settings": "eb8d40b7d60aeffe66831f7d5d83de28d85776d8",
"sample-data-telemetry": "c38daf1a49ed24f2a4fb091e6e1e833fccf19935",
"search": "ed3a9b1681b57d69560909d51933fdf17576ea68",
"search-session": "fae0dfc63274d6a3b90ca583802c48cab8760637",
Expand All @@ -142,7 +142,7 @@ describe('checking migration metadata changes on all registered SO types', () =>
"synthetics-param": "9776c9b571d35f0d0397e8915e035ea1dc026db7",
XavierM marked this conversation as resolved.
Show resolved Hide resolved
"synthetics-privates-locations": "7d032fc788905e32152029ae7ab3d6038c48ae44",
"tag": "87f21f07df9cc37001b15a26e413c18f50d1fbfe",
"task": "ff760534a44c4cfabcf4baf8cfe8283f717cab02",
"task": "533ee80c50c47f0505846bfac73fc10962c5bc45",
"telemetry": "561b329aaed3c15b91aaf2075645be3097247612",
"ui-metric": "410a8ad28e0f44b161c960ff0ce950c712b17c52",
"upgrade-assistant-ml-upgrade-operation": "d8816e5ce32649e7a3a43e2c406c632319ff84bb",
Expand Down
9 changes: 4 additions & 5 deletions x-pack/plugins/actions/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import type {
SavedObject,
SavedObjectsExportTransformContext,
SavedObjectsServiceSetup,
SavedObjectsTypeMappingDefinition,
} from '@kbn/core/server';
import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server';
import { getOldestIdleActionTask } from '@kbn/task-manager-plugin/server';
import mappings from './mappings.json';
import { actionMappings, actionTaskParamsMappings, connectorTokenMappings } from './mappings';
import { getActionsMigrations } from './actions_migrations';
import { getActionTaskParamsMigrations } from './action_task_params_migrations';
import { PreConfiguredAction, RawAction } from '../types';
Expand All @@ -38,7 +37,7 @@ export function setupSavedObjects(
hidden: true,
namespaceType: 'multiple-isolated',
convertToMultiNamespaceTypeVersion: '8.0.0',
mappings: mappings.action as SavedObjectsTypeMappingDefinition,
mappings: actionMappings,
migrations: getActionsMigrations(encryptedSavedObjects),
management: {
displayName: 'connector',
Expand Down Expand Up @@ -76,7 +75,7 @@ export function setupSavedObjects(
hidden: true,
namespaceType: 'multiple-isolated',
convertToMultiNamespaceTypeVersion: '8.0.0',
mappings: mappings.action_task_params as SavedObjectsTypeMappingDefinition,
mappings: actionTaskParamsMappings,
migrations: getActionTaskParamsMigrations(encryptedSavedObjects, preconfiguredActions),
excludeOnUpgrade: async ({ readonlyEsClient }) => {
const oldestIdleActionTask = await getOldestIdleActionTask(
Expand All @@ -102,7 +101,7 @@ export function setupSavedObjects(
name: CONNECTOR_TOKEN_SAVED_OBJECT_TYPE,
hidden: true,
namespaceType: 'agnostic',
mappings: mappings.connector_token as SavedObjectsTypeMappingDefinition,
mappings: connectorTokenMappings,
management: {
importableAndExportable: false,
},
Expand Down
74 changes: 0 additions & 74 deletions x-pack/plugins/actions/server/saved_objects/mappings.json

This file was deleted.

93 changes: 93 additions & 0 deletions x-pack/plugins/actions/server/saved_objects/mappings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { SavedObjectsTypeMappingDefinition } from '@kbn/core/server';

export const actionMappings: SavedObjectsTypeMappingDefinition = {
dynamic: false,
properties: {
name: {
type: 'text',
fields: {
keyword: {
type: 'keyword',
},
},
},
actionTypeId: {
type: 'keyword',
},
// NO NEED TO BE INDEXED
// isMissingSecrets: {
// type: 'boolean',
// },
// NO NEED TO BE INDEXED
// config: {
// enabled: false,
// type: 'object',
// },
// NEED TO CHECK WITH KIBANA SECURITY
// secrets: {
// type: 'binary',
// },
},
};

export const actionTaskParamsMappings: SavedObjectsTypeMappingDefinition = {
dynamic: false,
properties: {
// NO NEED TO BE INDEXED
// actionId: {
// type: 'keyword',
// },
// consumer: {
// type: 'keyword',
// },
// params: {
// enabled: false,
// type: 'object',
// },
// apiKey: {
// type: 'binary',
// },
// executionId: {
// type: 'keyword',
// },
// relatedSavedObjects: {
// enabled: false,
// type: 'object',
// },
ymao1 marked this conversation as resolved.
Show resolved Hide resolved
// source: {
// type: 'keyword'
// }
},
};

export const connectorTokenMappings: SavedObjectsTypeMappingDefinition = {
dynamic: false,
properties: {
connectorId: {
type: 'keyword',
},
tokenType: {
type: 'keyword',
},
// NO NEED TO BE INDEXED
// token: {
// type: 'binary',
// },
// expiresAt: {
// type: 'date',
// },
// createdAt: {
// type: 'date',
// },
// updatedAt: {
// type: 'date',
// },
},
};
Loading