Skip to content

Conversation

@cnasikas
Copy link
Member

Summary

This PR improves the TimelineById type. Specifically, the type allowed any string as a key for the object. The PR limits the keys to only the allowed timeline ids and specifically to the ids that were introduced by #67156

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cnasikas cnasikas self-assigned this Jun 17, 2020
@cnasikas cnasikas added release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.9.0 v8.0.0 labels Jun 17, 2020
@kibanamachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/security_solution/public/timelines/store/timeline.Timeline #add saved object Timeline to store should return a timelineModel with default value and not just a timelineResult

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toEqual(expected) // deep equality

- Expected
+ Received

@@ -1,7 +1,7 @@
  Object {
-   "foo": Object {
+   "test": Object {
      "columns": Array [],
      "dataProviders": Array [
        Object {
          "and": Array [],
          "enabled": true,
    at Object.test (/dev/shm/workspace/kibana/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts:127:22)
    at Object.asyncJestTest (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:102:37)
    at resolve (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:43:12)
    at new Promise (<anonymous>)
    at mapper (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:26:19)
    at promise.then (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:73:41)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/security_solution/public/timelines/store/timeline.Timeline #addNewTimeline should add a new timeline

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toEqual(expected) // deep equality

- Expected
+ Received

@@ -1,7 +1,7 @@
  Object {
-   "bar": Object {
+   "test": Object {
      "columns": Array [
        Object {
          "columnHeaderType": "not-filtered",
          "id": "@timestamp",
          "width": 190,
@@ -52,11 +52,11 @@
      "eventIdToNoteIds": Object {},
      "eventType": "all",
      "filters": Array [],
      "highlightedDropAndProviderId": "",
      "historyIds": Array [],
-     "id": "bar",
+     "id": "test",
      "isFavorite": false,
      "isLive": false,
      "isLoading": false,
      "isSaving": false,
      "isSelectAllChecked": false,
@@ -84,74 +84,10 @@
      "sort": Object {
        "columnId": "@timestamp",
        "sortDirection": "desc",
      },
      "status": "draft",
-     "templateTimelineId": null,
-     "templateTimelineVersion": null,
-     "timelineType": "default",
-     "title": "",
-     "version": null,
-     "width": 1100,
-   },
-   "foo": Object {
-     "columns": Array [],
-     "dataProviders": Array [
-       Object {
-         "and": Array [],
-         "enabled": true,
-         "excluded": false,
-         "id": "123",
-         "kqlQuery": "",
-         "name": "data provider 1",
-         "queryMatch": Object {
-           "field": "",
-           "operator": ":",
-           "value": "",
-         },
-       },
-     ],
-     "dateRange": Object {
-       "end": 0,
-       "start": 0,
-     },
-     "deletedEventIds": Array [],
-     "description": "",
-     "eventIdToNoteIds": Object {},
-     "highlightedDropAndProviderId": "",
-     "historyIds": Array [],
-     "id": "test",
-     "isFavorite": false,
-     "isLive": false,
-     "isLoading": false,
-     "isSaving": false,
-     "isSelectAllChecked": false,
-     "itemsPerPage": 25,
-     "itemsPerPageOptions": Array [
-       10,
-       25,
-       50,
-     ],
-     "kqlMode": "filter",
-     "kqlQuery": Object {
-       "filterQuery": null,
-       "filterQueryDraft": null,
-     },
-     "loadingEventIds": Array [],
-     "noteIds": Array [],
-     "pinnedEventIds": Object {},
-     "pinnedEventsSaveObject": Object {},
-     "savedObjectId": null,
-     "selectedEventIds": Object {},
-     "show": true,
-     "showCheckboxes": false,
-     "showRowRenderers": true,
-     "sort": Object {
-       "columnId": "@timestamp",
-       "sortDirection": "desc",
-     },
-     "status": "active",
      "templateTimelineId": null,
      "templateTimelineVersion": null,
      "timelineType": "default",
      "title": "",
      "version": null,
    at Object.test (/dev/shm/workspace/kibana/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts:154:22)
    at Object.asyncJestTest (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:102:37)
    at resolve (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:43:12)
    at new Promise (<anonymous>)
    at mapper (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:26:19)
    at promise.then (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:73:41)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/security_solution/public/timelines/store/timeline.Timeline #addNewTimeline should add the specified columns to the timeline

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toEqual(expected) // deep equality

- Expected
+ Received

@@ -1,7 +1,7 @@
  Object {
-   "bar": Object {
+   "test": Object {
      "columns": Array [
        Object {
          "aggregatable": true,
          "category": "base",
          "columnHeaderType": "not-filtered",
@@ -131,11 +131,11 @@
      "eventIdToNoteIds": Object {},
      "eventType": "all",
      "filters": Array [],
      "highlightedDropAndProviderId": "",
      "historyIds": Array [],
-     "id": "bar",
+     "id": "test",
      "isFavorite": false,
      "isLive": false,
      "isLoading": false,
      "isSaving": false,
      "isSelectAllChecked": false,
@@ -163,74 +163,10 @@
      "sort": Object {
        "columnId": "@timestamp",
        "sortDirection": "desc",
      },
      "status": "draft",
-     "templateTimelineId": null,
-     "templateTimelineVersion": null,
-     "timelineType": "default",
-     "title": "",
-     "version": null,
-     "width": 1100,
-   },
-   "foo": Object {
-     "columns": Array [],
-     "dataProviders": Array [
-       Object {
-         "and": Array [],
-         "enabled": true,
-         "excluded": false,
-         "id": "123",
-         "kqlQuery": "",
-         "name": "data provider 1",
-         "queryMatch": Object {
-           "field": "",
-           "operator": ":",
-           "value": "",
-         },
-       },
-     ],
-     "dateRange": Object {
-       "end": 0,
-       "start": 0,
-     },
-     "deletedEventIds": Array [],
-     "description": "",
-     "eventIdToNoteIds": Object {},
-     "highlightedDropAndProviderId": "",
-     "historyIds": Array [],
-     "id": "test",
-     "isFavorite": false,
-     "isLive": false,
-     "isLoading": false,
-     "isSaving": false,
-     "isSelectAllChecked": false,
-     "itemsPerPage": 25,
-     "itemsPerPageOptions": Array [
-       10,
-       25,
-       50,
-     ],
-     "kqlMode": "filter",
-     "kqlQuery": Object {
-       "filterQuery": null,
-       "filterQueryDraft": null,
-     },
-     "loadingEventIds": Array [],
-     "noteIds": Array [],
-     "pinnedEventIds": Object {},
-     "pinnedEventsSaveObject": Object {},
-     "savedObjectId": null,
-     "selectedEventIds": Object {},
-     "show": true,
-     "showCheckboxes": false,
-     "showRowRenderers": true,
-     "sort": Object {
-       "columnId": "@timestamp",
-       "sortDirection": "desc",
-     },
-     "status": "active",
      "templateTimelineId": null,
      "templateTimelineVersion": null,
      "timelineType": "default",
      "title": "",
      "version": null,
    at Object.test (/dev/shm/workspace/kibana/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts:170:22)
    at Object.asyncJestTest (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:102:37)
    at resolve (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:43:12)
    at new Promise (<anonymous>)
    at mapper (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:26:19)
    at promise.then (/dev/shm/workspace/kibana/node_modules/jest-jasmine2/build/queueRunner.js:73:41)
    at process._tickCallback (internal/process/next_tick.js:68:7)

and 38 more failures, only showing the first 3.

Build metrics

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cnasikas cnasikas changed the title [SIEM][Timeline] Improve timeline's type [SIEM][Timeline][skip-ci] Improve timeline's type Jun 17, 2020
@spalger spalger added v7.9.2 and removed v7.9.0 labels Sep 3, 2020
@cnasikas cnasikas added v7.10.0 and removed v7.9.2 labels Sep 14, 2020
@cnasikas cnasikas closed this Oct 13, 2020
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.11.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants