-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Saved objects] Create URL aliases during "Copy on save" #176552
Comments
Pinging @elastic/kibana-security (Team:Security) |
Thanks for taking the time to open this, @drewdaemon, and for the detailed ask and impact. This sounds very similar to the work we did for import/export recently:
For better or worse, "Copy to Space" leverages import/export behind the scenes, so the level of effort to introduce this will hopefully be less than what was required for #149021, as we can build on top of it. The UX for this experience is already quite option-heavy, so I do worry about adding yet another toggle. That's something we can work with the design team on though, should we decide to pick this up. I'd also be remiss if I didn't cross-link to #144358, as this will be yet another way to proliferate legacy url aliases. |
Thanks for the comments @legrego . As you say, I don't think this is a technically difficult task since the import API already supports this option. Placing it behind a toggle was an idea from @azasypkin to reduce the overall number of URL aliases created—I would leave it up to your team to decide the specifics as either approach is okay with the other stakeholders (including Fleet). I opened this issue because it seems like a reasonable step to evaluate, but I wouldn't consider it ready to schedule until we make sure that creating aliases during copy-to-spaces improves the situation—so far the discussion has not included an actual PoC. |
A PoCI installed assets from the System integration and copied a set of weak-linked dashboards to a non-default space, setting Screen.Recording.2024-02-13.at.3.10.30.PM.movA couple other notesSurprisingly—I then copied the assets from that second space to a third space and the links continued to work. I expected them to break since the new URL aliases would be mapping the IDs from the second space to the new IDs in the third, while the links would still reference the original IDs found in the default space. However, if the URL aliases are global, it may be performing a two-step redirect. It's worth noting that if some linked-to assets are not copied to the new space, the weak links will still be broken. They don't direct you to the assets in the original space. I also don't understand why these copy options are included here... No matter what I'm going to get objects with new IDs because we enforce that across spaces. Also, there won't be conflicts for the very same reasons. ConclusionAnyway, I think we can consider this issue a valid tactical solution to the common problem of weak-links across spaces. |
Correct, it's expected to work, but there are no two-step redirects or anything like that. The reason it works is that when you copy an object without regenerating the ID, it retains the original ID as the "legacy-url-alias": {
"sourceId": "6604aa8b-a22b-45de-a838-d06eeadb4b4e", <--- origin ID
"targetNamespace": "space-a",
"targetId": "1c601f67-99b9-4780-9b50-8f2a69a78c5a" <--- new ID in Space A
},
"legacy-url-alias": {
"sourceId": "6604aa8b-a22b-45de-a838-d06eeadb4b4e", <--- origin ID
"targetNamespace": "space-b",
"targetId": "3bb6dbb-46af-4a8c-a734-8dc3ef50b4d9" <--- new ID in Space B
} |
Background
Users create or install dashboards in a single space. They often want to have those dashboards available in other spaces. Our answer today is the "Copy to spaces" action in the saved object management page:
However, because saved object IDs change during import to another space, "Copy to spaces" breaks weak links—that is, links that hard-code the IDs of other saved objects.
Weak links can be added via markdown, via URL field formatters, via TSVB tables, via Vega, etc. They are currently quite common.
Users of our integrations hit this issue especially consistently:
Eventually, we plan to allow dashboards to be shared between spaces. Strategically, this is the obvious answer! And we want to do it. But it’s a large project. In the meantime....
The ask
Let's
The switch could go somewhere in here:
The text was updated successfully, but these errors were encountered: