-
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
Spaces - server-side to NP plugin #46181
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
💚 Build Succeeded |
ACK: will be reviewing tomorrow |
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.
Finished with the code review, looks great so far! Haven't tested locally yet, but wanted to leave a code feedback already, nothing major - mostly nits.
import { getSpaceIdFromPath, addSpaceIdToPath } from '../../common/lib/spaces_url_parser'; | ||
import { DEFAULT_SPACE_ID } from '../../common/constants'; | ||
import { spaceIdToNamespace, namespaceToSpaceId } from '../lib/utils/namespace'; | ||
import { Space } from '../../common/model/space'; | ||
|
||
type RequestFacade = KibanaRequest | Legacy.Request; |
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.
question: how do you feel about dropping support for Legacy.Request
completely in NP plugin? If someone in LP wants to call request-based NP API they will have to call KibanaRequest.from(legacyRequest)
. We also have legacy Spaces plugin that would do that internally for the APIs it still wants to re-expose to LP.
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.
I think that's a great idea!
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.
Actually I'm going to revert this change - the spaces service still requires the getBasePath
function that exists on the LP request and the "fake" requests used by alerting and reporting. I'd rather come up with a holistic solution for these fake requests in a dedicated PR since it will likely end up touching these other plugins as well
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.
Ugh, I see 😭 Tackling this separately sounds good to me.
@@ -5,7 +5,7 @@ | |||
*/ |
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.
note: just an observation, we have a bunch of lib
folders (and even one lib/utils
) here and there that basically serve as catch-all buckets for the code we couldn't properly categorize. Not in this PR, but it feels like a good time to think how we can have a better structure for the content of the lib
folders.
x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/server/lib/request_interceptors/on_request_interceptor.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/server/routes/api/__fixtures__/create_legacy_api.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/server/routes/api/__fixtures__/create_legacy_api.ts
Outdated
Show resolved
Hide resolved
@elastic/kibana-stack-services @elastic/ml-ui You've been pinged due to an interface rename from |
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.
ML edit LGTM!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…for the time being
💚 Build Succeeded |
@azasypkin ready for another review whenever you get a chance! |
ACK: reviewing |
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, great job! Performed a smoke test locally and haven't noticed anything suspicious.
💚 Build Succeeded |
Summary
This moves the bulk of the Spaces server-side implementation to a NP plugin.
TODO
serverBasePath
propertyi18n
allow plugins to specify multiple paths (i18n - allow plugins to specify multiple paths #46578)deferring