From d08ad0c4377d6746b80986bf75936d9d4835db71 Mon Sep 17 00:00:00 2001 From: Maxim Palenov Date: Wed, 18 Oct 2023 18:26:31 +0200 Subject: [PATCH 01/14] [Security Solution] Unskip rules export import serverless cypress tests (#169230) **Addresses:** https://github.com/elastic/kibana/issues/161540 ## Summary This PR unskips import and export security rules Serverless Cypress tests. ## Flaky test runner `import_export` folder [150 runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3588) --- .../rule_actions/import_export/export_rule.cy.ts | 6 ++---- .../rule_actions/import_export/import_rules.cy.ts | 12 +++++++----- .../cypress/tasks/alerts_detection_rules.ts | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts index 262c6904db4bd..275160d1f04a0 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/export_rule.cy.ts @@ -33,7 +33,6 @@ import { cleanKibana, resetRulesTableState, deleteAlertsAndRules, - reload, } from '../../../../../tasks/common'; import { login } from '../../../../../tasks/login'; import { visit } from '../../../../../tasks/navigation'; @@ -56,8 +55,7 @@ const prebuiltRules = Array.from(Array(7)).map((_, i) => { }); }); -// TODO: https://github.com/elastic/kibana/issues/161540 -describe('Export rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Export rules', { tags: ['@ess', '@serverless'] }, () => { const downloadsFolder = Cypress.config('downloadsFolder'); before(() => { @@ -171,7 +169,7 @@ describe('Export rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] const expectedNumberCustomRulesToBeExported = 2; createAndInstallMockedPrebuiltRules(prebuiltRules); - reload(); + cy.reload(); selectAllRules(); bulkExportRules(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts index 6c0bbb0193130..ed8a2ddc28c07 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/detection_response/rule_management/rule_actions/import_export/import_rules.cy.ts @@ -11,15 +11,16 @@ import { importRules, importRulesWithOverwriteAll, } from '../../../../../tasks/alerts_detection_rules'; -import { cleanKibana, deleteAlertsAndRules, reload } from '../../../../../tasks/common'; +import { cleanKibana, deleteAlertsAndRules } from '../../../../../tasks/common'; +import { deleteExceptionList } from '../../../../../tasks/api_calls/exceptions'; import { login } from '../../../../../tasks/login'; import { visit } from '../../../../../tasks/navigation'; import { RULES_MANAGEMENT_URL } from '../../../../../urls/rules_management'; const RULES_TO_IMPORT_FILENAME = 'cypress/fixtures/7_16_rules.ndjson'; +const IMPORTED_EXCEPTION_ID = 'b8dfd17f-1e11-41b0-ae7e-9e7f8237de49'; -// TODO: https://github.com/elastic/kibana/issues/161540 -describe('Import rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +describe('Import rules', { tags: ['@ess', '@serverless'] }, () => { before(() => { cleanKibana(); }); @@ -27,6 +28,7 @@ describe('Import rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] beforeEach(() => { login(); deleteAlertsAndRules(); + deleteExceptionList(IMPORTED_EXCEPTION_ID, 'single'); cy.intercept('POST', '/api/detection_engine/rules/_import*').as('import'); visit(RULES_MANAGEMENT_URL); }); @@ -52,7 +54,7 @@ describe('Import rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] cy.wrap(response?.statusCode).should('eql', 200); }); - reload(); + cy.reload(); importRules(RULES_TO_IMPORT_FILENAME); cy.wait('@import').then(({ response }) => { @@ -68,7 +70,7 @@ describe('Import rules', { tags: ['@ess', '@serverless', '@brokenInServerless'] cy.wrap(response?.statusCode).should('eql', 200); }); - reload(); + cy.reload(); importRulesWithOverwriteAll(RULES_TO_IMPORT_FILENAME); cy.wait('@import').then(({ response }) => { diff --git a/x-pack/test/security_solution_cypress/cypress/tasks/alerts_detection_rules.ts b/x-pack/test/security_solution_cypress/cypress/tasks/alerts_detection_rules.ts index 304e35e6826bf..d5eeef7801d1b 100644 --- a/x-pack/test/security_solution_cypress/cypress/tasks/alerts_detection_rules.ts +++ b/x-pack/test/security_solution_cypress/cypress/tasks/alerts_detection_rules.ts @@ -285,11 +285,11 @@ export const waitForRuleToUpdate = () => { export const importRules = (rulesFile: string) => { cy.get(RULE_IMPORT_MODAL).click(); - cy.get(INPUT_FILE).click({ force: true }); + cy.get(INPUT_FILE).click(); cy.get(INPUT_FILE).selectFile(rulesFile); cy.get(INPUT_FILE).trigger('change'); - cy.get(RULE_IMPORT_MODAL_BUTTON).last().click({ force: true }); - cy.get(INPUT_FILE).should('not.exist'); + cy.get(RULE_IMPORT_MODAL_BUTTON).last().click(); + cy.get(INPUT_FILE, { timeout: 300000 }).should('not.exist'); }; export const expectRulesManagementTab = () => { From 3c58d392c0005c49deabe6e08f8906eccbea94e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Wed, 18 Oct 2023 18:11:53 +0100 Subject: [PATCH 02/14] [Cloud] Endpoint modal - fix label height (#169249) --- .../deployment_details/deployment_details_cloudid_input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cloud/deployment_details/deployment_details_cloudid_input.tsx b/packages/cloud/deployment_details/deployment_details_cloudid_input.tsx index 802e11aa05fcf..aa7b13ef8282a 100644 --- a/packages/cloud/deployment_details/deployment_details_cloudid_input.tsx +++ b/packages/cloud/deployment_details/deployment_details_cloudid_input.tsx @@ -32,7 +32,7 @@ const Label: FC<{ learnMoreUrl: string }> = ({ learnMoreUrl }) => { const [isPopoverOpen, setIsPopoverOpen] = useState(false); return ( - + {i18n.translate('cloud.deploymentDetails.cloudIDLabel', { From 121353cf457efe957662bf18d867ba76ffb4100e Mon Sep 17 00:00:00 2001 From: Cee Chen <549407+cee-chen@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:18:42 -0700 Subject: [PATCH 03/14] [rollup][licensing_management][grokdebugger] Migrate deprecated `EuiPage*` components (#168300) ## Summary EUI will shortly be removing several deprecated `EuiPage*` components, and we're updating a few remaining Kibana usages of these deprecated components ahead of time. See https://github.com/elastic/kibana/issues/161872 for other similar tasks with more information about this effort. --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../components/grok_debugger/grok_debugger.js | 60 +- .../public/components/inactive_license.js | 87 +- .../upload_license.test.tsx.snap | 993 +++++++++--------- .../public/application/app.js | 20 +- .../license_dashboard/license_dashboard.js | 10 +- .../sections/upload_license/upload_license.js | 12 +- .../sections/job_create/job_create.js | 6 +- .../crud_app/sections/job_list/job_list.js | 21 +- 8 files changed, 604 insertions(+), 605 deletions(-) diff --git a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js index 7eb4e9412edaa..cfae6749879f3 100644 --- a/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js +++ b/x-pack/plugins/grokdebugger/public/components/grok_debugger/grok_debugger.js @@ -11,15 +11,7 @@ import { i18n } from '@kbn/i18n'; // eslint-disable-next-line no-restricted-imports import isEmpty from 'lodash/isEmpty'; -import { - EuiForm, - EuiButton, - EuiPage, - EuiPageBody, - EuiPageContent_Deprecated as EuiPageContent, - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiSpacer, -} from '@elastic/eui'; +import { EuiForm, EuiButton, EuiPage, EuiPageBody, EuiPageSection, EuiSpacer } from '@elastic/eui'; import { EventInput } from '../event_input'; import { PatternInput } from '../pattern_input'; import { CustomPatternsInput } from '../custom_patterns_input'; @@ -126,33 +118,31 @@ export class GrokDebuggerComponent extends React.Component { return ( - - - - - - - + + + + + + + + - - - - - - - - - + + + + + ); diff --git a/x-pack/plugins/grokdebugger/public/components/inactive_license.js b/x-pack/plugins/grokdebugger/public/components/inactive_license.js index f373c65bf9bb1..b9abdd6a4706f 100644 --- a/x-pack/plugins/grokdebugger/public/components/inactive_license.js +++ b/x-pack/plugins/grokdebugger/public/components/inactive_license.js @@ -13,8 +13,7 @@ import { EuiCode, EuiPage, EuiPageBody, - EuiPageContent_Deprecated as EuiPageContent, - EuiPageContentBody_Deprecated as EuiPageContentBody, + EuiPageSection, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -43,49 +42,47 @@ export const InactiveLicenseSlate = () => { return ( - - - - -

- - {trialLicense}, {basicLicense},{' '} - {goldLicense} - - ), - platinumLicenseType: {platinumLicense}, - }} - /> -

