Address some of the no_group_crossing dependencies (#198261)

### Summary

This PR relocates some plugins and packages that are incorrectly
categorised, aiming at reducing inter-solution dependencies. It also
fixes some incorrect import statements that introduce unnecessary
dependencies with other components.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
This commit is contained in:
Gerard Soldevila 2024-11-06 15:44:35 +01:00 committed by GitHub
parent 56b0ac2eda
commit 730f4c9d2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 124 additions and 176 deletions

View file

@ -1992,43 +1992,23 @@ module.exports = {
},
{
files: [
'packages/kbn-reporting/common/**', // TODO @elastic/appex-sharedux - A package depending on a plugin: @kbn/screenshotting-plugin, can we move theser interfaces to a platform/shared package?
'packages/kbn-reporting/export_types/pdf_common/**', // TODO @elastic/appex-sharedux - A package depending on a plugin: @kbn/screenshotting-plugin, can we move theser interfaces to a platform/shared package?
'packages/kbn-reporting/export_types/pdf/**', // TODO @elastic/appex-sharedux - A package depending on a plugin: @kbn/screenshotting-plugin, can we move theser interfaces to a platform/shared package?
'packages/kbn-reporting/export_types/png_common/**', // TODO @elastic/appex-sharedux - A package depending on a plugin: @kbn/screenshotting-plugin, can we move theser interfaces to a platform/shared package?
'packages/kbn-reporting/export_types/png/**', // TODO @elastic/appex-sharedux - A package depending on a plugin: @kbn/screenshotting-plugin, can we move theser interfaces to a platform/shared package?
'packages/kbn-reporting/public/**', // TODO @elastic/appex-sharedux - A package depending on a plugin: @kbn/screenshotting-plugin, can we move theser interfaces to a platform/shared package?
'packages/kbn-reporting/server/**', // TODO @elastic/appex-sharedux - A package depending on a plugin: @kbn/screenshotting-plugin, can we move theser interfaces to a platform/shared package?
'packages/shared-ux/page/analytics_no_data/types/**',
'scripts/create_observability_rules.js', // TODO - is importing "@kbn/observability-alerting-test-data" (observability/private)
'src/cli_setup/**', // TODO @kibana/operations - is importing "@kbn/interactive-setup-plugin" (platform/private)
'src/dev/build/tasks/install_chromium.ts', // TODO @kibana/operations - is importing "@kbn/screenshotting-plugin" (platform/private)
'src/plugins/ai_assistant_management/selection/**',
'src/plugins/dashboard/**',
'src/plugins/discover/**',
'test/**',
'x-pack/examples/exploratory_view_example/**',
'x-pack/examples/screenshotting_example/**',
'x-pack/examples/ui_actions_enhanced_examples/**',
'x-pack/packages/security-solution/data_table/**',
'x-pack/plugins/aiops/**',
'x-pack/plugins/data_quality/**',
'x-pack/plugins/ingest_pipelines/**',
'x-pack/plugins/ml/**',
'x-pack/plugins/monitoring/**',
'x-pack/plugins/observability_solution/infra/**',
'x-pack/plugins/observability_solution/inventory/**',
'x-pack/plugins/observability_solution/investigate_app/**',
'x-pack/plugins/observability_solution/investigate/**',
// logsShared depends on o11y/private plugins, but platform plugins depend on it
'x-pack/plugins/observability_solution/logs_shared/**',
'x-pack/plugins/observability_solution/metrics_data_access/**',
'x-pack/plugins/observability_solution/observability_ai_assistant_app/**',
'x-pack/plugins/observability_solution/observability_ai_assistant_management/**',
'x-pack/plugins/observability_solution/observability/**',
'x-pack/plugins/observability_solution/slo/**',
'x-pack/plugins/observability_solution/synthetics/e2e/**',
// this plugin depends on visTypeTimeseries plugin (for TSVB viz) which is platform/private ATM
'x-pack/plugins/observability_solution/infra/**',
// TODO @kibana/operations
'scripts/create_observability_rules.js', // is importing "@kbn/observability-alerting-test-data" (observability/private)
'src/cli_setup/**', // is importing "@kbn/interactive-setup-plugin" (platform/private)
'src/dev/build/tasks/install_chromium.ts', // is importing "@kbn/screenshotting-plugin" (platform/private)
// @kbn/osquery-plugin could be categorised as Security, but @kbn/infra-plugin (observability) depends on it!
'x-pack/plugins/osquery/**',
'x-pack/plugins/search_assistant/**',
// For now, we keep the exception to let tests depend on anythying.
// Ideally, we need to classify the solution specific ones to reduce CI times
'test/**',
'x-pack/test_serverless/**',
'x-pack/test/**',
'x-pack/test/plugin_functional/plugins/resolver_test/**',

View file

@ -1,5 +1,7 @@
{
"type": "shared-browser",
"id": "@kbn/shared-ux-page-analytics-no-data",
"owner": "@elastic/appex-sharedux"
"owner": "@elastic/appex-sharedux",
"group": "platform",
"visibility": "private"
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-common",
"id": "@kbn/shared-ux-page-analytics-no-data-mocks",
"owner": "@elastic/appex-sharedux"
"owner": "@elastic/appex-sharedux",
"group": "platform",
"visibility": "private"
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-browser",
"id": "@kbn/shared-ux-page-analytics-no-data-types",
"owner": "@elastic/appex-sharedux"
"owner": "@elastic/appex-sharedux",
"group": "platform",
"visibility": "private"
}

View file

@ -4,8 +4,9 @@
"owner": [
"@elastic/obs-knowledge-team"
],
// This should probably be platform. While the code owner is currently observability, the package is a platform AI assistant selector.
"group": "platform",
"visibility": "private",
"visibility": "shared",
"plugin": {
"id": "aiAssistantManagementSelection",
"browser": true,
@ -25,4 +26,4 @@
"kibanaReact"
]
}
}
}

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/exploratory-view-example-plugin",
"owner": "@elastic/obs-ux-infra_services-team",
"group": "observability",
"visibility": "private",
"plugin": {
"id": "exploratoryViewExample",
"server": false,

View file

@ -2,6 +2,10 @@
"type": "plugin",
"id": "@kbn/screenshotting-example-plugin",
"owner": "@elastic/appex-sharedux",
// This plugin is not meant to be referenced or imported
"visibility": "private",
// If cloned / used as an inspiration, please bear in mind that your plugin might belong to a specific solution group
"group": "platform",
"description": "An example integration with the screenshotting plugin.",
"plugin": {
"id": "screenshottingExample",

View file

@ -2,6 +2,10 @@
"type": "plugin",
"id": "@kbn/ui-actions-enhanced-examples-plugin",
"owner": "@elastic/appex-sharedux",
// This plugin is not meant to be referenced or imported
"visibility": "private",
// If cloned / used as an inspiration, please bear in mind that your plugin might belong to a specific solution group
"group": "platform",
"plugin": {
"id": "uiActionsEnhancedExamples",
"server": false,

View file

@ -2,6 +2,6 @@
"id": "@kbn/ai-assistant",
"owner": "@elastic/search-kibana",
"type": "shared-browser",
"group": "observability",
"visibility": "private"
"group": "platform",
"visibility": "shared"
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-common",
"id": "@kbn/securitysolution-data-table",
"owner": "@elastic/security-threat-hunting-investigations"
"owner": "@elastic/security-threat-hunting-investigations",
"group": "security",
"visibility": "private"
}

View file

@ -5,7 +5,7 @@
"@elastic/kibana-presentation"
],
"group": "platform",
"visibility": "private",
"visibility": "shared",
"plugin": {
"id": "dashboardEnhanced",
"browser": true,
@ -31,4 +31,4 @@
"uiActions"
]
}
}
}

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/data-quality-plugin",
"owner": "@elastic/obs-ux-logs-team",
"group": "observability",
"visibility": "private",
"plugin": {
"id": "dataQuality",
"server": true,

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/ingest-pipelines-plugin",
"owner": "@elastic/kibana-management",
"group": "platform",
"visibility": "shared",
"plugin": {
"id": "ingestPipelines",
"server": true,

View file

@ -7,7 +7,7 @@
import { ElasticsearchClient } from '@kbn/core/server';
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { ESLicense } from '@kbn/telemetry-collection-xpack-plugin/server';
import type { LicenseGetLicenseInformation } from '@elastic/elasticsearch/lib/api/types';
import { INDEX_PATTERN_ELASTICSEARCH, USAGE_FETCH_INTERVAL } from '../../common/constants';
/**
@ -18,7 +18,7 @@ export async function getLicenses(
callCluster: ElasticsearchClient,
timestamp: number,
maxBucketSize: number
): Promise<{ [clusterUuid: string]: ESLicense | undefined }> {
): Promise<{ [clusterUuid: string]: LicenseGetLicenseInformation | undefined }> {
const response = await fetchLicenses(callCluster, clusterUuids, timestamp, maxBucketSize);
return handleLicenses(response);
}
@ -76,7 +76,7 @@ export async function fetchLicenses(
export interface ESClusterStatsWithLicense {
cluster_uuid: string;
type: 'cluster_stats';
license?: ESLicense;
license?: LicenseGetLicenseInformation;
}
/**

View file

@ -19,7 +19,6 @@
"@kbn/features-plugin",
"@kbn/infra-plugin",
"@kbn/licensing-plugin",
"@kbn/telemetry-collection-xpack-plugin",
"@kbn/triggers-actions-ui-plugin",
"@kbn/expect",
"@kbn/i18n",

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/infra-plugin",
"owner": ["@elastic/obs-ux-logs-team", "@elastic/obs-ux-infra_services-team"],
"group": "observability",
"visibility": "private",
"description": "This plugin visualizes data from Filebeat and Metricbeat, and integrates with other Observability solutions",
"plugin": {
"id": "infra",

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/inventory-plugin",
"owner": "@elastic/obs-ux-infra_services-team",
"group": "observability",
"visibility": "private",
"plugin": {
"id": "inventory",
"server": true,

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/investigate-app-plugin",
"owner": "@elastic/obs-ux-management-team",
"group": "observability",
"visibility": "private",
"plugin": {
"id": "investigateApp",
"server": true,

View file

@ -17,7 +17,6 @@ import {
} from '@kbn/data-plugin/server';
import { PluginStart as DataViewsPluginStart } from '@kbn/data-views-plugin/server';
import { HomeServerPluginSetup } from '@kbn/home-plugin/server';
import { VisTypeTimeseriesSetup } from '@kbn/vis-type-timeseries-plugin/server';
import { FeaturesPluginSetup } from '@kbn/features-plugin/server';
import { SpacesPluginSetup } from '@kbn/spaces-plugin/server';
import { PluginSetupContract as AlertingPluginContract } from '@kbn/alerting-plugin/server';
@ -37,7 +36,6 @@ export interface InfraServerPluginSetupDeps {
share: SharePluginSetup;
spaces: SpacesPluginSetup;
usageCollection: UsageCollectionSetup;
visTypeTimeseries: VisTypeTimeseriesSetup;
ml?: MlPluginSetup;
metricsDataAccess: MetricsDataPluginSetup;
}

View file

@ -16,7 +16,6 @@
"@kbn/data-plugin",
"@kbn/data-views-plugin",
"@kbn/home-plugin",
"@kbn/vis-type-timeseries-plugin",
"@kbn/features-plugin",
"@kbn/spaces-plugin",
"@kbn/alerting-plugin",

View file

@ -11,7 +11,7 @@ import {
ALERT_STATUS_RECOVERED,
ALERT_STATUS_UNTRACKED,
} from '@kbn/rule-data-utils';
import { Filter } from '@kbn/es-query';
import type { Filter } from '@kbn/es-query';
import { ALERT_STATUS_ALL } from './constants';
export type Maybe<T> = T | null | undefined;
@ -54,5 +54,10 @@ export interface TimeRange {
to?: string;
}
export interface EventNonEcsData {
field: string;
value?: Maybe<string[]>;
}
// Alert fields['kibana.alert.group] type
export type GroupBy = Group[];

View file

@ -5,11 +5,7 @@
* 2.0.
*/
/**
* We need to produce types and code transpilation at different folders during the build of the package.
* We have types and code at different imports because we don't want to import the whole package in the resulting webpack bundle for the plugin.
* This way plugins can do targeted imports to reduce the final code bundle
*/
import type { EuiDataGridColumn } from '@elastic/eui';
import {
ALERT_EVALUATION_VALUE,
ALERT_EVALUATION_THRESHOLD,
@ -21,30 +17,18 @@ import {
ALERT_INSTANCE_ID,
TAGS,
} from '@kbn/rule-data-utils';
import { EuiDataGridColumn } from '@elastic/eui';
import type { ColumnHeaderOptions } from '@kbn/timelines-plugin/common';
import { i18n } from '@kbn/i18n';
/**
* columns implements a subset of `EuiDataGrid`'s `EuiDataGridColumn` interface,
* plus additional TGrid column properties
*/
export const getColumns = (
{
showRuleName,
}: {
showRuleName?: boolean;
} = { showRuleName: false }
): Array<
Pick<EuiDataGridColumn, 'display' | 'displayAsText' | 'id' | 'initialWidth'> & ColumnHeaderOptions
> => {
const ruleNameColumn: Array<
Pick<EuiDataGridColumn, 'display' | 'displayAsText' | 'id' | 'initialWidth'> &
ColumnHeaderOptions
> = showRuleName
): EuiDataGridColumn[] => {
const ruleNameColumn: EuiDataGridColumn[] = showRuleName
? [
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate(
'xpack.observability.alertsTGrid.ruleNameColumnDescription',
{
@ -59,7 +43,6 @@ export const getColumns = (
return [
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate('xpack.observability.alertsTGrid.statusColumnDescription', {
defaultMessage: 'Alert Status',
}),
@ -67,7 +50,6 @@ export const getColumns = (
initialWidth: 120,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate('xpack.observability.alertsTGrid.triggeredColumnDescription', {
defaultMessage: 'Triggered',
}),
@ -76,7 +58,6 @@ export const getColumns = (
schema: 'datetime',
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate('xpack.observability.alertsTGrid.durationColumnDescription', {
defaultMessage: 'Duration',
}),
@ -85,7 +66,6 @@ export const getColumns = (
},
...ruleNameColumn,
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate('xpack.observability.alertsTGrid.sourceColumnDescription', {
defaultMessage: 'Group',
}),
@ -93,7 +73,6 @@ export const getColumns = (
initialWidth: 100,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate(
'xpack.observability.alertsTGrid.observedValueColumnDescription',
{
@ -104,7 +83,6 @@ export const getColumns = (
initialWidth: 100,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate('xpack.observability.alertsTGrid.thresholdColumnDescription', {
defaultMessage: 'Threshold',
}),
@ -112,7 +90,6 @@ export const getColumns = (
initialWidth: 100,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate('xpack.observability.alertsTGrid.tagsColumnDescription', {
defaultMessage: 'Tags',
}),
@ -120,12 +97,10 @@ export const getColumns = (
initialWidth: 150,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate('xpack.observability.alertsTGrid.reasonColumnDescription', {
defaultMessage: 'Reason',
}),
id: ALERT_REASON,
linkField: '*',
},
];
};

View file

@ -6,7 +6,6 @@
*/
import { ALERT_STATUS, ALERT_STATUS_ACTIVE, ALERT_STATUS_RECOVERED } from '@kbn/rule-data-utils';
import type { DeprecatedCellValueElementProps } from '@kbn/timelines-plugin/common';
import { render } from '../../../utils/test_helper';
import { getRenderCellValue } from './render_cell_value';
@ -19,7 +18,6 @@ describe('getRenderCellValue', () => {
it('should return an active indicator when alert status is active', async () => {
const cell = render(
getRenderCellValue({
...requiredProperties,
columnId: ALERT_STATUS,
data: makeAlertsTableRow({ alertStatus: ALERT_STATUS_ACTIVE }),
})
@ -31,7 +29,6 @@ describe('getRenderCellValue', () => {
it('should return a recovered indicator when alert status is recovered', async () => {
const cell = render(
getRenderCellValue({
...requiredProperties,
columnId: ALERT_STATUS,
data: makeAlertsTableRow({ alertStatus: ALERT_STATUS_RECOVERED }),
})
@ -50,22 +47,3 @@ function makeAlertsTableRow({ alertStatus }: AlertsTableRow) {
},
];
}
const requiredProperties: DeprecatedCellValueElementProps = {
rowIndex: 0,
colIndex: 0,
columnId: '',
setCellProps: jest.fn(),
isExpandable: false,
isExpanded: false,
isDetails: false,
data: [],
eventId: '',
header: {
id: '',
columnHeaderType: 'not-filtered',
},
isDraggable: false,
linkValues: [],
scopeId: '',
};

View file

@ -23,7 +23,7 @@ import {
ALERT_RULE_EXECUTION_TIMESTAMP,
} from '@kbn/rule-data-utils';
import { isEmpty } from 'lodash';
import type { TimelineNonEcsData } from '@kbn/timelines-plugin/common';
import type { EventNonEcsData } from '../../../../common/typings';
import type { ObservabilityRuleTypeRegistry } from '../../..';
import { asDuration } from '../../../../common/utils/formatters';
import { AlertSeverityBadge } from '../../alert_severity_badge';
@ -36,7 +36,7 @@ export const getMappedNonEcsValue = ({
data,
fieldName,
}: {
data: TimelineNonEcsData[];
data: EventNonEcsData[];
fieldName: string;
}): string[] | undefined => {
const item = data.find((d) => d.field === fieldName);
@ -64,23 +64,24 @@ const getRenderValue = (mappedNonEcsValue: any) => {
return '--';
};
interface GetRenderCellValueParams {
columnId: string;
data?: EventNonEcsData[];
setFlyoutAlert?: (alertId: string) => void;
observabilityRuleTypeRegistry?: ObservabilityRuleTypeRegistry;
}
/**
* This implementation of `EuiDataGrid`'s `renderCellValue`
* accepts `EuiDataGridCellValueElementProps`, plus `data`
* from the TGrid
*/
export const getRenderCellValue = ({
columnId,
data,
setFlyoutAlert,
observabilityRuleTypeRegistry,
}: {
columnId: string;
data?: Array<{ field: string; value: any }>;
setFlyoutAlert?: (alertId: string) => void;
observabilityRuleTypeRegistry?: ObservabilityRuleTypeRegistry;
}) => {
}: GetRenderCellValueParams) => {
if (!data) return null;
const mappedNonEcsValue = getMappedNonEcsValue({
data,

View file

@ -10,20 +10,17 @@
* We have types and code at different imports because we don't want to import the whole package in the resulting webpack bundle for the plugin.
* This way plugins can do targeted imports to reduce the final code bundle
*/
import type { EuiDataGridColumn } from '@elastic/eui';
import { ALERT_DURATION, ALERT_REASON, ALERT_STATUS, ALERT_RULE_NAME } from '@kbn/rule-data-utils';
import { EuiDataGridColumn } from '@elastic/eui';
import type { ColumnHeaderOptions } from '@kbn/timelines-plugin/common';
import { i18n } from '@kbn/i18n';
/**
* columns implements a subset of `EuiDataGrid`'s `EuiDataGridColumn` interface,
* plus additional TGrid column properties
*/
export const columns: Array<
Pick<EuiDataGridColumn, 'display' | 'displayAsText' | 'id' | 'initialWidth'> & ColumnHeaderOptions
> = [
export const columns: EuiDataGridColumn[] = [
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate(
'xpack.observability.slo.sloAlertsEmbeddable.alertsTGrid.statusColumnDescription',
{
@ -34,7 +31,6 @@ export const columns: Array<
initialWidth: 110,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate(
'xpack.observability.slo.sloAlertsEmbeddable.alertsTGrid.durationColumnDescription',
{
@ -45,7 +41,6 @@ export const columns: Array<
initialWidth: 116,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate(
'xpack.observability.slo.sloAlertsEmbeddable.alertsTGrid.sloColumnDescription',
{
@ -56,7 +51,6 @@ export const columns: Array<
initialWidth: 110,
},
{
columnHeaderType: 'not-filtered',
displayAsText: i18n.translate(
'xpack.observability.slo.sloAlertsEmbeddable.alertsTGrid.reasonColumnDescription',
{
@ -64,6 +58,5 @@ export const columns: Array<
}
),
id: ALERT_REASON,
linkField: '*',
},
];

View file

@ -6,35 +6,36 @@
*/
import * as rt from 'io-ts';
import { CasesPublicStart } from '@kbn/cases-plugin/public';
import { ChartsPluginStart } from '@kbn/charts-plugin/public';
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { DataView, DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import { DiscoverStart } from '@kbn/discover-plugin/public';
import { EmbeddableStart } from '@kbn/embeddable-plugin/public';
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { LensPublicStart } from '@kbn/lens-plugin/public';
import { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public';
import { OsqueryPluginStart } from '@kbn/osquery-plugin/public';
import type { CasesPublicStart } from '@kbn/cases-plugin/public';
import type { ChartsPluginStart } from '@kbn/charts-plugin/public';
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { DataView, DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import type { DiscoverStart } from '@kbn/discover-plugin/public';
import type { EmbeddableStart } from '@kbn/embeddable-plugin/public';
import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import type { LensPublicStart } from '@kbn/lens-plugin/public';
import type { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public';
import type { OsqueryPluginStart } from '@kbn/osquery-plugin/public';
import { ALERT_GROUP, ALERT_RULE_PARAMETERS } from '@kbn/rule-data-utils';
import { SharePluginStart } from '@kbn/share-plugin/public';
import { SpacesPluginStart } from '@kbn/spaces-plugin/public';
import {
import type { SharePluginStart } from '@kbn/share-plugin/public';
import type { SpacesPluginStart } from '@kbn/spaces-plugin/public';
import type {
RuleTypeParams,
TriggersAndActionsUIPublicPluginStart,
} from '@kbn/triggers-actions-ui-plugin/public';
import { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
import { UsageCollectionStart } from '@kbn/usage-collection-plugin/public';
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public';
import type { Group } from '../../../common/typings';
import {
aggType,
CustomThresholdSearchSourceFields,
BaseMetricExpressionParams,
CustomMetricExpressionParams,
MetricExpressionParams,
ThresholdParams,
type CustomThresholdSearchSourceFields,
type BaseMetricExpressionParams,
type CustomMetricExpressionParams,
type MetricExpressionParams,
type ThresholdParams,
} from '../../../common/custom_threshold_rule/types';
import { ObservabilityPublicStart } from '../../plugin';
import type { ObservabilityPublicStart } from '../../plugin';
export type CustomThresholdPrefillOptions = Partial<
Omit<ThresholdParams, 'criteria'> & { criteria: Array<Partial<MetricExpressionParams>> }
@ -90,8 +91,9 @@ export interface CustomThresholdRuleTypeParams extends RuleTypeParams {
searchConfiguration: CustomThresholdSearchSourceFields;
groupBy?: string | string[];
}
export interface CustomThresholdAlertFields {
[ALERT_GROUP]?: Array<{ field: string; value: string }>;
[ALERT_GROUP]?: Group[];
[ALERT_RULE_PARAMETERS]: CustomThresholdRuleTypeParams;
}

View file

@ -19,15 +19,15 @@ import { i18n } from '@kbn/i18n';
import { CaseAttachmentsWithoutOwner } from '@kbn/cases-plugin/public';
import { AttachmentType } from '@kbn/cases-plugin/common';
import { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs';
import { TimelineNonEcsData } from '@kbn/timelines-plugin/common';
import type { AlertActionsProps } from '@kbn/triggers-actions-ui-plugin/public/types';
import { useRouteMatch } from 'react-router-dom';
import { SLO_ALERTS_TABLE_ID } from '@kbn/observability-shared-plugin/common';
import type { EventNonEcsData } from '../../../../common/typings';
import { RULE_DETAILS_PAGE_ID } from '../../rule_details/constants';
import { paths, SLO_DETAIL_PATH } from '../../../../common/locators/paths';
import { useKibana } from '../../../utils/kibana_react';
import { parseAlert } from '../helpers/parse_alert';
import { observabilityFeatureId, ObservabilityRuleTypeRegistry } from '../../..';
import { observabilityFeatureId, type ObservabilityRuleTypeRegistry } from '../../..';
import type { ConfigSchema } from '../../../plugin';
import { ALERT_DETAILS_PAGE_ID } from '../../alert_details/alert_details';
@ -58,7 +58,7 @@ export function AlertActions({
const data = useMemo(
() =>
Object.entries(alert ?? {}).reduce<TimelineNonEcsData[]>(
Object.entries(alert ?? {}).reduce<EventNonEcsData[]>(
(acc, [field, value]) => [...acc, { field, value: value as string[] }],
[]
),

View file

@ -14,7 +14,6 @@ import { coreMock } from '@kbn/core/public/mocks';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
import translations from '@kbn/translations-plugin/translations/ja-JP.json';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
@ -52,7 +51,7 @@ const queryClient = new QueryClient({
export const render = (component: React.ReactNode, config: Subset<ConfigSchema> = {}) => {
return testLibRender(
<IntlProvider locale="en-US" messages={translations.messages}>
<IntlProvider locale="en-US">
<KibanaContextProvider
services={{
...core,

View file

@ -50,7 +50,6 @@
"@kbn/grouping",
"@kbn/data-views-plugin",
"@kbn/core-http-browser",
"@kbn/timelines-plugin",
"@kbn/visualization-ui-components",
"@kbn/event-annotation-components",
"@kbn/slo-schema",
@ -101,7 +100,6 @@
"@kbn/serverless",
"@kbn/core-application-browser",
"@kbn/core-theme-browser",
"@kbn/translations-plugin",
"@kbn/config-schema",
"@kbn/securitysolution-io-ts-utils",
"@kbn/core-elasticsearch-server",

View file

@ -4,8 +4,8 @@
"owner": [
"@elastic/obs-ai-assistant"
],
"group": "observability",
"visibility": "private",
"group": "platform",
"visibility": "shared",
"plugin": {
"id": "observabilityAIAssistant",
"browser": true,
@ -35,4 +35,4 @@
],
"extraPublicDirs": []
}
}
}

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/observability-ai-assistant-management-plugin",
"owner": "@elastic/obs-ai-assistant",
"group": "observability",
"visibility": "private",
"plugin": {
"id": "observabilityAiAssistantManagement",
"server": true,

View file

@ -11,7 +11,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render as testLibRender } from '@testing-library/react';
import { coreMock } from '@kbn/core/public/mocks';
import { __IntlProvider as IntlProvider } from '@kbn/i18n-react';
import translations from '@kbn/translations-plugin/translations/ja-JP.json';
import { observabilityAIAssistantPluginMock } from '@kbn/observability-ai-assistant-plugin/public/mock';
import { RouterProvider } from '@kbn/typed-react-router-config';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
@ -79,7 +78,7 @@ export const render = (
return testLibRender(
// @ts-ignore
<IntlProvider locale="en-US" messages={translations.messages}>
<IntlProvider locale="en-US">
<RedirectToHomeIfUnauthorized coreStart={mergedCoreStartMock}>
<KibanaContextProvider services={{ ...mergedCoreStartMock, ...startDeps }}>
<AppContextProvider value={appContextValue}>

View file

@ -19,7 +19,6 @@
"@kbn/core-chrome-browser",
"@kbn/observability-ai-assistant-plugin",
"@kbn/serverless",
"@kbn/translations-plugin",
"@kbn/enterprise-search-plugin",
"@kbn/management-settings-components-field-row",
"@kbn/observability-shared-plugin",

View file

@ -13,7 +13,6 @@ import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { createObservabilityRuleTypeRegistryMock } from '@kbn/observability-plugin/public';
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
import translations from '@kbn/translations-plugin/translations/ja-JP.json';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render as testLibRender } from '@testing-library/react';
import React from 'react';
@ -43,7 +42,7 @@ const queryClient = new QueryClient({
export const render = (component: React.ReactNode) => {
return testLibRender(
// @ts-ignore
<IntlProvider locale="en-US" messages={translations.messages}>
<IntlProvider locale="en-US">
<KibanaContextProvider
services={{
...core,

View file

@ -17,7 +17,6 @@
"@kbn/i18n-react",
"@kbn/shared-ux-router",
"@kbn/core",
"@kbn/translations-plugin",
"@kbn/rule-data-utils",
"@kbn/triggers-actions-ui-plugin",
"@kbn/observability-plugin",

View file

@ -2,5 +2,7 @@
"type": "test-helper",
"id": "@kbn/synthetics-e2e",
"owner": "@elastic/obs-ux-management-team",
"group": "observability",
"visibility": "private",
"devOnly": true
}

View file

@ -5,7 +5,7 @@
"@elastic/kibana-reporting-services"
],
"group": "platform",
"visibility": "private",
"visibility": "shared",
"description": "Kibana Screenshotting Plugin",
"plugin": {
"id": "screenshotting",
@ -23,4 +23,4 @@
"cloud"
]
}
}
}

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/search-assistant",
"owner": "@elastic/search-kibana",
"group": "search",
"visibility": "private",
"description": "AI Assistant for Search",
"plugin": {
"id": "searchAssistant",

View file

@ -5,8 +5,6 @@
* 2.0.
*/
export type { ESLicense } from './telemetry_collection';
// This exports static code and TypeScript types,
// as well as, Kibana Platform `plugin()` initializer.

View file

@ -165,9 +165,6 @@ describe('ES deprecation logs', () => {
prepend: (url: string) => url,
},
},
plugins: {
infra: {},
},
});
});

View file

@ -108,7 +108,6 @@ export const getAppContextMock = (kibanaVersion: SemVer) => ({
},
plugins: {
share: shareMock,
infra: undefined,
cloud: {
...cloudMock.createSetup(),
isCloudEnabled: false,

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/upgrade-assistant-plugin",
"owner": "@elastic/kibana-management",
"group": "platform",
"visibility": "private",
"plugin": {
"id": "upgradeAssistant",
"server": true,
@ -21,7 +23,6 @@
"usageCollection",
"cloud",
"security",
"infra",
"logsShared"
],
"requiredBundles": [

View file

@ -51,7 +51,7 @@ export class UpgradeAssistantUIPlugin
title: pluginName,
order: 1,
async mount(params) {
const [coreStart, { data, ...plugins }] = await coreSetup.getStartServices();
const [coreStart, { data }] = await coreSetup.getStartServices();
const {
chrome: { docTitle },
@ -65,10 +65,6 @@ export class UpgradeAssistantUIPlugin
plugins: {
cloud,
share,
// Infra plugin doesnt export anything as a public interface. So the only
// way we have at this stage for checking if the plugin is available or not
// is by checking if the startServices has the `infra` key.
infra: Object.hasOwn(plugins, 'infra') ? {} : undefined,
},
services: {
core: coreStart,

View file

@ -47,7 +47,6 @@ export interface AppDependencies {
plugins: {
cloud?: CloudSetup;
share: SharePluginSetup;
infra: object | undefined;
};
services: {
core: CoreStart;