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

Sharing saved objects, phase 2 #80945

Merged
merged 41 commits into from
Jan 20, 2021

Conversation

jportner
Copy link
Contributor

@jportner jportner commented Oct 19, 2020

Resolves: #54837

Blocked by: #86247

⚠️ This PR is best reviewed on a per-commit basis ⚠️

Several commits are just refactoring existing code with no functionality changes.

This PR allows existing single-namespace saved object types to be migrated (converted) into multi-namespace types. The details are outlined in the linked issue, but the primary changes are listed below.

Migrations

The Saved Objects Migration process previously only applied one type of transform function -- what I now refer to as a "migration transform". These are completely defined by consumers, and can alter objects in many ways, up to and including changing the object type itself.

This PR adds two additional transform functions:

  • "Conversion transforms" are used to transform an object from a single-namespace type into a multi-namespace type. This includes modifying the fields and creating a LegacyUrlAlias object if its ID is being regenerated.
  • "Reference transforms" are used to transform inbound references for objects that are being converted.

These additional transforms are still applied in an idempotent manner: for any given type, reference transforms are applied first, then conversion transforms, and then migration transforms.

Consumers can apply these conversions by specifying the convertToMultiNamespaceTypeVersion field during object registration (see docs).

Aliases

LegacyUrlAlias objects are created for any type that is converted while in a non-default namespace. This allows consumers to access the object ("alias target") using its old ID.

Consumers who expose object IDs to end-users externally (e.g., in URLs) should eschew SavedObjectsClient.get() in favor of the new SavedObjectsClient.resolve() method once they convert these objects to multi-namespace types. The introduction of this method is not a breaking change in and of itself; however, if consumers implement it they will need to take the new response type into account for their UI flows, and that could be a breaking change for any consumers who rely on 3rd-party integrations with these URLs.

UI changes

As discussed in the linked issue, there is potential for "alias conflict" situations. This primarily may occur by sharing an object which had previously been copied to the target space. We will add a check and additional screen to attempt to prevent this from happening in the Share to Space Flyout. However, it is not required for this PR, so I opted to split that into a separate follow-on PR.


Docs preview: https://kibana_80945.docs-preview.app.elstc.co/diff

@jportner jportner force-pushed the issue-54837-ssobjects-phase-2 branch 3 times, most recently from a6c68ac to 6a41023 Compare November 23, 2020 19:29
@jportner jportner force-pushed the issue-54837-ssobjects-phase-2 branch 2 times, most recently from 2256c32 to 82fa05a Compare November 30, 2020 20:52
Refactor some code and unit tests to prepare for following commits.
No functionality changes.
Test cases were missing for multi-namespace types. Added those
tests. No functionality changes.
1. The migration loop no longer resets if the object does not have
a [type] field. Objects never have this field after being
deserialized from their raw document format, this functionality
appears to be unnecessary and can cause unexpected behavior
(though migrations still worked because the loop would get
restarted).
2. Changed one unit test case that depended upon the aforementioned
condition. This appeared to be an invalid test case which would not
actually be encountered in a real world scenario, since it relied
on an object containing a [type] field.
3. The migration loop now resets if an object's migrationVersion
has explicitly been increased by a transform function. This is
expected behavior and a unit test exercises it, but it was
a side effect of the aforementioned condition.
These can only be applied using the
`convertToMultiNamespaceTypeVersion` field when defining the object
type. Doing so will cause the document migrator to apply a special
transform function to convert the document from a single-namespace
type to a multi-namespace type in the specified version. Note that
this transform is applied before any consumer-defined migrations in
the same version.
These are applied to all types using the
`convertToMultiNamespaceTypeVersion` field when defining any object
type. Any time the Kibana version is changed, all reference
transforms for applicable versions are applied, and all documents'
`referencesMigrationVersion` fields are updated to match the Kibana
version.
@jportner jportner force-pushed the issue-54837-ssobjects-phase-2 branch from 82fa05a to 358dd27 Compare December 2, 2020 02:38
New integration tests (except for Jest integration tests) are
intentionally excluded. Will be added in a separate commit after
conversion transforms include aliases.
@jportner jportner force-pushed the issue-54837-ssobjects-phase-2 branch from 358dd27 to aeb2ea6 Compare December 2, 2020 04:40
@jportner jportner force-pushed the issue-54837-ssobjects-phase-2 branch from aeb2ea6 to dd9ecd6 Compare December 2, 2020 05:02
@jportner jportner added release_note:skip Skip the PR/issue when compiling release notes v7.11.0 v8.0.0 labels Dec 2, 2020
@jportner jportner marked this pull request as ready for review December 2, 2020 05:03
@jportner jportner requested review from a team as code owners December 2, 2020 05:03
@jportner jportner added v7.12.0 and removed v7.11.0 labels Dec 2, 2020
Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. My first pass:

