Skip to content

Commit

Permalink
Merge branch 'main' into fix-rbac-hosts-view
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 20, 2024
2 parents aa12aa5 + 8ba6839 commit 3fa96de
Show file tree
Hide file tree
Showing 14 changed files with 225 additions and 281 deletions.
28 changes: 20 additions & 8 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -1204,9 +1204,11 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql
### Observability Plugins

# Observability AI Assistant
x-pack/test/observability_ai_assistant_api_integration @elastic/obs-ai-assistant
x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant
x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai-assistant
/x-pack/test_serverless/api_integration/test_suites/common/data_usage @elastic/obs-ai-assistant
/x-pack/test_serverless/functional/test_suites/common/data_usage @elastic/obs-ai-assistant @elastic/kibana-security
/x-pack/test/observability_ai_assistant_api_integration @elastic/obs-ai-assistant
/x-pack/test/observability_ai_assistant_functional @elastic/obs-ai-assistant
/x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai-assistant

# Infra Obs
## This plugin mostly contains the codebase for the infra services, but also includes some code for the Logs UI app.
Expand All @@ -1219,9 +1221,12 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai

## infra/{common,docs,public,server}/{sub-folders}/ -> @elastic/obs-ux-infra_services-team
# obs-ux-infra_services-team
/x-pack/test/api_integration/deployment_agnostic/apis/observability/apm/ @elastic/obs-ux-infra_services-team
/x-pack/test/api_integration/deployment_agnostic/apis/observability/infra/ @elastic/obs-ux-infra_services-team
/x-pack/test/functional/page_objects/asset_details.ts @elastic/obs-ux-infra_services-team # Assigned per https://github.com/elastic/kibana/pull/200157/files/c83fae62151fe634342c498aca69b686b739fe45#r1842202022
/x-pack/test/functional/page_objects/infra_* @elastic/obs-ux-infra_services-team
/x-pack/test/functional/es_archives/infra @elastic/obs-ux-infra_services-team
/x-pack/test_serverless/**/test_suites/observability/infra/ @elastic/obs-ux-infra_services-team
/test/common/plugins/otel_metrics @elastic/obs-ux-infra_services-team
/x-pack/plugins/observability_solution/infra/common @elastic/obs-ux-infra_services-team
/x-pack/plugins/observability_solution/infra/docs @elastic/obs-ux-infra_services-team
Expand All @@ -1246,6 +1251,7 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai
/x-pack/test/api_integration/services/infraops_source_configuration.ts @elastic/obs-ux-infra_services-team @elastic/obs-ux-logs-team # Assigned per https://github.com/elastic/kibana/pull/34916

## Logs UI code exceptions -> @elastic/obs-ux-logs-team
/x-pack/test/api_integration/deployment_agnostic/apis/observability/data_quality/ @elastic/obs-ux-logs-team
/x-pack/test/upgrade/apps/logs @elastic/obs-ux-logs-team
/x-pack/test_serverless/functional/page_objects/svl_oblt_onboarding_stream_log_file.ts @elastic/obs-ux-logs-team
/x-pack/test_serverless/functional/page_objects/svl_oblt_onboarding_page.ts @elastic/obs-ux-logs-team
Expand Down Expand Up @@ -1292,10 +1298,10 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai
/x-pack/test_serverless/**/test_suites/observability/custom_threshold_rule/ @elastic/obs-ux-management-team
/x-pack/test_serverless/**/test_suites/observability/slos/ @elastic/obs-ux-management-team
/x-pack/test_serverless/api_integration/test_suites/observability/es_query_rule @elastic/obs-ux-management-team
/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/burn_rate_rule @elastic/obs-ux-management-team
/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/ @elastic/obs-ux-management-team
/x-pack/test/api_integration/deployment_agnostic/apis/observability/slo/ @elastic/obs-ux-management-team
/x-pack/test/api_integration/deployment_agnostic/services/alerting_api @elastic/obs-ux-management-team
/x-pack/test/api_integration/deployment_agnostic/services/slo_api @elastic/obs-ux-management-team
/x-pack/test_serverless/**/test_suites/observability/infra/ @elastic/obs-ux-infra_services-team

