-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Lens] Make Lens saved object share-capable #111403
[Lens] Make Lens saved object share-capable #111403
Conversation
Pinging @elastic/kibana-vis-editors (Team:VisEditors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes LGTM!
I think your tests are likely failing due to the fixtures in x-pack/test/functional/es_archives/lens/basic/data.json
.
I did a quick look at the objects and I noticed that the lens objects in that file don't have a migrationVersion
field defined.
Because of that, the document migrator thinks that the object is up-to-date, and doesn't attempt to convert it. But our SOR deserializer also expects multiple-isolated
object types to have a namespaces
field.
So as a quick fix you could add these fields to your lens objects in that test fixture file:
namespaces: ['default'],
migrationVersion: { lens: '8.0.0' }
If that doesn't work, perhaps it would be a good idea to add some ES queries before the test assertions to see what saved object documents actually exist, and make sure that the lens was converted properly.
Feel free to ping me if you need a hand troubleshooting.
(Also note: I am not sure why x-pack/test/functional/es_archives/lens/basic/data.json.gz
also exists, you should be able to delete that)
5e73d37
to
f8da524
Compare
874977f
to
3332a3e
Compare
Found the cause of the breaking test. We use a bit hacky I wanted to replace We use
I think something about EDIT: I found |
3332a3e
to
0c2af3f
Compare
Nice sleuthing!
I don't believe anything in the Elasticsearch Bulk API guarantees that operations will be executed in the order that they are specified. The SavedObjectsClient doesn't explicitly prevent specifying the same object twice in a single operation, but this hacky approach certainly isn't recommended.
The SavedObjectsClient abstracts the bulk API details away from the consumer. To use an index operation, you'll want to make this call: return await this.client.create(DOC_TYPE, attributes, { id: savedObjectId, overwrite: true }); |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice investigation Marta! Code LGTM I didn't test it locally but everything looks fine :)
…-link-to-kibana-app * 'master' of github.com:elastic/kibana: (120 commits) [TSVB] Support custom field format (elastic#101245) [VisEditors] Add code ownership to the functional tests (elastic#111680) [Lens] Make Lens saved object share-capable (elastic#111403) [Graph] Make Graph saved object share-capable (elastic#111404) [Stack Monitoring] Add breadcrumb support (elastic#111850) Update Jira Cloud to use OAuth2.0 (elastic#111493) Show warning message when attempting to create an APM alert in stack management (elastic#111781) Skip suite blocking ES snapshot promotion (elastic#111907) Respect `auth_provider_hint` if session is not authenticated. (elastic#111521) Added in 'Responses' field in alert telemetry & updated test (elastic#111892) [Usage collection] refactor cloud detector collector (elastic#110439) Make classnames a shared dep (elastic#111636) Fix link to e2e tests in APM testing.md (elastic#111869) [Security Solution] Add host.os.name.caseless mapping and runtime field (elastic#111455) [APM] Removes the beta label from APM tutorial (elastic#111499) (elastic#111828) [RAC] [Observability] Expand Observability alerts page functional tests (elastic#111297) Fix extra white space on the alert table whe page size is 50 or 100 (elastic#111568) [Metrics UI] Add Inventory Timeline open/close state to context and URL state (elastic#111034) [Graph] Switch to SavedObjectClient.resolve (elastic#109617) [APM] Adding lambda icon (elastic#111834) ... # Conflicts: # x-pack/plugins/reporting/public/management/__snapshots__/report_listing.test.tsx.snap
Fixes #105808
Step 4 of https://www.elastic.co/guide/en/kibana/master/sharing-saved-objects.html#sharing-saved-objects-step-4
I was thinking about waiting with this one closer to 8.0.0, but it's such a small change that I don't think it'll cause any conflicts.