From 10f422836be9690201cdea2fbccfc94adb4cd6a4 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Tue, 21 Nov 2023 22:42:00 +0100 Subject: [PATCH 1/6] [SecuritySolution] Fix timeline saving / prevent epic from crashing (#171674) ## Summary Fixes https://github.com/elastic/kibana/issues/168194 Under some circumstance, when navigating to the timelines page, we would get a runtime exception for `state.tableById[action.id]` not being defined. When that happened, the redux store would be in a broken state. This PR makes the responsible destructuring assignment more save. --- .../security-solution/data_table/store/data_table/reducer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/packages/security-solution/data_table/store/data_table/reducer.ts b/x-pack/packages/security-solution/data_table/store/data_table/reducer.ts index f65292a2919e4..1ad08a9332503 100644 --- a/x-pack/packages/security-solution/data_table/store/data_table/reducer.ts +++ b/x-pack/packages/security-solution/data_table/store/data_table/reducer.ts @@ -95,7 +95,7 @@ export const dataTableReducer = reducerWithInitialState(initialDataTableState) [action.id]: { ...state.tableById[action.id], expandedDetail: { - ...state.tableById[action.id].expandedDetail, + ...state.tableById[action.id]?.expandedDetail, ...updateTableDetailsPanel(action), }, }, From d392473d9020f027a55fc98326b1e8ea1e0374be Mon Sep 17 00:00:00 2001 From: Brad White Date: Tue, 21 Nov 2023 14:43:15 -0700 Subject: [PATCH 2/6] [chore] Restrict Storybook version for Renovate (#171453) Renovate bot keeps updating Storybook in #169655 to 7.x which has [significant breaking changes](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-65x-to-700), CI failures, and requires Webpack 5. This upgrade will require a human due to how our SB is setup. [Renovate Docs](https://docs.renovatebot.com/configuration-options/#allowedversions) --- renovate.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/renovate.json b/renovate.json index e4c1e0672c782..63ca5d0ba8a97 100644 --- a/renovate.json +++ b/renovate.json @@ -462,7 +462,8 @@ "Team:Operations", "release_note:skip" ], - "enabled": true + "enabled": true, + "allowedVersions": "<7.0" }, { "groupName": "react-query", @@ -647,4 +648,4 @@ "enabled": true } ] -} +} \ No newline at end of file From 043f0501874108eeb133d59ecded2d1e7a871bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Kopyci=C5=84ski?= Date: Tue, 21 Nov 2023 21:50:37 +0000 Subject: [PATCH 3/6] [security_solution] Fix junit_transformer (#171669) ## Summary Currently, Cypress is writing junit XML files that we are trying to map to the expected CI format, but if the job fails the broken files are still being uploaded and passed to the Flaky Test Reporter which causes it to fail. So the solution is to just delete the broken files before they are sent to the Flaky Tests Reporter Co-authored-by: Tiago Costa --- .../scripts/junit_transformer/lib.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/scripts/junit_transformer/lib.ts b/x-pack/plugins/security_solution/scripts/junit_transformer/lib.ts index d9033c75d485b..725baa689cd20 100644 --- a/x-pack/plugins/security_solution/scripts/junit_transformer/lib.ts +++ b/x-pack/plugins/security_solution/scripts/junit_transformer/lib.ts @@ -16,6 +16,7 @@ import * as t from 'io-ts'; import { isLeft } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; import globby from 'globby'; +import del from 'del'; /** * Updates the `name` and `classname` attributes of each testcase. @@ -195,6 +196,9 @@ ${boilerplate} if ('error' in maybeValidationResult) { logError(maybeValidationResult.error); + // Sending broken XML to Failed Test Reporter will cause a job to fail + await del(path); + log.warning(`${path} file was deleted.`); // If there is an error, continue trying to process other files. continue; } @@ -203,9 +207,11 @@ ${boilerplate} const { processed, hadTestCases } = isReportAlreadyProcessed(reportJson); if (hadTestCases === false) { - log.warning(`${path} had no test cases. Skipping it. + log.warning(`${path} had no test cases. ${boilerplate} `); + await del(path); + log.warning(`${path} file was deleted.`); // If there is an error, continue trying to process other files. continue; } @@ -222,6 +228,9 @@ ${boilerplate} if ('error' in maybeSpecFilePath) { logError(maybeSpecFilePath.error); + // Sending broken XML to Failed Test Reporter will cause a job to fail + await del(path); + log.warning(`${path} file was deleted.`); // If there is an error, continue trying to process other files. continue; } From 1919c87b90c4f489c2027d71293631d89034f40f Mon Sep 17 00:00:00 2001 From: Brad White Date: Tue, 21 Nov 2023 14:59:39 -0700 Subject: [PATCH 4/6] Remove CI Composite Storybook (#171258) ## Summary Closes #160803 This PR removes the `CI Composite` story because it has been broken since at least ac23dce29f07f0539eb8d3f0968ac36441729207 (and possibly since b862a6c1810f5f4c14f8f657411f781b152dec0d). The functionality is covered by the generated `index.html` in https://github.com/elastic/kibana/blob/dda4498fee84708143ce4671af880db785f9e652/.buildkite/scripts/steps/storybooks/build_and_upload.ts#L105-L120 To fix the composite story requires generating `stories.json` for every storybook, which requires migrating the repo off the deprecated `storiesOf` API. That task is quite extensive and would be better handled alongside an upgrade to Storybook 7.x --- .../steps/storybooks/build_and_upload.ts | 7 +--- .ci/.storybook/main.js | 34 ------------------- src/dev/storybook/aliases.ts | 1 - 3 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 .ci/.storybook/main.js diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.ts b/.buildkite/scripts/steps/storybooks/build_and_upload.ts index 83f1ecb2a759d..19fed0e78885f 100644 --- a/.buildkite/scripts/steps/storybooks/build_and_upload.ts +++ b/.buildkite/scripts/steps/storybooks/build_and_upload.ts @@ -16,7 +16,6 @@ const STORYBOOKS = [ 'canvas', 'cases', 'cell_actions', - 'ci_composite', 'cloud_chat', 'coloring', 'chart_icons', @@ -93,14 +92,12 @@ const upload = () => { console.log('--- Generating Storybooks HTML'); process.chdir(path.join('.', 'built_assets', 'storybook')); - fs.renameSync('ci_composite', 'composite'); const storybooks = execSync(`ls -1d */`) .toString() .trim() .split('\n') - .map((filePath) => filePath.replace('/', '')) - .filter((filePath) => filePath !== 'composite'); + .map((filePath) => filePath.replace('/', '')); const listHtml = storybooks .map((storybook) => `
  • ${storybook}
  • `) @@ -110,8 +107,6 @@ const upload = () => {

    Storybooks

    -

    Composite Storybook

    -

    All

      ${listHtml}
    diff --git a/.ci/.storybook/main.js b/.ci/.storybook/main.js deleted file mode 100644 index c4e017179021a..0000000000000 --- a/.ci/.storybook/main.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -const config = require('@kbn/storybook').defaultConfig; -const aliases = require('../../src/dev/storybook/aliases').storybookAliases; - -config.refs = {}; - -// Required due to https://github.com/storybookjs/storybook/issues/13834 -config.babel = async (options) => ({ - ...options, - plugins: ['@babel/plugin-transform-typescript', ...options.plugins], -}); - -for (const alias of Object.keys(aliases).filter((a) => a !== 'ci_composite')) { - // snake_case -> Title Case - const title = alias - .replace(/_/g, ' ') - .split(' ') - .map((n) => n[0].toUpperCase() + n.slice(1)) - .join(' '); - - config.refs[alias] = { - title: title, - url: `${process.env.STORYBOOK_BASE_URL}/${alias}`, - }; -} - -module.exports = config; diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index 98470ccf13658..88d8c04b42337 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -15,7 +15,6 @@ export const storybookAliases = { canvas: 'x-pack/plugins/canvas/storybook', cases: 'packages/kbn-cases-components/.storybook', cell_actions: 'packages/kbn-cell-actions/.storybook', - ci_composite: '.ci/.storybook', cloud_chat: 'x-pack/plugins/cloud_integrations/cloud_chat/.storybook', coloring: 'packages/kbn-coloring/.storybook', language_documentation_popover: 'packages/kbn-language-documentation-popover/.storybook', From 07df5966b297a64dfcbc8ce1f3fb84b7e7c6fbaf Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 21 Nov 2023 16:13:27 -0600 Subject: [PATCH 5/6] Revert "Revert "re-enable kme pipeline for testing (#171451)"" (#171694) I pushed this revert up initially via e79ca5e9d6ab179819634cf654fc2c4b0ed0413c while debugging an issue with CI waiting for agents. This was not the root cause and can be unreverted. --- .buildkite/pull_requests.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/pull_requests.json b/.buildkite/pull_requests.json index 41de2dc843d4d..65a3ff6ba2004 100644 --- a/.buildkite/pull_requests.json +++ b/.buildkite/pull_requests.json @@ -55,14 +55,14 @@ "repoName": "kibana", "pipelineSlug": "kibana-kme-test", - "enabled": false, + "enabled": true, "allow_org_users": true, "allowed_repo_permissions": ["admin", "write"], "allowed_list": ["barlowm", "renovate[bot]"], "set_commit_status": true, - "commit_status_context": "kibana-ci", + "commit_status_context": "kibana-ci-test", "build_on_commit": true, - "build_on_comment": true, + "build_on_comment": false, "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))", "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))", "skip_ci_labels": [], From 5cbc93c53392e61d49aea20277b5f7c4dddd11cf Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Tue, 21 Nov 2023 23:17:08 +0100 Subject: [PATCH 6/6] [Serverless Search] Getting Started - Fix .NET code snippet (#171388) Fixes the "Getting Started" code snippet for the .NET serverless client. --- .../public/application/components/languages/dotnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/serverless_search/public/application/components/languages/dotnet.ts b/x-pack/plugins/serverless_search/public/application/components/languages/dotnet.ts index 59b7e9e5721c7..4f388d2227203 100644 --- a/x-pack/plugins/serverless_search/public/application/components/languages/dotnet.ts +++ b/x-pack/plugins/serverless_search/public/application/components/languages/dotnet.ts @@ -23,7 +23,7 @@ export const dotnetDefinition: LanguageDefinition = { installClient: 'dotnet add package Elastic.Clients.Elasticsearch.Serverless', configureClient: ({ apiKey, cloudId }) => `using System; using Elastic.Clients.Elasticsearch.Serverless; -using Elastic.Clients.Elasticsearch.QueryDsl; +using Elastic.Clients.Elasticsearch.Serverless.QueryDsl; var client = new ElasticsearchClient("${cloudId}", new ApiKey("${apiKey}"));`, testConnection: `var info = await client.InfoAsync();`,