-
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
Add enhancements for legacy URL aliases #125960
Add enhancements for legacy URL aliases #125960
Conversation
54c0f2e
to
f03b7a9
Compare
045027c
to
a099924
Compare
If an alias has this optional boolean attribute set to "true", then consumers that resolve the alias will avoid showing a toast message upon redirecting users to the alias target.
a099924
to
a8916f1
Compare
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.
So far, the approach makes sense to me.
I tested the PR out and it works as described.
Thanks for those fantastic test setup scripts!
We should probably get other folks from core to take a look too but that can happen after the PR is taken out of draft.
@jportner ack, will take a look next Monday |
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.
Implementation LGTM in current state. I'm just a bit concerned about the suppressRedirectToast
naming surfaced from the low-level SO APIs, but I guess that can be considered a NIT?
Changed from "suppressRedirectToast" boolean to "purpose" string. The `resolve/bulkResolve` APIs interpret this and return the "suppress_redirect_toast" field to consumers if "purpose" is defined.
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.
Tested locally and all looking good! 👍
Now when you resolve a saved object, if an alias exists, the alias's purpose will be returned to the consumer. Also adds a saved object migration to ensure that a purpose is set for any existing aliases.
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.
Tested locally. Cases changes LTGM!
@elasticmachine merge upstream |
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.
Vis editors changes LGTM, I tested the lens and TSVB examples and I also created manually an agg-based vis with a saved search both on default and on the another space. Everything works as expected!
Thanx for the detailed instructions Joe!
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.
DataDiscover.team code LGTM, thx for the great help providing test data, tested locally, Graph and Discover links work as expected. Would btw be a nice use case for our ci:deploy-cloud
tag. Having a cloud instance with testdata already added for this would be 🍰
@elasticmachine merge upstream |
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.
LGTM
Thanks for updating the docs at the same time!
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.
maps 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.
Security Solution changes look good! I'm not sure if you saw this but we have some e2e tests around the resolve api in the security solution here https://github.com/elastic/kibana/blob/461415b24c98ed8430d729141bf243805e913083/x-pack/test/detection_engine_api_integration/security_and_spaces/tests/resolve_read_rules.ts
Ran these tests locally and they passed but if you think it's worth adding / modifying an expect
there feel free. Either way LGTM!
Nice! Added an assertion here: 8117ced |
@elasticmachine merge upstream |
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.
Presentation team changes LGTM! The code changes make sense, just updating our usages of an API.
I couldn't test this locally due to a Kibana server error:
It's unclear whether it's a problem in main, or a problem with my configuration. Either way, I'm approving to unblock as it seems like the changes have been tested quite thoroughly, and if there were any problems loading the dashboard or workpad saved objects, plenty of functional tests would have failed!
I spoke to @dhurley14 and we agreed to skip the failing Cypress test to "Mark one alert as acknowledged when more than one open alerts are selected": kibana/x-pack/plugins/security_solution/cypress/integration/detection_alerts/acknowledged.spec.ts Line 77 in 583de26
These Cypress tests are only triggered when someone makes changes to the Security Solution code, so they aren't failing in our hourly CI builds or other PRs but he confirmed that this particular test is failing in the main branch. Edit: skipped in ca8b683. |
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.
LGTM
💚 Build SucceededMetrics [docs]Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Resolves #127047.
Overview
This PR makes a few changes:
purpose
string attribute. This is returned to Saved Object consumers withresolve
result asalias_purpose
(only when the outcome is "aliasMatch" or "conflict").purpose
string attribute.redirectLegacyUrl
API now has a single options object parameter, and that requires a newaliasPurpose
string option.There are no bug fixes or user-facing features included in this PR, so I tagged it with
release_note:skip
.Testing
For legacy URL aliases in the Default space:
I updated the integration tests accordingly.
I also include test data below to manually verify that aliases work in the Default space.
For
aliasPurpose
/alias_purpose
:If the
purpose
attribute is set in the legacy URL alias, thenalias_purpose: true
is included in theresolve
/bulkResolve
response.The meat of this change is really in the UI for consumers of the
redirectLegacyUrl
API. Since this API changed, I updated all consumers of it. That said, it didn't feel necessary to add functional tests for different consumers for a simple attribute change.I created test data to manually verify the changes work in the UI. Test procedures:
load-test-data.sh
script and modify any environment variables needed at the top of the filedashboard
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
search-session
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
visualization
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
canvas-workpad
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
cases
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
graph-workspace
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
lens
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
map
redirect-with-toast
,redirect-without-toast
redirect-with-toast
,redirect-without-toast
timeline
alert
alert
Note for the last three rows in the table: these usages of the
redirectLegacyUrl
API have been changed, but I wasn't able to figure out exactly how to test them in the UI as I'm not familiar with Kibana. I'd appreciate help from the codeowners here! You can manually create legacy URL aliases for a saved object using curl:Manually create aliases
The curl command below will create two aliases, one that will redirect the user with a toast, and one that will redirect the user without a toast.
You can change the following values in the command:
alert
123
default
Docs changes
I updated the docs for Resolve, Bulk Resolve, and Sharing Saved Objects accordingly: preview link