-

- - {registerLicenseLinkLabel} - - ), - }} - /> -

-
-
-
-
+ + + +

+ + {trialLicense}, {basicLicense},{' '} + {goldLicense} + + ), + platinumLicenseType: {platinumLicense}, + }} + /> +

+

+ + {registerLicenseLinkLabel} + + ), + }} + /> +

+
+
+
); diff --git a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap index 1ce5f5a38b043..8a845149b95e8 100644 --- a/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap +++ b/x-pack/plugins/license_management/__jest__/__snapshots__/upload_license.test.tsx.snap @@ -1,675 +1,690 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`UploadLicense should display a modal when license requires acknowledgement 1`] = ` -
-

- Upload your license -

-
-
-

- Your license key is a JSON file with a signature attached. -

-

- Uploading a license will replace your current - - license. -

-
-
+

+ Upload your license +

+
+
+

+ Your license key is a JSON file with a signature attached. +

+

+ Uploading a license will replace your current + + license. +

+
+
-
-
-
-
-
-
+
+ -
-
+
- - Upload - - + + Upload + + +
-
+ `; exports[`UploadLicense should display an error when ES says license is expired 1`] = ` -
-

- Upload your license -

-
-
-

- Your license key is a JSON file with a signature attached. -

-

- Uploading a license will replace your current - - license. -

-
-
+

+ Upload your license +

+