# Elastic Stack Monitoring
/x-pack/test/monitoring_api_integration @elastic/stack-monitoring
Expand Down Expand Up @@ -1614,9 +1620,10 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai
/x-pack/test_serverless/functional/test_suites/common/home_page/ @elastic/appex-qa
/x-pack/test_serverless/**/services/ @elastic/appex-qa
/packages/kbn-es/src/stateful_resources/roles.yml @elastic/appex-qa
x-pack/test/api_integration/deployment_agnostic/default_configs/ @elastic/appex-qa
x-pack/test/api_integration/deployment_agnostic/services/ @elastic/appex-qa
x-pack/test/**/deployment_agnostic/ @elastic/appex-qa #temporarily to monitor tests migration
/x-pack/test/api_integration/deployment_agnostic/ftr_provider_context.d.ts @elastic/appex-qa
/x-pack/test/api_integration/deployment_agnostic/README.md @elastic/appex-qa
/x-pack/test/api_integration/deployment_agnostic/*configs/ @elastic/appex-qa
/x-pack/test/api_integration/deployment_agnostic/services/ @elastic/appex-qa

# Core
/test/api_integration/apis/general/*.js @elastic/kibana-core # Assigned per https://github.com/elastic/kibana/pull/199795/files/894a8ede3f9d0398c5af56bf5a82654a9bc0610b#r1846691639
Expand Down Expand Up @@ -1689,6 +1696,8 @@ x-pack/test/**/deployment_agnostic/ @elastic/appex-qa #temporarily to monitor te
/x-pack/test/api_integration/apis/status @elastic/kibana-core
/x-pack/test/api_integration/apis/stats @elastic/kibana-core
/x-pack/test/api_integration/apis/kibana/stats @elastic/kibana-core
/x-pack/test/api_integration/deployment_agnostic/apis/core/ @elastic/kibana-core
/x-pack/test/api_integration/deployment_agnostic/apis/saved_objects_management/ @elastic/kibana-core
/x-pack/test_serverless/functional/test_suites/security/config.saved_objects_management.ts @elastic/kibana-core
/config/ @elastic/kibana-core
/config/serverless.yml @elastic/kibana-core @elastic/kibana-security
Expand Down Expand Up @@ -1915,6 +1924,7 @@ x-pack/test/api_integration/apis/management/index_management/inference_endpoints
/test/functional/apps/saved_objects_management @elastic/kibana-management
/test/functional/apps/console/*.ts @elastic/kibana-management
/test/api_integration/apis/console/*.ts @elastic/kibana-management
/x-pack/test/api_integration/deployment_agnostic/apis/console/ @elastic/kibana-management
/test/accessibility/apps/management.ts @elastic/kibana-management
/test/accessibility/apps/console.ts @elastic/kibana-management
/x-pack/test/api_integration/services/index_management.ts @elastic/kibana-management
Expand All @@ -1941,6 +1951,8 @@ x-pack/test/api_integration/apis/management/index_management/inference_endpoints
/x-pack/test_serverless/functional/test_suites/common/dev_tools/ @elastic/kibana-management
/x-pack/test_serverless/**/test_suites/common/grok_debugger/ @elastic/kibana-management
/x-pack/test/api_integration/apis/management/ @elastic/kibana-management
/x-pack/test/api_integration/deployment_agnostic/apis/management/ @elastic/kibana-management
/x-pack/test/api_integration/deployment_agnostic/apis/painless_lab/ @elastic/kibana-management
/x-pack/test/functional/apps/rollup_job/ @elastic/kibana-management
/x-pack/test/api_integration/apis/grok_debugger @elastic/kibana-management
/x-pack/test/accessibility/apps/group1/advanced_settings.ts @elastic/kibana-management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { RuleActionParams } from '@kbn/alerting-types';
import { isEmpty, omit } from 'lodash';
import { isEmpty, omit, isEqual } from 'lodash';
import { RuleFormActionsErrors, RuleFormParamsErrors, RuleUiAction } from '../../common';
import { RuleFormData, RuleFormState } from '../types';
import { validateRuleBase, validateRuleParams } from '../validation';
Expand Down Expand Up @@ -119,6 +119,7 @@ const getUpdateWithValidation =
selectedRuleTypeModel,
multiConsumerSelection,
selectedRuleType,
formData: originalFormData,
} = ruleFormState;

