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

Add multi-space support to SO management and import/export API #109196

Closed
wants to merge 56 commits into from

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Aug 19, 2021

Summary

Fix #91615

Remaining work:

  • add unit tests for export logic changes
  • add unit tests for import logic changes
  • add the _cross_import endpoint to core
  • resolve_import_errors FTR test suite
  • adapt checkOriginConflict to support importNamespaces mode
  • validate the presence of namespaces when importNamespaces=true in importSavedObjectsFromStream

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@pgayvallet pgayvallet mentioned this pull request Aug 20, 2021
6 tasks
@pgayvallet pgayvallet added Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.16.0 release_note:skip Skip the PR/issue when compiling release notes labels Aug 27, 2021
@kibanamachine
Copy link
Contributor

kibanamachine commented Sep 1, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / jest / Jest Tests.src/plugins/saved_objects_management/public/management_section/objects_table.SavedObjectsTable export should allow the user to choose when exporting all

Link to Jenkins

Standard Out

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


Stack Trace

Error: expect(received).toMatchSnapshot()

Snapshot name: `SavedObjectsTable export should allow the user to choose when exporting all 1`

- Snapshot  - 1
+ Received  + 2

@@ -1,8 +1,8 @@
  <ExportModal
    filteredItemCount={4}
-   includeNamespaces={true}
+   includeNamespaces={false}
    includeReferences={true}
    onCancel={[Function]}
    onExport={[Function]}
    onIncludeNamespacesChange={[Function]}
    onIncludeReferenceChange={[Function]}
@@ -33,6 +33,7 @@
        "index-pattern": true,
        "search": true,
        "visualization": true,
      }
    }
+   showIncludeNamespacesToggle={false}
  />
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx:399:45)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Kibana Pipeline / jest / Jest Tests.src/plugins/saved_objects_management/public/management_section/objects_table.SavedObjectsTable export should export all

Link to Jenkins

Standard Out

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


Stack Trace

Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)

- Expected
+ Received

@@ -25,12 +25,14 @@
      "options": [Function mockConstructor],
      "patch": [Function mockConstructor],
      "post": [Function mockConstructor],
      "put": [Function mockConstructor],
    },
-   "includeNamespaces": true,
+   "includeNamespaces": false,
    "includeReferencesDeep": true,
+   "references": undefined,
+   "search": undefined,
    "types": Array [
      "index-pattern",
      "visualization",
      "dashboard",
      "search",,

Number of calls: 1
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx:416:46)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Kibana Pipeline / jest / Jest Tests.src/plugins/saved_objects_management/public/management_section/objects_table.SavedObjectsTable export should export all, accounting for the current search criteria

Link to Jenkins

Standard Out

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


Stack Trace

Error: expect(jest.fn()).toHaveBeenCalledWith(...expected)

Expected: {"http": {"addLoadingCountSource": [Function mockConstructor], "anonymousPaths": {"isAnonymous": [Function mockConstructor], "register": [Function mockConstructor]}, "basePath": {"basePath": "", "get": [Function anonymous], "prepend": [Function anonymous], "publicBaseUrl": undefined, "remove": [Function anonymous], "serverBasePath": ""}, "delete": [Function mockConstructor], "externalUrl": {"validateUrl": [Function mockConstructor]}, "fetch": [Function mockConstructor], "get": [Function mockConstructor], "getLoadingCount$": [Function mockConstructor], "head": [Function mockConstructor], "intercept": [Function mockConstructor], "options": [Function mockConstructor], "patch": [Function mockConstructor], "post": [Function mockConstructor], "put": [Function mockConstructor]}, "includeNamespaces": true, "includeReferencesDeep": true, "search": "test*", "types": ["index-pattern", "visualization", "dashboard", "search"]}
Received
       1
        @@ -25,13 +25,14 @@
              "options": [Function mockConstructor],
              "patch": [Function mockConstructor],
              "post": [Function mockConstructor],
              "put": [Function mockConstructor],
            },
        -   "includeNamespaces": true,
        +   "includeNamespaces": false,
            "includeReferencesDeep": true,
        -   "search": "test*",
        +   "references": undefined,
        +   "search": undefined,
            "types": Array [
              "index-pattern",
              "visualization",
              "dashboard",
              "search",,
       2
        @@ -25,12 +25,13 @@
              "options": [Function mockConstructor],
              "patch": [Function mockConstructor],
              "post": [Function mockConstructor],
              "put": [Function mockConstructor],
            },
        -   "includeNamespaces": true,
        +   "includeNamespaces": false,
            "includeReferencesDeep": true,
        +   "references": undefined,
            "search": "test*",
            "types": Array [
              "index-pattern",
              "visualization",
              "dashboard",,

Number of calls: 2
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx:446:46)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

and 8 more failures, only showing the first 3.

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
savedObjectsManagement 83 90 +7

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
savedObjectsManagement 140.0KB 146.6KB +6.6KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
savedObjectsManagement 38.3KB 42.1KB +3.8KB

History

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

@pgayvallet
Copy link
Contributor Author

PR on hold, see #91615 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Saved Objects release_note:skip Skip the PR/issue when compiling release notes stalled Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saved objects import/export should include spaces
4 participants