src/core/server/saved_objects/object_types/registration.ts Outdated Show resolved Hide resolved
src/core/server/saved_objects/serialization/types.ts Outdated Show resolved Hide resolved
Comment on lines 1686 to 1766
return omit(savedObject, 'namespace') as SavedObject<T>;
return omit(savedObject, ['namespace', 'referencesMigrationVersion']) as SavedObject<T>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we omitting referencesMigrationVersion if we are keeping migrationVersion. (But TIL, I wasn't aware migrationVersion was exposed...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just figured there's no reason to expose it to consumers (and doing so would mean I have to change a ton of integration tests).

Copy link
Contributor

@rudolf rudolf Dec 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We expose the migrationVersion so that we know which migrations to run (if any) on incoming data. That way if an integration read a document from v7.9.0 and then at a later point writes it back to v7.10.0 we will migrate the v7.9.0 document before writing it into ES.

We want the same behaviour for referencesMigrationVersion, otherwise an integration which does an POST /api/saved_objects/<type>/<id>?overwrite=true will create a document which has invalid references.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core could inject it's own migrations into buildActiveMigrations https://github.com/elastic/kibana/blob/master/src/core/server/saved_objects/migrations/core/document_migrator.ts#L194-L222

So that if a dashboard defined a migration for v7.9.0, but core wants to migrate it in v7.11.0 (to perform the referencesMigration) then the latestVersion for the dashboard type becomes 7.11.0. The advantage is that the API only has a single migrationVersion field. Consumers really shouldn't have to know all the versions of all the kinds of migrations we applied. (And based on #70815 we'll move from migrationVersion: {dashboard: '7.11.0'} to migrationVersion: '7.11.0').

The disadvantage is it's less explicit where a migration comes from. If a developer inspects a dashboard they might be surprised that it was migrated in 7.11.0 because they never defined such a migration for their type.

I'm a little bit torn between the developer experience and keeping the API simpler and cleaner. It would be good to hear others thoughts on this?

If we do keep an additional field I would vote for it to be renamed to coreMigrationVersion so that it could be used anytime core wants to apply a migration like for instance to implement #70815.

Copy link
Contributor Author

@jportner jportner Dec 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rudolf I'm going to reply to your comments out of order 😄

If we do keep an additional field I would vote for it to be renamed to coreMigrationVersion so that it could be used anytime core wants to apply a migration like for instance to implement #70815.

Agreed, that sounds better and I'll refer to it as that from now on.

We want the same behaviour for referencesMigrationVersion, otherwise an integration which does an POST /api/saved_objects/<type>/<id>?overwrite=true will create a document which has invalid references.

I respectfully disagree. I feel strongly that coreMigrationVersion should be an implementation detail that is not exposed to consumers. I specifically designed this so "convert" and "reference" transforms would not be applied when documents are created, but only during the startup migration process.

We don't enforce referential integrity when objects are created, and we don't know if the outbound reference is valid or not. We do enforce referential integrity (to some extent) when importing objects; in that case, potential ID collisions are detected, IDs are regenerated (in the case of createNewCopies mode or "unresolvable conflicts"), and references are updated if need be before any objects are created.

If we silently change reference IDs when objects are created, I think it'll be quite confusing to consumers. Not to mention that to avoid this behavior, consumers would have to specify a coreMigrationVersion equal to Kibana's current version when they create objects -- and that input would need to change every time Kibana is upgraded.

The disadvantage is it's less explicit where a migration comes from. If a developer inspects a dashboard they might be surprised that it was migrated in 7.11.0 because they never defined such a migration for their type.

I don't think we should attempt to expose coreMigrationVersion externally or try to tie "reference" transforms to the regular migrationVersion instead. These transforms are only applied because of other objects which may potentially be due to an external plugin that does not come bundled with Kibana.

I think it's safe and reasonable to say:

  • When you upgrade Kibana, we guarantee your saved object references will stay intact when object types are converted
  • After you upgrade Kibana, your old exports can still be imported, and we guarantee your saved object references will stay intact
  • After you upgrade Kibana, if you're manually recreating/updating existing documents using the experimental saved objects APIs, you're on your own to make sure your object IDs are still correct and your references are intact.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed referencesMigrationVersion to coreMigrationVersion in abd7d2b!

Added validation to ensure that documents with a newer
coreMigrationVersion will result in an error. Also renamed some
existing tests to be more accurate.
Consumers can now see this field when retrieving existing objects,
and they can set it when creating new objects.
Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

