SavedObjects bulkCreate API should return migrationVersion and strip the type & namespace from the id#65150
Conversation
|
Pinging @elastic/kibana-platform (Team:Platform) |
| title: 'A great new dashboard', | ||
| }, | ||
| migrationVersion: { | ||
| dashboard: resp.body.saved_objects[1].migrationVersion.dashboard, |
There was a problem hiding this comment.
This value will change anytime a new dashboard migration is added. This seems like the best workaround when using kbn-expect to prevent tests from failing anytime a new dashboard migration is added.
We should probably "modernize" these integration tests, but it felt like it's not enough of a priority to attempt this right now.
There was a problem hiding this comment.
Yea, having jest toolbox for FTR tests would we really great. kbn-expect feels very old when compared to jest.
| title: 'A great new dashboard', | ||
| }, | ||
| migrationVersion: { | ||
| dashboard: resp.body.saved_objects[1].migrationVersion.dashboard, |
There was a problem hiding this comment.
Yea, having jest toolbox for FTR tests would we really great. kbn-expect feels very old when compared to jest.
This reverts commit 9c2b743.
| expect(result.saved_objects[0].id).toEqual( | ||
| expect.not.stringMatching(/config|index-pattern|myspace/) | ||
| ); | ||
| expect(result.saved_objects[1].id).toEqual( | ||
| expect.not.stringMatching(/config|index-pattern|myspace/) | ||
| ); |
There was a problem hiding this comment.
Can't we use the uuid regexp ([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}) as done L828 instead of asserting against the names of the types/spaces used in the test suite? I think that's a little more explicit?
There was a problem hiding this comment.
obj2's id is logstash-* so I initially thought I'll try to keep these assertions the same. But I agree, a uuid regexp would be better, so I'll change the first match to use a regexp and the second match to match obj2.id.
…the type & namespace from the id (elastic#65150) * Deserialize bulkCreate response to remove namespace type from id * Index operations don't return _source in response * Fix integration tests * repository: make id generation and seq_no/primary_term spreading more explicit * API Integration test for bulk create without ids * Fix copy_to_space snapshot * Revert "Fix copy_to_space snapshot" This reverts commit 9c2b743. * Move test into returns block * repository.test.js stricter regexp matching
…the type & namespace from the id (elastic#65150) * Deserialize bulkCreate response to remove namespace type from id * Index operations don't return _source in response * Fix integration tests * repository: make id generation and seq_no/primary_term spreading more explicit * API Integration test for bulk create without ids * Fix copy_to_space snapshot * Revert "Fix copy_to_space snapshot" This reverts commit 9c2b743. * Move test into returns block * repository.test.js stricter regexp matching
…or-part-mvp-2 * 'master' of github.com:elastic/kibana: (259 commits) SavedObjects bulkCreate API should return migrationVersion and strip the type & namespace from the id (elastic#65150) Drilldown count tooltip (elastic#65105) plugins logs start with "plugins." prefix (elastic#65710) [ML] Fix pagination reset on search query update. (elastic#65668) [SIEM] Add types to the mappings objects so extra keys cannot be introduced [apm] Update machine learning flyout and service maps docs (elastic#65517) change api endpoint and throw error (elastic#65790) [Maps] remove SLA percentage metric (elastic#65718) [Reporting] APM integration for baseline performance measurements (elastic#59967) fix(NA): noParse regex for windows on kbn optimizer (elastic#65755) [ML] DFA: ensure at least one field is included in analysis before job can be created (elastic#65320) [Data plugin] cleanup - remove unused getRoutes / routes from indexPattern object (elastic#65683) Removed skip to enable test. (elastic#65575) [Lens] Type safe migrations (elastic#65576) [Canvas] Fix nav link behavior in Canvas (elastic#65590) [Event log] Fix flaky test (elastic#65658) [Alerting] changes preconfigured actions config from array to object (elastic#65397) remove immediate functions from esqueue worker cycles (elastic#65375) [Metrics UI] Fix isAbove to only display when threshold set (elastic#65540) draft search profiler accessibility tests (elastic#62357) ... # Conflicts: # x-pack/plugins/ingest_pipelines/public/application/components/pipeline_form/pipeline_form_fields.tsx
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…the type & namespace from the id (#65150) (#65819) * Deserialize bulkCreate response to remove namespace type from id * Index operations don't return _source in response * Fix integration tests * repository: make id generation and seq_no/primary_term spreading more explicit * API Integration test for bulk create without ids * Fix copy_to_space snapshot * Revert "Fix copy_to_space snapshot" This reverts commit 9c2b743. * Move test into returns block * repository.test.js stricter regexp matching
…the type & namespace from the id (#65150) (#65820) * Deserialize bulkCreate response to remove namespace type from id * Index operations don't return _source in response * Fix integration tests * repository: make id generation and seq_no/primary_term spreading more explicit * API Integration test for bulk create without ids * Fix copy_to_space snapshot * Revert "Fix copy_to_space snapshot" This reverts commit 9c2b743. * Move test into returns block * repository.test.js stricter regexp matching
Summary
Fixes #65088
Release notes
When bulk creating saved objects without specifying the
id's of the objects to be created, theSavedObjectsClientJavascript API and HTTP API incorrectly returned the raw id in the response. In addition, these API's also didn't return themigrationVersionproperty of the saved objects that were bulk created. This fix ensures that a valid saved object id and themigrationVersionproperty are returned in the bulk create response.Checklist
Delete any items that are not applicable to this PR.
For maintainers