[SOR] use initialNamespaces when checking for conflict for create and bulkCreate#111023
Conversation
jportner
left a comment
There was a problem hiding this comment.
LGTM, couple of nits below. Thanks for fixing this 🙏
| }); | ||
| }); | ||
|
|
||
| it(`returns error when there is a conflict with an existing multi-namespace saved object with initialNamespaces (get)`, async () => { |
There was a problem hiding this comment.
| it(`returns error when there is a conflict with an existing multi-namespace saved object with initialNamespaces (get)`, async () => { | |
| it(`returns error when there is an unresolvable conflict with an existing multi-namespace saved object when using initialNamespaces (get)`, async () => { |
| expect(client.get).toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it(`throws when there is a conflict with an existing multi-namespace saved object when using initialNamespaces (get)`, async () => { |
There was a problem hiding this comment.
| it(`throws when there is a conflict with an existing multi-namespace saved object when using initialNamespaces (get)`, async () => { | |
| it(`throws when there is an unresolvable conflict with an existing multi-namespace saved object when using initialNamespaces (get)`, async () => { |
| } | ||
| const namespaceId = namespaces[0] === 'default' ? undefined : namespaces[0]; | ||
|
|
||
| // const namespaceId = objectNamespace === 'default' ? undefined : objectNamespace ?? namespace; |
There was a problem hiding this comment.
Did you forget to delete this?
| // const namespaceId = objectNamespace === 'default' ? undefined : objectNamespace ?? namespace; |
|
Note: I would say we should backport this to 7.15, but it depends on #109967 which was only backported to 7.16. Edit: then again, it only affects multi-ns objects, of which we only have ML jobs in 7.x, so maybe it's not a big deal if we don't fix this in 7.15. |
⏳ Build in-progress, with failures
To update your PR or re-run it, just comment with: |
|
retest |
…-initialNamespaces
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
|
Pinging @elastic/kibana-core (Team:Core) |
| * @param type The type of the saved object. | ||
| * @param id The ID of the saved object. | ||
| * @param namespace The target namespace. | ||
| * @param initialNamespaces The target namespace(s) we intend to create the object in, if specified. |
There was a problem hiding this comment.
nit: The difference between namespace and initialNamespaces is subtle and it might be worth adding a bit more info here about when each is used.
TinaHeiligers
left a comment
There was a problem hiding this comment.
A small (very optional) nit, otherwise thanks for getting this done so quickly!
LGTM
…nd `bulkCreate` (elastic#111023) * use initialNamespaces when checking for conflict * nits
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…eporting-to-v2 * 'master' of github.com:elastic/kibana: (65 commits) Move to vis_types folder part 2 (elastic#110574) [SOR] use initialNamespaces when checking for conflict for `create` and `bulkCreate` (elastic#111023) [Discover] Remove export* syntax (elastic#110934) [Event log][7.x] Updated event log client to search across legacy IDs (elastic#109365) [Security Solution][Detection Rules] Changes 'activated' text on rule details page (elastic#111044) [Metrics UI] Filter out APM nodes from the inventory view (elastic#110300) [package testing] Update logging and pid configuration (elastic#111059) [Dashboard] Read App State from URL on Soft Refresh (elastic#109354) Add correct roles to test user for functional tests in dashboard (elastic#110880) [DOCS] Adds Lens Inspector and minor edits (elastic#109736) [DOCS] Updates Spaces page (elastic#111005) normalize initialNamespaces (elastic#110936) [Reporting] Clean up `any` usage, reorganize server route files (elastic#110740) [Security Solution] [CTI] Fixes bug that caused Threshold and Indicator Match rules to ignore custom rule filters if a saved query was used in the rule definition. (elastic#109253) skip flaky suites: elastic#111001, elastic#111022 [Security Solution][RAC] - Update reason field text (elastic#110308) [RAC][Security Solution] Make analyzer work with EuiDataGrid full screen (elastic#110913) [Metrics UI] Add integration tests for Metric Threshold Rule and refactor to fire correctly (elastic#109971) [DOCS] Updates Discover docs (elastic#110346) [RAC] Persistent timeline fields fix (elastic#110685) ...
Summary
Found during #109196
Uses
object.initialNamespaceswhen present, instead of the providednamespace, when checking for conflicts duringcreateandbulkCreateoperationsChecklist