App services changes lgtm

Copy link
Contributor

@rudolf rudolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience in ironing out everything

Copy link
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on Green CI! 🎉

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

X-Pack Saved Object Tagging Functional Tests.x-pack/test/saved_object_tagging/functional/tests/maps_integration·ts.saved objects tagging - functional tests maps integration creating "before each" hook for "allows to select tags for a new map"

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: saved objects tagging - functional tests
[00:00:00]           └-> "before all" hook
[00:00:00]           └-> "before all" hook
[00:00:00]             │ debg creating role kibana_rbac_default_space_read_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_read_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_write_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_write_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_so_management_write_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_so_management_write_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_so_management_read_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_so_management_read_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_so_tagging_read_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_so_tagging_read_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_so_tagging_write_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_so_tagging_write_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_dashboard_read_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_dashboard_read_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_dashboard_write_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_dashboard_write_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_visualize_read_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_visualize_read_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_visualize_write_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_visualize_write_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_advanced_settings_read_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_advanced_settings_read_user]
[00:00:00]             │ debg creating role kibana_rbac_default_space_maps_read_user
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added role [kibana_rbac_default_space_maps_read_user]
[00:00:00]             │ debg creating user not_a_kibana_user
[00:00:00]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [not_a_kibana_user]
[00:00:00]             │ debg created user not_a_kibana_user
[00:00:00]             │ debg creating user a_kibana_rbac_default_space_read_user
[00:00:00]             │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] [.ds-ilm-history-5-2021.01.20-000001] creating index, cause [initialize_data_stream], templates [ilm-history], shards [1]/[0]
[00:00:00]             │ info [o.e.c.m.MetadataCreateDataStreamService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] adding data stream [ilm-history-5] with write index [.ds-ilm-history-5-2021.01.20-000001] and backing indices []
[00:00:00]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_read_user]
[00:00:00]             │ debg created user a_kibana_rbac_default_space_read_user
[00:00:00]             │ debg creating user a_kibana_rbac_default_space_write_user
[00:00:00]             │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.ds-ilm-history-5-2021.01.20-000001][0]]])." previous.health="YELLOW" reason="shards started [[.ds-ilm-history-5-2021.01.20-000001][0]]"
[00:00:00]             │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] moving index [.ds-ilm-history-5-2021.01.20-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [ilm-history-ilm-policy]
[00:00:00]             │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] moving index [.ds-ilm-history-5-2021.01.20-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [ilm-history-ilm-policy]
[00:00:00]             │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] moving index [.ds-ilm-history-5-2021.01.20-000001] from [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-follow-shard-tasks"}] in policy [ilm-history-ilm-policy]
[00:00:00]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_write_user]
[00:00:00]             │ debg created user a_kibana_rbac_default_space_write_user
[00:00:00]             │ debg creating user a_kibana_rbac_default_space_so_management_write_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_so_management_write_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_so_management_write_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_so_tagging_read_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_so_tagging_read_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_so_tagging_read_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_so_tagging_read_so_management_read_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_so_tagging_read_so_management_read_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_so_tagging_read_so_management_read_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_so_tagging_write_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_so_tagging_write_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_so_tagging_write_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_dashboard_read_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_dashboard_read_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_dashboard_read_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_visualize_read_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_visualize_read_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_visualize_read_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_dashboard_write_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_dashboard_write_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_dashboard_write_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_visualize_write_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_visualize_write_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_visualize_write_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_advanced_settings_read_user
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_advanced_settings_read_user]
[00:00:01]             │ debg created user a_kibana_rbac_default_space_advanced_settings_read_user
[00:00:01]             │ debg creating user a_kibana_rbac_default_space_maps_read_user
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] added user [a_kibana_rbac_default_space_maps_read_user]
[00:00:02]             │ debg created user a_kibana_rbac_default_space_maps_read_user
[00:13:51]           └-: maps integration
[00:13:51]             └-> "before all" hook
[00:13:51]             └-> "before all" hook
[00:13:51]               │ info [maps] Loading "data.json"
[00:13:51]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] [.kibana_2/yFUASAVTR6OS10_hX5PiYw] update_mapping [_doc]
[00:13:51]               │ info [maps] Indexed 9 docs into ".kibana"
[00:13:51]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] [.kibana_2/yFUASAVTR6OS10_hX5PiYw] update_mapping [_doc]
[00:13:51]               │ debg Migrating saved objects
[00:13:51]               │ proc [kibana]   log   [20:02:42.794] [info][savedobjects-service] Creating index .kibana_3.
[00:13:51]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] [.kibana_3] creating index, cause [api], templates [], shards [1]/[1]
[00:13:51]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] updating number_of_replicas to [0] for indices [.kibana_3]
[00:13:51]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana_3][0]]])." previous.health="YELLOW" reason="shards started [[.kibana_3][0]]"
[00:13:51]               │ proc [kibana]   log   [20:02:42.852] [info][savedobjects-service] Migrating .kibana_2 saved objects to .kibana_3
[00:13:51]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] [.kibana_3/uU5WMs-MTpGafvKsNKYrgQ] update_mapping [_doc]
[00:13:51]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] [.kibana_3/uU5WMs-MTpGafvKsNKYrgQ] update_mapping [_doc]
[00:13:51]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1611167478367147856] [.kibana_3/uU5WMs-MTpGafvKsNKYrgQ] update_mapping [_doc]
[00:13:51]               │ proc [kibana]   log   [20:02:43.007] [info][savedobjects-service] Pointing alias .kibana to .kibana_3.
[00:13:51]               │ proc [kibana]   log   [20:02:43.046] [info][savedobjects-service] Finished in 253ms.
[00:14:05]             └-: creating
[00:14:05]               └-> "before all" hook
[00:14:05]               └-> allows to select tags for a new map
[00:14:05]                 └-> "before each" hook: global before each
[00:14:05]                 └-> "before each" hook
[00:14:05]                   │ debg Open new Map
[00:14:05]                   │ debg navigateToActualUrl http://localhost:6141/app/maps/map
[00:14:05]                   │ debg browser[INFO] http://localhost:6141/app/maps/map?_t=1611172976819 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:14:05]                   │
[00:14:05]                   │ debg browser[INFO] http://localhost:6141/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:14:05]                   │ debg currentUrl = http://localhost:6141/app/maps/map
[00:14:05]                   │          appUrl = http://localhost:6141/app/maps/map
[00:14:05]                   │ debg TestSubjects.find(kibanaChrome)
[00:14:05]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:14:06]                   │ debg Renderable.waitForRender for 1 elements
[00:14:06]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:16]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:16]                   │ERROR browser[SEVERE] https://tiles.maps.elastic.co/v7.11/manifest?elastic_tile_service_tos=agree&my_app_name=kibana&my_app_version=8.0.0-SNAPSHOT&license=c2904185-4d09-4301-9c68-7527b6eaa746 - Failed to load resource: net::ERR_NETWORK_CHANGED
[00:14:16]                   │ debg --- retry.try error: 0 elements completed rendering, still waiting on a total of 1
[00:14:16]                   │                      specifically:
[00:14:16]                   │
[00:14:17]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:27]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:27]                   │ debg --- retry.try failed again with the same message...
[00:14:27]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:37]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:37]                   │ debg --- retry.try failed again with the same message...
[00:14:38]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:48]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:48]                   │ debg --- retry.try failed again with the same message...
[00:14:48]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:14:58]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:14:58]                   │ debg --- retry.try failed again with the same message...
[00:14:59]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:15:09]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:15:09]                   │ debg --- retry.try failed again with the same message...
[00:15:09]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:15:19]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:15:20]                   │ debg --- retry.try failed again with the same message...
[00:15:20]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:15:30]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:15:30]                   │ debg --- retry.try failed again with the same message...
[00:15:31]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:15:41]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:15:41]                   │ debg --- retry.try failed again with the same message...
[00:15:41]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:15:51]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:15:51]                   │ debg --- retry.try failed again with the same message...
[00:15:52]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:16:02]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:16:02]                   │ debg --- retry.try failed again with the same message...
[00:16:02]                   │ debg Find.allByCssSelector('[data-render-complete="true"]') with timeout=10000
[00:16:12]                   │ debg Find.allByCssSelector('[data-render-complete="false"]') with timeout=10000
[00:16:12]                   │ debg --- retry.try failed again with the same message...
[00:16:13]                   │ info Taking screenshot "/dev/shm/workspace/parallel/4/kibana/x-pack/test/saved_object_tagging/functional/screenshots/failure/saved objects tagging - functional tests maps integration creating _before each_ hook.png"
[00:16:13]                   │ info Current URL is: http://localhost:6141/app/maps/map#?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(filters:!(),query:(language:kuery,query:%27%27))
[00:16:13]                   │ info Saving page source to: /dev/shm/workspace/parallel/4/kibana/x-pack/test/saved_object_tagging/functional/failure_debug/html/saved objects tagging - functional tests maps integration creating _before each_ hook.html
[00:16:13]                   └- ✖ fail: saved objects tagging - functional tests maps integration creating "before each" hook for "allows to select tags for a new map"
[00:16:13]                   │      retry.try timeout: Error: 0 elements completed rendering, still waiting on a total of 1
[00:16:13]                   │                 specifically:
[00:16:13]                   │ 
[00:16:13]                   │     at /dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:39:17
[00:16:13]                   │     at runMicrotasks (<anonymous>)
[00:16:13]                   │     at processTicksAndRejections (internal/process/task_queues.js:93:5)
[00:16:13]                   │     at runAttempt (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:27:15)
[00:16:13]                   │     at retryForSuccess (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:66:21)
[00:16:13]                   │     at Retry.try (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry.ts:32:14)
[00:16:13]                   │     at Renderable.waitForRender (/dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:30:7)
[00:16:13]                   │     at GisPage.openNewMap (/dev/shm/workspace/parallel/4/kibana/x-pack/test/functional/page_objects/gis_page.ts:148:7)
[00:16:13]                   │     at Context.<anonymous> (/dev/shm/workspace/parallel/4/kibana/x-pack/test/saved_object_tagging/functional/tests/maps_integration.ts:77:9)
[00:16:13]                   │     at Object.apply (/dev/shm/workspace/parallel/4/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)
[00:16:13]                   │   Error: retry.try timeout: Error: 0 elements completed rendering, still waiting on a total of 1
[00:16:13]                   │                   specifically:
[00:16:13]                   │   
[00:16:13]                   │       at /dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:39:17
[00:16:13]                   │       at runMicrotasks (<anonymous>)
[00:16:13]                   │       at processTicksAndRejections (internal/process/task_queues.js:93:5)
[00:16:13]                   │       at runAttempt (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:27:15)
[00:16:13]                   │       at retryForSuccess (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:66:21)
[00:16:13]                   │       at Retry.try (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry.ts:32:14)
[00:16:13]                   │       at Renderable.waitForRender (/dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:30:7)
[00:16:13]                   │       at GisPage.openNewMap (test/functional/page_objects/gis_page.ts:148:7)
[00:16:13]                   │       at Context.<anonymous> (test/saved_object_tagging/functional/tests/maps_integration.ts:77:9)
[00:16:13]                   │       at Object.apply (/dev/shm/workspace/parallel/4/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)
[00:16:13]                   │       at onFailure (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:16:13]                   │       at retryForSuccess (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:57:13)
[00:16:13]                   │       at Retry.try (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry.ts:32:14)
[00:16:13]                   │       at Renderable.waitForRender (/dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:30:7)
[00:16:13]                   │       at GisPage.openNewMap (test/functional/page_objects/gis_page.ts:148:7)
[00:16:13]                   │       at Context.<anonymous> (test/saved_object_tagging/functional/tests/maps_integration.ts:77:9)
[00:16:13]                   │       at Object.apply (/dev/shm/workspace/parallel/4/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)
[00:16:13]                   │ 
[00:16:13]                   │ 

