[Remote clusters] Migrate server code out of legacy#56781
[Remote clusters] Migrate server code out of legacy#56781alisonelizabeth merged 13 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
💔 Build FailedTest FailuresKibana Pipeline / kibana-xpack-agent / X-Pack API Integration Tests.x-pack/test/api_integration/apis/management/remote_clusters/remote_clusters·js.apis management remote clusters Remote Clusters Add should not allow us to re-add an existing remote clusterStandard OutStack TraceKibana Pipeline / kibana-xpack-agent / X-Pack API Integration Tests.x-pack/test/api_integration/apis/management/remote_clusters/remote_clusters·js.apis management remote clusters Remote Clusters Add should not allow us to re-add an existing remote clusterStandard OutStack TraceHistory
To update your PR or re-run it, just comment with: |
💔 Build FailedHistory
To update your PR or re-run it, just comment with: |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
jloleysens
left a comment
There was a problem hiding this comment.
Great work @alisonelizabeth ! I left a few comments. One about typing information that I think should be addressed and one about migrating config to New Platform. I think it would be good to include the migration here if we consider this the final migration step from our side.
I created, updated and deleted a remote cluster(s) and the functionality worked 100% 🎉
| @@ -7,8 +7,6 @@ | |||
| import { Legacy } from 'kibana'; | |||
There was a problem hiding this comment.
I think if the goal of this contribution is to complete the NP migration we should strip this file down to the bare minimum required to keep functional parity with legacy. For instance:
- Migrating
configandinjectDefaultVarssee https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md#configure-plugin - Similarly
configPrefixcan be removed if we define it inkibana.jsonI believe - If we use the new platform management service for registering the plugin can we remove
managementSections? - Is
isEnabledbeing used somewhere else?
There was a problem hiding this comment.
👍 I was planning on addressing these items in a separate PR as part of the public migration.
Also, isEnabled is being used by CCR so I think this needs to stay as is for now.
| import { RouteDependencies } from '../../types'; | ||
|
|
||
| export const register = (deps: RouteDependencies): void => { | ||
| const addHandler: RequestHandler<any, any, any> = async (ctx, request, response) => { |
There was a problem hiding this comment.
I think it would be good to try and avoid use of any here when we know what the query, params and body will be.
Using unknown explicitly when we know we don't expect a value in one of those slots makes it clear what we expect for a route. Then passing in type information from:
body: schema.object({
name: schema.string(),
seeds: schema.arrayOf(schema.string()),
skipUnavailable: schema.boolean(),
}),would be really nice!
There was a problem hiding this comment.
Good point, fixed!
| const cluster = get(updateClusterResponse, `persistent.cluster.remote.${name}`); | ||
|
|
||
| if (acknowledged && !cluster) { | ||
| return null; |
There was a problem hiding this comment.
A short comment here explaining why we are not returning a KibanaResponse for the happy path would be helpful 🙂
There was a problem hiding this comment.
Added a comment. The response is being returned on L104.
|
@jloleysens I believe I addressed all of your comments. Mind taking another look? I plan on creating a separate PR to complete the migration of the |
jloleysens
left a comment
There was a problem hiding this comment.
Happy with the changes - did not test manually again.
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: (34 commits) [Index management] Server-side NP ready (elastic#56829) Webhook action - make user and password secrets optional (elastic#56823) [DOCS] Removes reference to IRC (elastic#57245) [Monitoring] NP migration: Local angular module (elastic#51823) [SIEM] Adds ECS link to help menu (elastic#57104) Ensure http interceptors are shares across lifecycle methods (elastic#57150) [Remote clusters] Migrate server code out of legacy (elastic#56781) fixes render bug in alert list (elastic#57152) siem 7.6 updates (elastic#57169) Make the update alert API key API work when AAD is out of sync (elastic#56640) fix(NA): MaxListenersExceededWarning on getLoggerStream (elastic#57133) [Metrics UI] Setup commonly used time ranges in timepicker (elastic#56701) [Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex when ignoreFilterIfFieldNotInIndex is true (elastic#56692) Create plugin mock for event log plugin (elastic#57048) fix ts error on master (elastic#57236) Don't create API key for disabled alerts when calling create API (elastic#57041) Fix enable and disable API to still work when AAD is out of sync (elastic#56634) [DOCS] Canvas embed objects (elastic#57156) Delete autocomplete namespace (elastic#57187) Security - Inject logout url (elastic#57201) ...
This PR completes the NP migration for the
remote_clustersserver-side code. I will address the client code in a separate PR.Changes include:
legacydirectoryNote: It may be helpful to review the code changes by commit.
How to test
You will need to set up two clusters in order to test remote clusters. For example:
Basiclicense)