-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Migrate data folder creation from legacy to KP #75527
Migrate data folder creation from legacy to KP #75527
Conversation
Pinging @elastic/kibana-platform (Team:Platform) |
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.
Alerting code 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.
Stack Monitoring side looks good 👍
@elastic/kibana-telemetry the telemetry schema check fails. probably because of the reintegration of the changes from #75536, as this PR also remove things from the last remaining legacy plugin. Seems like Lines 2 to 10 in 266f853
is no longer extracting anything:
should I just remove the |
@pgayvallet I think we are safe to remove that entry completely 👍 |
src/core/server/server.api.md
Outdated
@@ -752,6 +752,11 @@ export interface EnvironmentMode { | |||
prod: boolean; | |||
} | |||
|
|||
// @public | |||
export interface EnvironmentServiceSetup { | |||
getInstanceUuid(): string; |
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.
as we are here: why it's exposed as a function? the value is static
@@ -42,7 +42,7 @@ export class TaskManagerPlugin | |||
.toPromise(); | |||
|
|||
setupSavedObjects(core.savedObjects, this.config); | |||
this.taskManagerId = core.uuid.getInstanceUuid(); | |||
this.taskManagerId = core.environment.getInstanceUuid(); |
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.
IMO it's confusing that environment
service doesn't create Env
public interface
kibana/src/core/server/core_context.ts
Line 33 in 85c8232
env: Env; |
What if we make this service internal and pass
uuid
as a static value to the plugin constructor kibana/src/core/server/plugins/plugin.ts
Line 171 in fa93a81
const instance = initializer(this.initializerContext); |
I understand that it's not required for the issue you are working on, so we can rollback all the changes to the uuid
service.
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.
@restrry Moved instanceUuid
to PluginInitializerContext
. PTAL
export interface InstanceInfo { | ||
uuid: string; | ||
} |
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.
Added a structure as the pid
will also be added here once we migrate it from the legacy server
public async discover() { | ||
public async discover({ environment }: PluginsServiceDiscoverDeps) { |
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, coreContext
is created synchronously inside the Server
constructor. Injecting the uuid inside it was way too heavy changes, as it would require to wait for the uuid service to setup (which itself requires the core context...). I'm now setuping the environment service before the call to plugins.discover
and pass the setup contract to it to allow to access the uuid (and later, the pid)
env: { | ||
mode: EnvironmentMode; | ||
packageInfo: Readonly<PackageInfo>; | ||
instanceUuid: string; |
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.
instanceUuid
is now accessible via pluginInitializerContext.env.instanceUuid
, and the Environment
service is no longer public.
@pgayvallet LGTM |
💚 Build SucceededBuild metricsoss distributable file count
distributable file count
History
To update your PR or re-run it, just comment with: |
* rename uuid service to environment service * adapt resolve_uuid to directly use the configurations * move data folder creation to core * update generated doc * fix types * fix monitoring tests * move instanceUuid to plugin initializer context * update generated doc
* rename uuid service to environment service * adapt resolve_uuid to directly use the configurations * move data folder creation to core * update generated doc * fix types * fix monitoring tests * move instanceUuid to plugin initializer context * update generated doc
Summary
Fix #73002
uuid
service toenvironment
data
folder creation from the legacy kibana plugin to the renamed serviceChecklist