Stack Trace

Error: retry.try timeout: Error: 0 elements completed rendering, still waiting on a total of 1
                specifically:

    at /dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:39:17
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at runAttempt (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:27:15)
    at retryForSuccess (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:66:21)
    at Retry.try (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry.ts:32:14)
    at Renderable.waitForRender (/dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:30:7)
    at GisPage.openNewMap (test/functional/page_objects/gis_page.ts:148:7)
    at Context.<anonymous> (test/saved_object_tagging/functional/tests/maps_integration.ts:77:9)
    at Object.apply (/dev/shm/workspace/parallel/4/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)
    at onFailure (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:17:9)
    at retryForSuccess (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry_for_success.ts:57:13)
    at Retry.try (/dev/shm/workspace/parallel/4/kibana/test/common/services/retry/retry.ts:32:14)
    at Renderable.waitForRender (/dev/shm/workspace/parallel/4/kibana/test/functional/services/renderable.ts:30:7)
    at GisPage.openNewMap (test/functional/page_objects/gis_page.ts:148:7)
    at Context.<anonymous> (test/saved_object_tagging/functional/tests/maps_integration.ts:77:9)
    at Object.apply (/dev/shm/workspace/parallel/4/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)

Metrics [docs]

Page load bundle

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

id before after diff
core 563.6KB 563.8KB +207.0B

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/development-plugin-saved-objects.html#_mappings

id before after diff
coreMigrationVersion - 1 +1

History

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

@jportner jportner merged commit 25f16db into elastic:master Jan 20, 2021
@jportner jportner deleted the issue-54837-ssobjects-phase-2 branch January 20, 2021 22:39
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported release_note:skip Skip the PR/issue when compiling release notes v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sharing saved-objects in multiple spaces: phase 2
6 participants