const formData = updater();
Expand Down Expand Up @@ -149,12 +150,14 @@ const getUpdateWithValidation =
}
}

const touched = !isEqual(originalFormData, formData);

return {
...ruleFormState,
formData,
baseErrors,
paramsErrors,
touched: true,
touched,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,62 @@ describe('rulePage', () => {
fireEvent.click(screen.getByTestId('rulePageReturnButton'));
expect(onCancel).toHaveBeenCalled();
});

test('should display discard changes modal only if changes are made in the form', () => {
useRuleFormState.mockReturnValue({
plugins: {
application: {
navigateToUrl,
capabilities: {
actions: {
show: true,
save: true,
execute: true,
},
},
},
},
baseErrors: {},
paramsErrors: {},
touched: true,
formData: formDataMock,
connectors: [],
connectorTypes: [],
aadTemplateFields: [],
});

render(<RulePage onCancel={onCancel} onSave={onSave} />);

fireEvent.click(screen.getByTestId('rulePageFooterCancelButton'));
expect(screen.getByTestId('ruleFormCancelModal')).toBeInTheDocument();
});

test('should not display discard changes modal id no changes are made in the form', () => {
useRuleFormState.mockReturnValue({
plugins: {
application: {
navigateToUrl,
capabilities: {
actions: {
show: true,
save: true,
execute: true,
},
},
},
},
baseErrors: {},
paramsErrors: {},
touched: false,
formData: formDataMock,
connectors: [],
connectorTypes: [],
aadTemplateFields: [],
});

render(<RulePage onCancel={onCancel} onSave={onSave} />);

fireEvent.click(screen.getByTestId('rulePageFooterCancelButton'));
expect(screen.queryByTestId('ruleFormCancelModal')).not.toBeInTheDocument();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export const RulePage = (props: RulePageProps) => {
<EuiConfirmModal
onCancel={() => setIsCancelModalOpen(false)}
onConfirm={onCancel}
data-test-subj="ruleFormCancelModal"
buttonColor="danger"
defaultFocusedButton="confirm"
title={RULE_FORM_CANCEL_MODAL_TITLE}
Expand Down
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,14 @@
],
"minimumReleaseAge": "7 days",
"enabled": true
},
{
"groupName": "@elastic/request-converter",
"matchDepNames": ["@elastic/request-converter"],
"reviewers": ["team:kibana-management"],
"matchBaseBranches": ["main"],
"labels": ["release_note:skip", "backport:skip", "Team:Kibana Management", "Feature:Console"],
"enabled": true
}
],
"customManagers": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@

import kbnRison from '@kbn/rison';
import expect from '@kbn/expect';
import type { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services';
import type { FtrProviderContext } from '../../ftr_provider_context';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const { common, discover, header, unifiedFieldList, dashboard } = getPageObjects([
const { common, discover, header, unifiedFieldList, dashboard, context } = getPageObjects([
'common',
'discover',
'header',
'unifiedFieldList',
'dashboard',
'context',
]);
const testSubjects = getService('testSubjects');
const dataViews = getService('dataViews');
Expand All @@ -41,17 +43,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await common.navigateToActualUrl('discover', `?_a=${state}`, {
ensureCurrentUrl: false,
});
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await unifiedFieldList.clickFieldListItemAdd('message');
let messageCell = await dataGrid.getCellElementExcludingControlColumns(0, 2);
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
let messageCell: WebElementWrapper;
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(0, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
});
let message = await testSubjects.find('exampleRootProfileCurrentMessage');
expect(await message.getVisibleText()).to.be('This is a debug log');
messageCell = await dataGrid.getCellElementExcludingControlColumns(1, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(1, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
message = await testSubjects.find('exampleRootProfileCurrentMessage');
Expand All @@ -69,15 +75,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await header.waitUntilLoadingHasFinished();
await dashboard.waitForRenderComplete();

messageCell = await dataGrid.getCellElementExcludingControlColumns(0, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(0, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
});
message = await testSubjects.find('exampleRootProfileCurrentMessage');
expect(await message.getVisibleText()).to.be('This is a debug log');
messageCell = await dataGrid.getCellElementExcludingControlColumns(1, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(1, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
message = await testSubjects.find('exampleRootProfileCurrentMessage');
Expand All @@ -93,18 +99,22 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await common.navigateToActualUrl('discover', undefined, {
ensureCurrentUrl: false,
});
await dataViews.switchTo('my-example-logs');
await dataViews.switchToAndValidate('my-example-logs');
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
await unifiedFieldList.clickFieldListItemAdd('message');
let messageCell = await dataGrid.getCellElementExcludingControlColumns(0, 2);
await header.waitUntilLoadingHasFinished();
await discover.waitUntilSearchingHasFinished();
let messageCell: WebElementWrapper;
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(0, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
});
let message = await testSubjects.find('exampleRootProfileCurrentMessage');
expect(await message.getVisibleText()).to.be('This is a debug log');
messageCell = await dataGrid.getCellElementExcludingControlColumns(1, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(1, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
message = await testSubjects.find('exampleRootProfileCurrentMessage');
Expand All @@ -120,16 +130,17 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await header.waitUntilLoadingHasFinished();
await browser.refresh();
await header.waitUntilLoadingHasFinished();
await context.waitUntilContextLoadingHasFinished();

messageCell = await dataGrid.getCellElementExcludingControlColumns(0, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(0, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
});
message = await testSubjects.find('exampleRootProfileCurrentMessage');
expect(await message.getVisibleText()).to.be('This is a debug log');
messageCell = await dataGrid.getCellElementExcludingControlColumns(1, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(1, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
message = await testSubjects.find('exampleRootProfileCurrentMessage');
Expand All @@ -149,15 +160,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await header.waitUntilLoadingHasFinished();
await dashboard.waitForRenderComplete();

messageCell = await dataGrid.getCellElementExcludingControlColumns(0, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(0, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
});
message = await testSubjects.find('exampleRootProfileCurrentMessage');
expect(await message.getVisibleText()).to.be('This is a debug log');
messageCell = await dataGrid.getCellElementExcludingControlColumns(1, 2);
await retry.try(async () => {
messageCell = await dataGrid.getCellElementByColumnName(1, 'message');
await (await messageCell.findByTestSubject('exampleDataSourceProfileMessage')).click();
await testSubjects.existOrFail('exampleRootProfileFlyout');
message = await testSubjects.find('exampleRootProfileCurrentMessage');
Expand Down
6 changes: 6 additions & 0 deletions test/functional/services/data_grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ export class DataGridService extends FtrService {
);
}

public async getCellElementByColumnName(rowIndex: number, columnName: string) {
return await this.find.byCssSelector(
`[data-test-subj="euiDataGridBody"] [data-test-subj="dataGridRowCell"][data-gridcell-column-id="${columnName}"][data-gridcell-visible-row-index="${rowIndex}"]`
);
}

private async getCellActionButton(
rowIndex: number = 0,
columnIndex: number = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,21 @@ export const mapProcessorTypeToDescriptor: MapProcessorTypeToDescriptor = {
},
}),
},
terminate: {
category: processorCategories.PIPELINE_HANDLING,
docLinkPath: '/terminate-processor.html',
label: i18n.translate('xpack.ingestPipelines.processors.label.terminate', {
defaultMessage: 'Terminate',
}),
typeDescription: i18n.translate('xpack.ingestPipelines.processors.description.terminate', {
defaultMessage:
'Terminates the current ingest pipeline, causing no further processors to be run.',
}),
getDefaultDescription: () =>
i18n.translate('xpack.ingestPipelines.processors.defaultDescription.terminate', {
defaultMessage: 'Terminates the current pipeline',
}),
},
trim: {
category: processorCategories.DATA_TRANSFORMATION,
FieldsComponent: Trim,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export const createThreatSignals = async ({
await services.scopedClusterClient.asCurrentUser.openPointInTime({
index: threatIndex,
keep_alive: THREAT_PIT_KEEP_ALIVE,
// @ts-expect-error client support this option, but it is not documented and typed yet, but we need this fix in 8.16.2.
// once support added we should remove this expected type error
// https://github.com/elastic/elasticsearch-specification/issues/3144
allow_partial_search_results: true,
})
).id;
const reassignThreatPitId = (newPitId: OpenPointInTimeResponse['id'] | undefined) => {
Expand Down
Loading

0 comments on commit 3fa96de

Please sign in to comment.