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": [], 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

    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/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 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', 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), }, }, diff --git a/x-pack/plugins/cloud/public/plugin.test.ts b/x-pack/plugins/cloud/public/plugin.test.ts index 3709dd7cfcb95..99e6f97946cca 100644 --- a/x-pack/plugins/cloud/public/plugin.test.ts +++ b/x-pack/plugins/cloud/public/plugin.test.ts @@ -197,8 +197,10 @@ describe('Cloud Plugin', () => { return { coreSetup, plugin }; }; - it('registers help support URL', async () => { - const { plugin } = startPlugin(); + it('registers help support URL: default', async () => { + const { plugin } = startPlugin({ + id: undefined, + }); const coreStart = coreMock.createStart(); plugin.start(coreStart); @@ -211,6 +213,41 @@ describe('Cloud Plugin', () => { `); }); + it('registers help support URL: serverless projects', async () => { + const { plugin } = startPlugin({ + id: 'my-awesome-project-id', + serverless: { + project_id: 'my-awesome-serverless-project-id', + }, + }); + + const coreStart = coreMock.createStart(); + plugin.start(coreStart); + + expect(coreStart.chrome.setHelpSupportUrl).toHaveBeenCalledTimes(1); + expect(coreStart.chrome.setHelpSupportUrl.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "https://support.elastic.co/?serverless_project_id=my-awesome-serverless-project-id", + ] + `); + }); + + it('registers help support URL: non-serverless projects', async () => { + const { plugin } = startPlugin({ + id: 'my-awesome-project-id', + }); + + const coreStart = coreMock.createStart(); + plugin.start(coreStart); + + expect(coreStart.chrome.setHelpSupportUrl).toHaveBeenCalledTimes(1); + expect(coreStart.chrome.setHelpSupportUrl.mock.calls[0]).toMatchInlineSnapshot(` + Array [ + "https://support.elastic.co/?cloud_deployment_id=my-awesome-project-id", + ] + `); + }); + describe('isServerlessEnabled', () => { it('is `true` when `serverless.projectId` is set', () => { const { plugin } = startPlugin({ diff --git a/x-pack/plugins/cloud/public/plugin.tsx b/x-pack/plugins/cloud/public/plugin.tsx index 3aaaf8f14fe27..f0e7b8f713e80 100644 --- a/x-pack/plugins/cloud/public/plugin.tsx +++ b/x-pack/plugins/cloud/public/plugin.tsx @@ -11,10 +11,11 @@ import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kb import { registerCloudDeploymentMetadataAnalyticsContext } from '../common/register_cloud_deployment_id_analytics_context'; import { getIsCloudEnabled } from '../common/is_cloud_enabled'; import { parseDeploymentIdFromDeploymentUrl } from '../common/parse_deployment_id_from_deployment_url'; -import { ELASTIC_SUPPORT_LINK, CLOUD_SNAPSHOTS_PATH } from '../common/constants'; +import { CLOUD_SNAPSHOTS_PATH } from '../common/constants'; import { decodeCloudId, type DecodedCloudId } from '../common/decode_cloud_id'; import type { CloudSetup, CloudStart } from './types'; import { getFullCloudUrl } from '../common/utils'; +import { getSupportUrl } from './utils'; export interface CloudConfigType { id?: string; @@ -103,7 +104,7 @@ export class CloudPlugin implements Plugin { } public start(coreStart: CoreStart): CloudStart { - coreStart.chrome.setHelpSupportUrl(ELASTIC_SUPPORT_LINK); + coreStart.chrome.setHelpSupportUrl(getSupportUrl(this.config)); // Nest all the registered context providers under the Cloud Services Provider. // This way, plugins only need to require Cloud's context provider to have all the enriched Cloud services. diff --git a/x-pack/plugins/cloud/public/utils.ts b/x-pack/plugins/cloud/public/utils.ts new file mode 100644 index 0000000000000..d2381c428fe0a --- /dev/null +++ b/x-pack/plugins/cloud/public/utils.ts @@ -0,0 +1,21 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ELASTIC_SUPPORT_LINK } from '../common/constants'; +import { CloudConfigType } from './plugin'; + +export function getSupportUrl(config: CloudConfigType): string { + let supportUrl = ELASTIC_SUPPORT_LINK; + if (config.serverless?.project_id) { + // serverless projects use config.id and config.serverless.project_id + supportUrl += '?serverless_project_id=' + config.serverless.project_id; + } else if (config.id) { + // non-serverless Cloud projects only use config.id + supportUrl += '?cloud_deployment_id=' + config.id; + } + return supportUrl; +} 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; } 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();`,