[esArchiver] restrict from modifying saved objects indexes (#169852)

## Summary

Related to #161882

The goal is to prevent FTR tests from new esArchives that overrides SO
indexes.

This PR adds the existing archives that re-create Saved Objects indexes
into temporary exception list, located in
`packages/kbn-es-archiver/src/fixtures/override_saved_objects_index/exception_list.json`.
Whenever tests/archives are updated to not modify SO indexes, archive is
expected to be removed from the list (progress can be tracked in
#169075, #168973, #168969, #168926 )

Load action has a check if index is SO index and if the archive is in
the exception list. This will throw error for the new archives, but
still work as usual for the existing ones while teams updating the
tests.

Whenever test is loading archive listed in the exception list, the
following warning message is logged:
```
warn x-pack/test/functional/es_archives/data/search_sessions overrides Saved Objects index(es) and placed temporary in the exception list.
Please fix the archive and remove it from /Users/dmle/github/kibana/packages/kbn-es-archiver/src/fixtures/override_saved_objects_index/exception_list.json.
For more details see: https://github.com/elastic/kibana/issues/161882
```

If the test loads a newly added archive that modifies a Saved Object
index (e.g. `.kibana`), esArchiver will throw the error:
```
 Error: esArchiver doesn't support modifying the existing Saved Objects index: '.kibana_1',
 please update its definition in mappings.json
```
This commit is contained in:
Dzmitry Lemechko 2023-10-27 20:27:10 +02:00 committed by GitHub
parent fb048e6e20
commit 6698810958
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 180 additions and 3318 deletions

View file

@ -30,6 +30,8 @@ import {
createDefaultSpace,
} from '../lib';
import soOverrideAllowedList from '../fixtures/override_saved_objects_index/exception_list.json';
// pipe a series of streams into each other so that data and errors
// flow from the first stream to the last. Errors from the last stream
// are not listened for
@ -38,6 +40,16 @@ const pipeline = (...streams: Readable[]) =>
source.once('error', (error) => dest.destroy(error)).pipe(dest as any)
);
const warningToUpdateArchive = (path: string) => {
return `This test is using '${path}' archive that contains saved object index definitions (in the 'mappings.json').
This has proven to be a source of conflicts and flakiness, so the goal is to remove support for this feature ASAP. We kindly ask you to
update your test archives and remove SO index definitions, so that tests use the official saved object indices created by Kibana at startup.
You can achieve that by simply removing your saved object index definitions from 'mappings.json' (likely removing the file altogether).
We also recommend migrating existing tests to 'kbnArchiver' whenever possible. After the fix please remove archive path from the exception list:
${resolve(__dirname, '../fixtures/override_saved_objects_index/exception_list.json')}.
Find more information here: https://github.com/elastic/kibana/issues/161882`;
};
export async function loadAction({
inputDir,
skipExisting,
@ -56,6 +68,10 @@ export async function loadAction({
kbnClient: KbnClient;
}) {
const name = relative(REPO_ROOT, inputDir);
const isArchiveInExceptionList = soOverrideAllowedList.includes(name);
if (isArchiveInExceptionList) {
log.warning(warningToUpdateArchive(name));
}
const stats = createStats(name, log);
const files = prioritizeMappings(await readDirectory(inputDir));
const kibanaPluginIds = await kbnClient.plugins.getEnabledIds();
@ -80,7 +96,14 @@ export async function loadAction({
await createPromiseFromStreams([
recordStream,
createCreateIndexStream({ client, stats, skipExisting, docsOnly, log }),
createCreateIndexStream({
client,
stats,
skipExisting,
docsOnly,
isArchiveInExceptionList,
log,
}),
createIndexDocRecordsStream(client, stats, progress, useCreate),
]);

View file

@ -0,0 +1,35 @@
[
"x-pack/test/functional/es_archives/action_task_params",
"x-pack/test/functional/es_archives/actions",
"x-pack/test/functional/es_archives/alerting/8_2_0",
"x-pack/test/functional/es_archives/alerts",
"x-pack/test/functional/es_archives/alerts_legacy/rules",
"x-pack/test/functional/es_archives/alerts_legacy/tasks",
"x-pack/test/functional/es_archives/cases/default",
"x-pack/test/functional/es_archives/cases/migrations/7.11.1",
"x-pack/test/functional/es_archives/cases/migrations/7.13.2",
"x-pack/test/functional/es_archives/cases/migrations/7.13_user_actions",
"x-pack/test/functional/es_archives/cases/migrations/7.16.0_space",
"x-pack/test/functional/es_archives/cases/migrations/8.8.0",
"x-pack/test/functional/es_archives/data/search_sessions",
"x-pack/test/functional/es_archives/endpoint/telemetry/agent_only",
"x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_different_states",
"x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_installed",
"x-pack/test/functional/es_archives/endpoint/telemetry/cloned_endpoint_uninstalled",
"x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_disabled",
"x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_malware_enabled",
"x-pack/test/functional/es_archives/endpoint/telemetry/endpoint_uninstalled",
"x-pack/test/functional/es_archives/event_log_legacy_ids",
"x-pack/test/functional/es_archives/event_log_multiple_indicies",
"x-pack/test/functional/es_archives/fleet/agents",
"x-pack/test/functional/es_archives/lists",
"x-pack/test/functional/es_archives/rules_scheduled_task_id/rules",
"x-pack/test/functional/es_archives/rules_scheduled_task_id/tasks",
"x-pack/test/functional/es_archives/security_solution/import_rule_connector",
"x-pack/test/functional/es_archives/security_solution/migrations",
"x-pack/test/functional/es_archives/security_solution/resolve_read_rules/7_14",
"x-pack/test/functional/es_archives/security_solution/timelines/7.15.0",
"x-pack/test/functional/es_archives/security_solution/timelines/7.15.0_space",
"x-pack/test/functional/es_archives/task_manager_removed_types",
"x-pack/test/functional/es_archives/task_manager_tasks"
]

View file

@ -6,7 +6,11 @@
* Side Public License, v 1.
*/
import type { cleanSavedObjectIndices, deleteSavedObjectIndices } from './kibana_index';
import type {
cleanSavedObjectIndices,
deleteSavedObjectIndices,
isSavedObjectIndex,
} from './kibana_index';
export const mockCleanSavedObjectIndices = jest.fn() as jest.MockedFunction<
typeof cleanSavedObjectIndices
@ -16,7 +20,12 @@ export const mockDeleteSavedObjectIndices = jest.fn() as jest.MockedFunction<
typeof deleteSavedObjectIndices
>;
export const mockIsSavedObjectIndex = jest.fn() as unknown as jest.MockedFunction<
typeof isSavedObjectIndex
>;
jest.mock('./kibana_index', () => ({
cleanSavedObjectIndices: mockCleanSavedObjectIndices,
deleteSavedObjectIndices: mockDeleteSavedObjectIndices,
isSavedObjectIndex: mockIsSavedObjectIndex,
}));

View file

@ -7,6 +7,7 @@
*/
import {
mockIsSavedObjectIndex,
mockCleanSavedObjectIndices,
mockDeleteSavedObjectIndices,
} from './create_index_stream.test.mock';
@ -31,6 +32,7 @@ const chance = new Chance();
const log = createStubLogger();
beforeEach(() => {
mockIsSavedObjectIndex.mockClear();
mockCleanSavedObjectIndices.mockClear();
mockDeleteSavedObjectIndices.mockClear();
});

View file

@ -19,7 +19,11 @@ import {
TASK_MANAGER_SAVED_OBJECT_INDEX,
} from '@kbn/core-saved-objects-server';
import { Stats } from '../stats';
import { cleanSavedObjectIndices, deleteSavedObjectIndices } from './kibana_index';
import {
cleanSavedObjectIndices,
deleteSavedObjectIndices,
isSavedObjectIndex,
} from './kibana_index';
import { deleteIndex } from './delete_index';
import { deleteDataStream } from './delete_data_stream';
import { ES_CLIENT_HEADERS } from '../../client_headers';
@ -37,12 +41,14 @@ export function createCreateIndexStream({
stats,
skipExisting = false,
docsOnly = false,
isArchiveInExceptionList = false,
log,
}: {
client: Client;
stats: Stats;
skipExisting?: boolean;
docsOnly?: boolean;
isArchiveInExceptionList?: boolean;
log: ToolingLog;
}) {
const skipDocsFromIndices = new Set();
@ -129,6 +135,16 @@ export function createCreateIndexStream({
return;
}
if (isSavedObjectIndex(index) && !isArchiveInExceptionList) {
throw new Error(
`'esArchiver' no longer supports defining saved object indices, your archive is modifying '${index}'.
The recommendation is to use 'kbnArchiver' to import saved objects in your tests.
If you absolutely need to load some non-importable SOs, please stick to the official saved object indices created by Kibana at startup.
You can achieve that by simply removing your saved object index definitions from 'mappings.json' (likely removing the file altogether).
Find more information here: https://github.com/elastic/kibana/issues/161882`
);
}
async function attemptToCreate(attemptNumber = 1) {
try {
if (isKibana && !kibanaIndicesAlreadyDeleted) {

View file

@ -85,7 +85,7 @@ export async function migrateSavedObjectIndices(kbnClient: KbnClient) {
const LEGACY_INDICES_REGEXP = new RegExp(`^(${ALL_SAVED_OBJECT_INDICES.join('|')})(:?_\\d*)?$`);
const INDICES_REGEXP = new RegExp(`^(${ALL_SAVED_OBJECT_INDICES.join('|')})_(pre)?\\d+.\\d+.\\d+`);
function isSavedObjectIndex(index?: string): index is string {
export function isSavedObjectIndex(index?: string): index is string {
return Boolean(index && (LEGACY_INDICES_REGEXP.test(index) || INDICES_REGEXP.test(index)));
}

View file

@ -8,7 +8,8 @@
]
},
"include": [
"**/*.ts"
"**/*.ts",
"src/**/*.json"
],
"kbn_references": [
"@kbn/core-saved-objects-server",

View file

@ -0,0 +1,78 @@
{
"attributes":{
"@created":"2020-10-21T23:50:26.466Z",
"@timestamp":"2020-10-22T23:44:48.387Z",
"assets":{},
"colors":[
"#37988d",
"#c19628",
"#b83c6f",
"#3f9939",
"#1785b0",
"#ca5f35",
"#45bdb0",
"#f2bc33",
"#e74b8b",
"#4fbf48",
"#1ea6dc",
"#fd7643",
"#72cec3",
"#f5cc5d",
"#ec77a8",
"#7acf74",
"#4cbce4",
"#fd986f",
"#a1ded7",
"#f8dd91",
"#f2a4c5",
"#a6dfa2",
"#86d2ed",
"#fdba9f",
"#000000",
"#444444",
"#777777",
"#BBBBBB",
"#FFFFFF",
"rgba(255,255,255,0)"
],
"css":".canvasPage {\n\n}",
"height":8,
"isWriteable":true,
"name":"The Very Cool Workpad for PDF Tests",
"page":0,
"pages":[
{
"elements":[
{
"expression":"shape \"square\" fill=\"#4cbce4\" border=\"rgba(255,255,255,0)\" borderWidth=0 maintainAspect=false\n| render",
"id":"element-e05237c6-0fda-49e7-84fc-b8573739b515",
"position":{
"angle":0,
"height":18,
"left":-1,
"parent":null,
"top":-1,
"width":15.5
}
}
],
"groups":[],
"id":"page-c0e601aa-1c72-4d4a-b73f-8fb72a9d8d3a",
"style":{
"background":"#FFF"
},
"transition":{}
}
],
"variables":[],
"width":8
},
"coreMigrationVersion":"8.8.0",
"id":"workpad-c13808dc-e690-4bab-be06-2073ba071754",
"managed":false,
"references":[],
"type":"canvas-workpad",
"typeMigrationVersion":"8.9.0",
"updated_at":"2020-10-22T23:44:48.392Z",
"version":"WzIsMl0="
}

File diff suppressed because it is too large Load diff

View file

@ -1,222 +0,0 @@
{
"type": "doc",
"value": {
"id": "task:Alerting-alerting_telemetry",
"index": ".kibana_task_manager_1",
"source": {
"migrationVersion": {
"task": "8.2.0"
},
"references": [
],
"task": {
"attempts": 0,
"params": "{}",
"retryAt": null,
"runAt": "2020-09-04T11:51:05.197Z",
"scheduledAt": "2020-09-04T11:51:05.197Z",
"startedAt": null,
"state": "{}",
"ownerId": null,
"status": "idle",
"taskType": "alerting_telemetry"
},
"type": "task",
"updated_at": "2020-09-04T11:51:05.197Z"
}
}
}
{
"type": "doc",
"value": {
"id": "task:Actions-actions_telemetry",
"index": ".kibana_task_manager_1",
"source": {
"migrationVersion": {
"task": "8.2.0"
},
"references": [
],
"task": {
"attempts": 0,
"params": "{}",
"retryAt": null,
"runAt": "2020-09-04T11:51:05.197Z",
"scheduledAt": "2020-09-04T11:51:05.197Z",
"startedAt": null,
"state": "{}",
"ownerId": null,
"status": "idle",
"taskType": "actions_telemetry"
},
"type": "task",
"updated_at": "2020-09-04T11:51:05.197Z"
}
}
}
{
"type": "doc",
"value": {
"id": "X6bLb3UBt6Z_MVvSTfYk",
"index": ".kibana-event-log-8.0.0-000001",
"source": {
"@timestamp": "2020-10-28T15:19:55.933Z",
"ecs": {
"version": "1.5.0"
},
"event": {
"action": "test",
"duration": 0,
"end": "2020-10-28T15:19:55.933Z",
"provider": "event_log_fixture",
"start": "2020-10-28T15:19:55.933Z"
},
"kibana": {
"saved_objects": [
{
"id": "621f2511-5cd1-44fd-95df-e0df83e354d5",
"rel": "primary",
"type": "event_log_test"
}
],
"server_uuid": "5b2de169-2785-441b-ae8c-186a1936b17d",
"version": "8.0.0"
},
"message": "test 2020-10-28T15:19:55.913Z"
}
}
}
{
"type": "doc",
"value": {
"id": "X6bLb3UBt6Z_MVvSTfYk0000",
"index": ".kibana-event-log-8.0.0-000001",
"source": {
"@timestamp": "2020-10-28T15:19:55.933Z",
"ecs": {
"version": "1.5.0"
},
"event": {
"action": "test legacy",
"duration": 0,
"end": "2020-10-28T15:19:55.933Z",
"provider": "event_log_fixture",
"start": "2020-10-28T15:19:55.933Z"
},
"kibana": {
"saved_objects": [
{
"id": "521f2511-5cd1-44fd-95df-e0df83e354d5",
"rel": "primary",
"type": "event_log_test"
}
],
"server_uuid": "5b2de169-2785-441b-ae8c-186a1936b17d",
"version": "7.14.0"
},
"message": "test legacy 2020-10-28T15:19:55.913Z"
}
}
}
{
"type": "doc",
"value": {
"id": "YKbLb3UBt6Z_MVvSTfY8",
"index": ".kibana-event-log-8.0.0-000001",
"source": {
"@timestamp": "2020-10-28T15:19:55.957Z",
"ecs": {
"version": "1.5.0"
},
"event": {
"action": "test",
"duration": 0,
"end": "2020-10-28T15:19:55.957Z",
"provider": "event_log_fixture",
"start": "2020-10-28T15:19:55.957Z"
},
"kibana": {
"saved_objects": [
{
"id": "621f2511-5cd1-44fd-95df-e0df83e354d5",
"rel": "primary",
"type": "event_log_test"
}
],
"server_uuid": "5b2de169-2785-441b-ae8c-186a1936b17d",
"version": "8.0.0"
},
"message": "test 2020-10-28T15:19:55.938Z"
}
}
}
{
"type": "doc",
"value": {
"id": "YabLb3UBt6Z_MVvSTfZc0000",
"index": ".kibana-event-log-8.0.0-000001",
"source": {
"@timestamp": "2020-10-28T15:19:55.991Z",
"ecs": {
"version": "1.5.0"
},
"event": {
"action": "test",
"duration": 0,
"end": "2020-10-28T15:19:55.991Z",
"provider": "event_log_fixture",
"start": "2020-10-28T15:19:55.991Z"
},
"kibana": {
"saved_objects": [
{
"id": "521f2511-5cd1-44fd-95df-e0df83e354d5",
"rel": "primary",
"type": "event_log_test"
}
],
"server_uuid": "5b2de169-2785-441b-ae8c-186a1936b17d",
"version": "7.0.0"
},
"message": "test legacy 2020-10-28T15:19:55.962Z"
}
}
}
{
"type": "doc",
"value": {
"id": "YabLb3UBt6Z_MVvSTfZc",
"index": ".kibana-event-log-8.0.0-000001",
"source": {
"@timestamp": "2020-10-28T15:19:55.991Z",
"ecs": {
"version": "1.5.0"
},
"event": {
"action": "test",
"duration": 0,
"end": "2020-10-28T15:19:55.991Z",
"provider": "event_log_fixture",
"start": "2020-10-28T15:19:55.991Z"
},
"kibana": {
"saved_objects": [
{
"id": "621f2511-5cd1-44fd-95df-e0df83e354d5",
"rel": "primary",
"type": "event_log_test"
}
],
"server_uuid": "5b2de169-2785-441b-ae8c-186a1936b17d",
"version": "8.0.0"
},
"message": "test 2020-10-28T15:19:55.962Z"
}
}
}

View file

@ -1,700 +0,0 @@
{
"type": "index",
"value": {
"aliases": {
".kibana": {
}
},
"index": ".kibana_1",
"mappings": {
"_meta": {
"migrationMappingPropertyHashes": {
"action": "6e96ac5e648f57523879661ea72525b7",
"action_task_params": "a9d49f184ee89641044be0ca2950fa3a",
"alert": "eaf6f5841dbf4cb5e3045860f75f53ca",
"apm-indices": "9bb9b2bf1fa636ed8619cbab5ce6a1dd",
"apm-telemetry": "3d1b76c39bfb2cc8296b024d73854724",
"app_search_telemetry": "3d1b76c39bfb2cc8296b024d73854724",
"application_usage_daily": "43b8830d5d0df85a6823d290885fc9fd",
"application_usage_totals": "3d1b76c39bfb2cc8296b024d73854724",
"application_usage_transactional": "3d1b76c39bfb2cc8296b024d73854724",
"canvas-element": "7390014e1091044523666d97247392fc",
"canvas-workpad": "b0a1706d356228dbdcb4a17e6b9eb231",
"canvas-workpad-template": "ae2673f678281e2c055d764b153e9715",
"cases": "477f214ff61acc3af26a7b7818e380c1",
"cases-comments": "c2061fb929f585df57425102fa928b4b",
"cases-configure": "387c5f3a3bda7e0ae0dd4e106f914a69",
"cases-user-actions": "32277330ec6b721abe3b846cfd939a71",
"config": "c63748b75f39d0c54de12d12c1ccbc20",
"dashboard": "40554caf09725935e2c02e02563a2d07",
"endpoint:user-artifact": "4a11183eee21e6fbad864f7a30b39ad0",
"endpoint:user-artifact-manifest": "a0d7b04ad405eed54d76e279c3727862",
"enterprise_search_telemetry": "3d1b76c39bfb2cc8296b024d73854724",
"epm-packages": "2b83397e3eaaaa8ef15e38813f3721c3",
"event_log_test": "bef808d4a9c27f204ffbda3359233931",
"exception-list": "67f055ab8c10abd7b2ebfd969b836788",
"exception-list-agnostic": "67f055ab8c10abd7b2ebfd969b836788",
"file-upload-telemetry": "0ed4d3e1983d1217a30982630897092e",
"fleet-agent-actions": "9511b565b1cc6441a42033db3d5de8e9",
"fleet-agent-events": "e20a508b6e805189356be381dbfac8db",
"fleet-agents": "cb661e8ede2b640c42c8e5ef99db0683",
"fleet-enrollment-api-keys": "a69ef7ae661dab31561d6c6f052ef2a7",
"graph-workspace": "cd7ba1330e6682e9cc00b78850874be1",
"index-pattern": "45915a1ad866812242df474eb0479052",
"infrastructure-ui-source": "3d1b76c39bfb2cc8296b024d73854724",
"ingest-agent-policies": "8b0733cce189659593659dad8db426f0",
"ingest-outputs": "8854f34453a47e26f86a29f8f3b80b4e",
"ingest-package-policies": "f74dfe498e1849267cda41580b2be110",
"ingest_manager_settings": "02a03095f0e05b7a538fa801b88a217f",
"inventory-view": "3d1b76c39bfb2cc8296b024d73854724",
"kql-telemetry": "d12a98a6f19a2d273696597547e064ee",
"lens": "52346cfec69ff7b47d5f0c12361a2797",
"lens-ui-telemetry": "509bfa5978586998e05f9e303c07a327",
"map": "4a05b35c3a3a58fbc72dd0202dc3487f",
"maps-telemetry": "5ef305b18111b77789afefbd36b66171",
"metrics-explorer-view": "3d1b76c39bfb2cc8296b024d73854724",
"migrationVersion": "4a1746014a75ade3a714e1db5763276f",
"ml-telemetry": "257fd1d4b4fdbb9cb4b8a3b27da201e9",
"monitoring-telemetry": "2669d5ec15e82391cf58df4294ee9c68",
"namespace": "2f4316de49999235636386fe51dc06c1",
"namespaces": "2f4316de49999235636386fe51dc06c1",
"originId": "2f4316de49999235636386fe51dc06c1",
"query": "11aaeb7f5f7fa5bb43f25e18ce26e7d9",
"references": "7997cf5a56cc02bdc9c93361bde732b0",
"sample-data-telemetry": "7d3cfeb915303c9641c59681967ffeb4",
"search": "43012c7ebc4cb57054e0a490e4b43023",
"search-telemetry": "3d1b76c39bfb2cc8296b024d73854724",
"siem-detection-engine-rule-actions": "6569b288c169539db10cb262bf79de18",
"siem-detection-engine-rule-status": "ae783f41c6937db6b7a2ef5c93a9e9b0",
"siem-ui-timeline": "d12c5474364d737d17252acf1dc4585c",
"siem-ui-timeline-note": "8874706eedc49059d4cf0f5094559084",
"siem-ui-timeline-pinned-event": "20638091112f0e14f0e443d512301c29",
"space": "c5ca8acafa0beaa4d08d014a97b6bc6b",
"telemetry": "36a616f7026dfa617d6655df850fe16d",
"timelion-sheet": "9a2a2748877c7a7b582fef201ab1d4cf",
"tsvb-validation-telemetry": "3a37ef6c8700ae6fc97d5c7da00e9215",
"type": "2f4316de49999235636386fe51dc06c1",
"ui-metric": "0d409297dc5ebe1e3a1da691c6ee32e3",
"updated_at": "00da57df13e94e9d98437d13ace4bfe0",
"upgrade-assistant-reindex-operation": "215107c281839ea9b3ad5f6419819763",
"upgrade-assistant-telemetry": "56702cec857e0a9dacfb696655b4ff7b",
"uptime-dynamic-settings": "3d1b76c39bfb2cc8296b024d73854724",
"url": "c7f66a0df8b1b52f17c28c4adb111105",
"visualization": "f819cf6636b75c9e76ba733a0c6ef355",
"workplace_search_telemetry": "3d1b76c39bfb2cc8296b024d73854724"
}
},
"dynamic": "strict",
"properties": {
"config": {
"dynamic": "false",
"properties": {
"buildNum": {
"type": "keyword"
}
}
},
"event_log_test": {
"type": "object"
},
"migrationVersion": {
"dynamic": "true",
"properties": {
"config": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
},
"space": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"ml-telemetry": {
"properties": {
"file_data_visualizer": {
"properties": {
"index_creation_count": {
"type": "long"
}
}
}
}
},
"monitoring-telemetry": {
"properties": {
"reportedClusterUuids": {
"type": "keyword"
}
}
},
"namespace": {
"type": "keyword"
},
"namespaces": {
"type": "keyword"
},
"originId": {
"type": "keyword"
},
"query": {
"properties": {
"description": {
"type": "text"
},
"filters": {
"enabled": false,
"type": "object"
},
"query": {
"properties": {
"language": {
"type": "keyword"
},
"query": {
"index": false,
"type": "keyword"
}
}
},
"timefilter": {
"enabled": false,
"type": "object"
},
"title": {
"type": "text"
}
}
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"type": {
"type": "keyword"
},
"space": {
"properties": {
"_reserved": {
"type": "boolean"
},
"color": {
"type": "keyword"
},
"description": {
"type": "text"
},
"disabledFeatures": {
"type": "keyword"
},
"imageUrl": {
"index": false,
"type": "text"
},
"initials": {
"type": "keyword"
},
"name": {
"fields": {
"keyword": {
"ignore_above": 2048,
"type": "keyword"
}
},
"type": "text"
}
}
},
"ui-metric": {
"properties": {
"count": {
"type": "integer"
}
}
},
"updated_at": {
"type": "date"
},
"url": {
"properties": {
"accessCount": {
"type": "long"
},
"accessDate": {
"type": "date"
},
"createDate": {
"type": "date"
},
"url": {
"fields": {
"keyword": {
"ignore_above": 2048,
"type": "keyword"
}
},
"type": "text"
}
}
},
"visualization": {
"properties": {
"description": {
"type": "text"
},
"kibanaSavedObjectMeta": {
"properties": {
"searchSourceJSON": {
"index": false,
"type": "text"
}
}
},
"savedSearchRefName": {
"doc_values": false,
"index": false,
"type": "keyword"
},
"title": {
"type": "text"
},
"uiStateJSON": {
"index": false,
"type": "text"
},
"version": {
"type": "integer"
},
"visState": {
"index": false,
"type": "text"
}
}
},
"workplace_search_telemetry": {
"dynamic": "false",
"type": "object"
}
}
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
{
"type": "index",
"value": {
"aliases": {
".kibana-event-log-7.9.0": {
"is_write_index": true
}
},
"index": ".kibana-event-log-7.9.0-000001",
"mappings": {
"dynamic": "false",
"properties": {
"@timestamp": {
"type": "date"
},
"ecs": {
"properties": {
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"error": {
"properties": {
"message": {
"norms": false,
"type": "text"
}
}
},
"event": {
"properties": {
"action": {
"ignore_above": 1024,
"type": "keyword"
},
"duration": {
"type": "long"
},
"end": {
"type": "date"
},
"outcome": {
"ignore_above": 1024,
"type": "keyword"
},
"provider": {
"ignore_above": 1024,
"type": "keyword"
},
"start": {
"type": "date"
}
}
},
"kibana": {
"properties": {
"alerting": {
"properties": {
"instance_id": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"saved_objects": {
"properties": {
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"namespace": {
"ignore_above": 1024,
"type": "keyword"
},
"rel": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
}
},
"type": "nested"
},
"server_uuid": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"message": {
"norms": false,
"type": "text"
},
"tags": {
"ignore_above": 1024,
"meta": {
"isArray": "true"
},
"type": "keyword"
},
"user": {
"properties": {
"name": {
"fields": {
"text": {
"norms": false,
"type": "text"
}
},
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"lifecycle": {
"name": "kibana-event-log-policy",
"rollover_alias": ".kibana-event-log-7.9.0"
},
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
{
"type": "index",
"value": {
"aliases": {
".kibana-event-log-8.0.0": {
"is_write_index": true
}
},
"index": ".kibana-event-log-8.0.0-000001",
"mappings": {
"dynamic": "false",
"properties": {
"@timestamp": {
"type": "date"
},
"ecs": {
"properties": {
"version": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"error": {
"properties": {
"message": {
"norms": false,
"type": "text"
}
}
},
"event": {
"properties": {
"action": {
"ignore_above": 1024,
"type": "keyword"
},
"duration": {
"type": "long"
},
"end": {
"type": "date"
},
"outcome": {
"ignore_above": 1024,
"type": "keyword"
},
"provider": {
"ignore_above": 1024,
"type": "keyword"
},
"start": {
"type": "date"
}
}
},
"kibana": {
"properties": {
"alerting": {
"properties": {
"instance_id": {
"ignore_above": 1024,
"type": "keyword"
}
}
},
"saved_objects": {
"properties": {
"id": {
"ignore_above": 1024,
"type": "keyword"
},
"namespace": {
"ignore_above": 1024,
"type": "keyword"
},
"rel": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
}
},
"type": "nested"
},
"server_uuid": {
"ignore_above": 1024,
"type": "keyword"
},
"version": {
"type": "version"
}
}
},
"message": {
"norms": false,
"type": "text"
},
"tags": {
"ignore_above": 1024,
"meta": {
"isArray": "true"
},
"type": "keyword"
},
"user": {
"properties": {
"name": {
"fields": {
"text": {
"norms": false,
"type": "text"
}
},
"ignore_above": 1024,
"type": "keyword"
}
}
}
}
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"lifecycle": {
"name": "kibana-event-log-policy",
"rollover_alias": ".kibana-event-log-8.0.0"
},
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
{
"type": "index",
"value": {
"aliases": {
".kibana_task_manager": {
}
},
"index": ".kibana_task_manager_1",
"mappings": {
"_meta": {
"migrationMappingPropertyHashes": {
"migrationVersion": "4a1746014a75ade3a714e1db5763276f",
"namespace": "2f4316de49999235636386fe51dc06c1",
"namespaces": "2f4316de49999235636386fe51dc06c1",
"references": "7997cf5a56cc02bdc9c93361bde732b0",
"task": "235412e52d09e7165fac8a67a43ad6b4",
"type": "2f4316de49999235636386fe51dc06c1",
"updated_at": "00da57df13e94e9d98437d13ace4bfe0"
}
},
"dynamic": "strict",
"properties": {
"migrationVersion": {
"dynamic": "true",
"properties": {
"task": {
"fields": {
"keyword": {
"ignore_above": 256,
"type": "keyword"
}
},
"type": "text"
}
}
},
"namespace": {
"type": "keyword"
},
"namespaces": {
"type": "keyword"
},
"references": {
"properties": {
"id": {
"type": "keyword"
},
"name": {
"type": "keyword"
},
"type": {
"type": "keyword"
}
},
"type": "nested"
},
"task": {
"properties": {
"attempts": {
"type": "integer"
},
"ownerId": {
"type": "keyword"
},
"params": {
"type": "text"
},
"retryAt": {
"type": "date"
},
"runAt": {
"type": "date"
},
"schedule": {
"properties": {
"interval": {
"type": "keyword"
}
}
},
"scheduledAt": {
"type": "date"
},
"scope": {
"type": "keyword"
},
"startedAt": {
"type": "date"
},
"state": {
"type": "text"
},
"status": {
"type": "keyword"
},
"taskType": {
"type": "keyword"
},
"user": {
"type": "keyword"
}
}
},
"type": {
"type": "keyword"
},
"updated_at": {
"type": "date"
}
}
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}

View file

@ -67,14 +67,17 @@ export default function ({ getService }: FtrProviderContext) {
});
describe('Canvas: Generate PDF', () => {
const esArchiver = getService('esArchiver');
const reportingApi = getService('reportingAPI');
const kibanaServer = getService('kibanaServer');
before('initialize tests', async () => {
await esArchiver.load('x-pack/test/functional/es_archives/canvas/reports');
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/canvas/workpad_pdf_test'
);
});
after('teardown tests', async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/canvas/reports');
await kibanaServer.savedObjects.cleanStandardList();
await reportingApi.deleteAllReports();
await reportingFunctional.initEcommerce();
});

View file

@ -73,14 +73,16 @@ export default function ({ getService }: FtrProviderContext) {
});
describe('Canvas: Generate PDF', () => {
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const reportingApi = getService('reportingAPI');
before('initialize tests', async () => {
await esArchiver.load('x-pack/test/functional/es_archives/canvas/reports');
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/canvas/workpad_pdf_test'
);
});
after('teardown tests', async () => {
await esArchiver.unload('x-pack/test/functional/es_archives/canvas/reports');
await kibanaServer.savedObjects.cleanStandardList();
await reportingApi.deleteAllReports();
await reportingFunctional.initEcommerce();
});