From e5edb7c5979f04653eba59c9ba37c7d3e381d33e Mon Sep 17 00:00:00 2001 From: Elena Shostak Date: Wed, 26 Nov 2025 12:32:36 +0000 Subject: [PATCH 1/6] [FSH] Migrated fs usage to kbn/fs for synthetics project code --- .../synthetics/server/common/unzip_project_code.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts b/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts index 551b738944e2d..8d2af5ecfd446 100644 --- a/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts +++ b/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts @@ -6,7 +6,7 @@ */ import { join } from 'path'; -import { writeFile } from 'fs/promises'; +import { writeFile, deleteFile } from '@kbn/fs'; import os from 'os'; import AdmZip from 'adm-zip'; @@ -20,8 +20,8 @@ export function generateTempPath() { export async function unzipFile(content: string) { const decoded = Buffer.from(content, 'base64'); - const pathToZip = generateTempPath(); - await writeFile(pathToZip, decoded); + const pathAtVolume = `synthetics/${generateUniqueId()}`; + const { path: pathToZip } = await writeFile(pathAtVolume, decoded); const zip = new AdmZip(pathToZip); const zipEntries = zip.getEntries(); @@ -31,5 +31,8 @@ export async function unzipFile(content: string) { const entryData = entry.getData().toString(); allData += entryData; } + + await deleteFile(pathAtVolume); + return allData; } From bbf7e178fcc63c765f5058aac956aa65278587e8 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 26 Nov 2025 12:50:37 +0000 Subject: [PATCH 2/6] Changes from node scripts/lint_ts_projects --fix --- .../solutions/observability/plugins/synthetics/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/solutions/observability/plugins/synthetics/tsconfig.json b/x-pack/solutions/observability/plugins/synthetics/tsconfig.json index 269e4ae277c31..31f712e5ed407 100644 --- a/x-pack/solutions/observability/plugins/synthetics/tsconfig.json +++ b/x-pack/solutions/observability/plugins/synthetics/tsconfig.json @@ -122,7 +122,8 @@ "@kbn/observability-synthetics-test-data", "@kbn/connector-schemas", "@kbn/react-query", - "@kbn/maintenance-windows-plugin" + "@kbn/maintenance-windows-plugin", + "@kbn/fs" ], "exclude": ["target/**/*"] } From badb97f35c40aeab7306d77c2b987e98e2bd641c Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:05:34 +0000 Subject: [PATCH 3/6] Changes from node scripts/regenerate_moon_projects.js --update --- .../shared/response-ops/alerts-table/moon.yml | 2 +- .../platform/plugins/shared/alerting/moon.yml | 2 + .../shared/maintenance_windows/moon.yml | 65 +++++++++++++++++++ .../shared/triggers_actions_ui/moon.yml | 1 + .../plugins/observability/moon.yml | 1 + .../observability/plugins/synthetics/moon.yml | 2 + 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 x-pack/platform/plugins/shared/maintenance_windows/moon.yml diff --git a/src/platform/packages/shared/response-ops/alerts-table/moon.yml b/src/platform/packages/shared/response-ops/alerts-table/moon.yml index 74627a33618b7..991d602751648 100644 --- a/src/platform/packages/shared/response-ops/alerts-table/moon.yml +++ b/src/platform/packages/shared/response-ops/alerts-table/moon.yml @@ -24,7 +24,6 @@ dependsOn: - '@kbn/alerting-types' - '@kbn/cases-components' - '@kbn/core-http-browser' - - '@kbn/alerting-plugin' - '@kbn/actions-plugin' - '@kbn/kibana-utils-plugin' - '@kbn/alerts-ui-shared' @@ -49,6 +48,7 @@ dependsOn: - '@kbn/zod' - '@kbn/field-types' - '@kbn/react-query' + - '@kbn/maintenance-windows-plugin' tags: - shared-browser - package diff --git a/x-pack/platform/plugins/shared/alerting/moon.yml b/x-pack/platform/plugins/shared/alerting/moon.yml index 80873025a94c9..155d43af11479 100644 --- a/x-pack/platform/plugins/shared/alerting/moon.yml +++ b/x-pack/platform/plugins/shared/alerting/moon.yml @@ -89,6 +89,8 @@ dependsOn: - '@kbn/es-types' - '@kbn/lazy-object' - '@kbn/react-query' + - '@kbn/maintenance-windows-plugin' + - '@kbn/config' tags: - plugin - prod diff --git a/x-pack/platform/plugins/shared/maintenance_windows/moon.yml b/x-pack/platform/plugins/shared/maintenance_windows/moon.yml new file mode 100644 index 0000000000000..1a2bce18e61da --- /dev/null +++ b/x-pack/platform/plugins/shared/maintenance_windows/moon.yml @@ -0,0 +1,65 @@ +# This file is generated by the @kbn/moon package. Any manual edits will be erased! +# To extend this, write your extensions/overrides to 'moon.extend.yml' +# then regenerate this file with: 'node scripts/regenerate_moon_projects.js --update --filter @kbn/maintenance-windows-plugin' + +$schema: https://moonrepo.dev/schemas/project.json +id: '@kbn/maintenance-windows-plugin' +type: unknown +owners: + defaultOwner: '@elastic/response-ops' +toolchain: + default: node +language: typescript +project: + name: '@kbn/maintenance-windows-plugin' + description: Moon project for @kbn/maintenance-windows-plugin + channel: '' + owner: '@elastic/response-ops' + metadata: + sourceRoot: x-pack/platform/plugins/shared/maintenance_windows +dependsOn: + - '@kbn/core' + - '@kbn/security-plugin' + - '@kbn/licensing-plugin' + - '@kbn/i18n' + - '@kbn/core-saved-objects-server' + - '@kbn/data-plugin' + - '@kbn/alerting-types' + - '@kbn/rrule' + - '@kbn/es-query' + - '@kbn/licensing-types' + - '@kbn/config-schema' + - '@kbn/utility-types' + - '@kbn/core-ui-settings-server-mocks' + - '@kbn/std' + - '@kbn/core-http-router-server-mocks' + - '@kbn/features-plugin' + - '@kbn/lazy-object' + - '@kbn/datemath' + - '@kbn/task-manager-plugin' + - '@kbn/core-http-request-handler-context-server' +tags: + - plugin + - prod + - group-platform + - shared + - jest-unit-tests +fileGroups: + src: + - server/**/* + - public/**/* + - common/**/* + - '!target/**/*' +tasks: + jest: + args: + - '--config' + - $projectRoot/jest.config.js + inputs: + - '@group(src)' + jestCI: + args: + - '--config' + - $projectRoot/jest.config.js + inputs: + - '@group(src)' diff --git a/x-pack/platform/plugins/shared/triggers_actions_ui/moon.yml b/x-pack/platform/plugins/shared/triggers_actions_ui/moon.yml index c7cfb8432f94c..97aeae38f22aa 100644 --- a/x-pack/platform/plugins/shared/triggers_actions_ui/moon.yml +++ b/x-pack/platform/plugins/shared/triggers_actions_ui/moon.yml @@ -97,6 +97,7 @@ dependsOn: - '@kbn/presentation-util' - '@kbn/discover-utils' - '@kbn/react-query' + - '@kbn/maintenance-windows-plugin' tags: - plugin - prod diff --git a/x-pack/solutions/observability/plugins/observability/moon.yml b/x-pack/solutions/observability/plugins/observability/moon.yml index 40c5caa911372..18db03d0f0bc8 100644 --- a/x-pack/solutions/observability/plugins/observability/moon.yml +++ b/x-pack/solutions/observability/plugins/observability/moon.yml @@ -144,6 +144,7 @@ dependsOn: - '@kbn/observability-nav-icons' - '@kbn/react-query' - '@kbn/content-management-utils' + - '@kbn/maintenance-windows-plugin' tags: - plugin - prod diff --git a/x-pack/solutions/observability/plugins/synthetics/moon.yml b/x-pack/solutions/observability/plugins/synthetics/moon.yml index 48c6d6f254470..9f7053af9c01d 100644 --- a/x-pack/solutions/observability/plugins/synthetics/moon.yml +++ b/x-pack/solutions/observability/plugins/synthetics/moon.yml @@ -128,6 +128,8 @@ dependsOn: - '@kbn/observability-synthetics-test-data' - '@kbn/connector-schemas' - '@kbn/react-query' + - '@kbn/maintenance-windows-plugin' + - '@kbn/fs' tags: - plugin - prod From 5d541168c0ccd71b196e03ce558bde6860b1c30f Mon Sep 17 00:00:00 2001 From: Elena Shostak Date: Thu, 27 Nov 2025 12:50:13 +0000 Subject: [PATCH 4/6] Fixes --- .../plugins/synthetics/server/common/unzip_project_code.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts b/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts index 8d2af5ecfd446..3f33e93ab9406 100644 --- a/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts +++ b/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts @@ -6,7 +6,6 @@ */ import { join } from 'path'; -import { writeFile, deleteFile } from '@kbn/fs'; import os from 'os'; import AdmZip from 'adm-zip'; @@ -20,9 +19,7 @@ export function generateTempPath() { export async function unzipFile(content: string) { const decoded = Buffer.from(content, 'base64'); - const pathAtVolume = `synthetics/${generateUniqueId()}`; - const { path: pathToZip } = await writeFile(pathAtVolume, decoded); - const zip = new AdmZip(pathToZip); + const zip = new AdmZip(decoded); const zipEntries = zip.getEntries(); let allData = ''; @@ -32,7 +29,5 @@ export async function unzipFile(content: string) { allData += entryData; } - await deleteFile(pathAtVolume); - return allData; } From d8fdc415cd1f424d7eb2293b961d4f8cf2aae3a7 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:00:33 +0000 Subject: [PATCH 5/6] Changes from node scripts/lint_ts_projects --fix --- x-pack/solutions/observability/plugins/synthetics/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/solutions/observability/plugins/synthetics/tsconfig.json b/x-pack/solutions/observability/plugins/synthetics/tsconfig.json index 31f712e5ed407..40ddb97dff149 100644 --- a/x-pack/solutions/observability/plugins/synthetics/tsconfig.json +++ b/x-pack/solutions/observability/plugins/synthetics/tsconfig.json @@ -123,7 +123,6 @@ "@kbn/connector-schemas", "@kbn/react-query", "@kbn/maintenance-windows-plugin", - "@kbn/fs" ], "exclude": ["target/**/*"] } From f256468eeb912679b049624b5d8bf7c48779fa8d Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:15:49 +0000 Subject: [PATCH 6/6] Changes from node scripts/regenerate_moon_projects.js --update --- x-pack/solutions/observability/plugins/synthetics/moon.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/solutions/observability/plugins/synthetics/moon.yml b/x-pack/solutions/observability/plugins/synthetics/moon.yml index 9f7053af9c01d..b8ad9a6440dd0 100644 --- a/x-pack/solutions/observability/plugins/synthetics/moon.yml +++ b/x-pack/solutions/observability/plugins/synthetics/moon.yml @@ -129,7 +129,6 @@ dependsOn: - '@kbn/connector-schemas' - '@kbn/react-query' - '@kbn/maintenance-windows-plugin' - - '@kbn/fs' tags: - plugin - prod