Skip to content

Commit

Permalink
Merge branch 'main' into console/implement_editor_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliacech committed Apr 16, 2024
2 parents 3d458e6 + e60d23a commit ece77c6
Show file tree
Hide file tree
Showing 211 changed files with 10,034 additions and 455 deletions.
50 changes: 45 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,7 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql
/docs/user/reporting @elastic/appex-sharedux
/docs/settings/reporting-settings.asciidoc @elastic/appex-sharedux
/docs/setup/configuring-reporting.asciidoc @elastic/appex-sharedux
/x-pack/test_serverless/**/test_suites/common/reporting/ @elastic/appex-sharedux

### Global Experience Tagging
/x-pack/test/saved_object_tagging/ @elastic/appex-sharedux
Expand Down Expand Up @@ -1076,15 +1077,21 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql
/x-pack/test/functional/apps/infra/logs @elastic/obs-ux-logs-team

# Observability UX management team
x-pack/packages/observability/alert_details @elastic/obs-ux-management-team
x-pack/test/observability_functional @elastic/obs-ux-management-team
x-pack/plugins/observability_solution/infra/public/alerting @elastic/obs-ux-management-team
x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/obs-ux-management-team
/x-pack/packages/observability/alert_details @elastic/obs-ux-management-team
/x-pack/test/observability_functional @elastic/obs-ux-management-team
/x-pack/plugins/observability_solution/infra/public/alerting @elastic/obs-ux-management-team
/x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/obs-ux-management-team
/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_serverless/api_integration/test_suites/observability/burn_rate_rule @elastic/obs-ux-management-team


# Elastic Stack Monitoring
/x-pack/test/functional/apps/monitoring @elastic/obs-ux-infra_services-team @elastic/stack-monitoring
/x-pack/test/api_integration/apis/monitoring @elastic/obs-ux-infra_services-team @elastic/stack-monitoring
/x-pack/test/api_integration/apis/monitoring_collection @elastic/obs-ux-infra_services-team @elastic/stack-monitoring
/x-pack/test_serverless/**/test_suites/observability/infra/ @elastic/obs-ux-infra_services-team @elastic/stack-monitoring

# Fleet
/fleet_packages.json @elastic/fleet
Expand All @@ -1093,13 +1100,15 @@ x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/obs-ux-
/x-pack/test/fleet_functional @elastic/fleet
/src/dev/build/tasks/bundle_fleet_packages.ts @elastic/fleet @elastic/kibana-operations
/x-pack/plugins/fleet/server/services/elastic_agent_manifest.ts @elastic/fleet @elastic/obs-cloudnative-monitoring
/x-pack/test_serverless/**/test_suites/**/fleet/ @elastic/fleet

# APM
/x-pack/test/functional/apps/apm/ @elastic/obs-ux-infra_services-team
/x-pack/test/apm_api_integration/ @elastic/obs-ux-infra_services-team
/src/apm.js @elastic/kibana-core @vigneshshanmugam
/packages/kbn-utility-types/src/dot.ts @dgieselaar
/packages/kbn-utility-types/src/dot_test.ts @dgieselaar
/x-pack/test_serverless/api_integration/test_suites/observability/apm_api_integration/ @elastic/obs-ux-infra_services-team
#CC# /src/plugins/apm_oss/ @elastic/apm-ui
#CC# /x-pack/plugins/observability_solution/observability/ @elastic/apm-ui

Expand All @@ -1121,6 +1130,7 @@ x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/obs-ux-
/x-pack/test_serverless/functional/test_suites/observability/observability_logs_explorer @elastic/obs-ux-logs-team
/x-pack/test/functional/apps/dataset_quality @elastic/obs-ux-logs-team
/x-pack/test_serverless/functional/test_suites/observability/dataset_quality @elastic/obs-ux-logs-team
/x-pack/test_serverless/functional/test_suites/observability/ @elastic/obs-ux-logs-team

# Observability onboarding tour
/x-pack/plugins/observability_solution/observability_shared/public/components/tour @elastic/platform-onboarding
Expand Down Expand Up @@ -1154,6 +1164,8 @@ x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/obs-ux-
/x-pack/test/alerting_api_integration/spaces_only/tests/alerting/transform_rule_types/ @elastic/ml-ui
/x-pack/test/screenshot_creation/apps/ml_docs @elastic/ml-ui
/x-pack/test/screenshot_creation/services/ml_screenshots.ts @elastic/ml-ui
/x-pack/test_serverless/**/test_suites/**/ml/ @elastic/ml-ui
/x-pack/test_serverless/**/test_suites/common/management/transforms/ @elastic/ml-ui

# Additional plugins and packages maintained by the ML team.
/x-pack/test/accessibility/apps/group2/transform.ts @elastic/ml-ui
Expand Down Expand Up @@ -1206,12 +1218,21 @@ x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/obs-ux-
/packages/kbn-performance-testing-dataset-extractor @elastic/appex-qa
/x-pack/test_serverless/**/*config.base.ts @elastic/appex-qa
/x-pack/test_serverless/**/deployment_agnostic_services.ts @elastic/appex-qa
/x-pack/test_serverless/shared/ @elastic/appex-qa
/x-pack/test_serverless/**/test_suites/**/common_configs/ @elastic/appex-qa
/x-pack/test_serverless/api_integration/test_suites/common/elasticsearch_api @elastic/appex-qa
/x-pack/test_serverless/functional/test_suites/security/ftr/ @elastic/appex-qa
/x-pack/test_serverless/functional/test_suites/common/home_page/ @elastic/appex-qa
/x-pack/test_serverless/functional/services/ @elastic/appex-qa

# Core
/config/ @elastic/kibana-core
/typings/ @elastic/kibana-core
/test/analytics @elastic/kibana-core
/x-pack/test/saved_objects_field_count/ @elastic/kibana-core
/x-pack/test_serverless/**/test_suites/common/saved_objects_management/ @elastic/kibana-core
/x-pack/test_serverless/api_integration/test_suites/common/core/ @elastic/kibana-core
/x-pack/test_serverless/api_integration/test_suites/**/telemetry/ @elastic/kibana-core
#CC# /src/core/server/csp/ @elastic/kibana-core
#CC# /src/plugins/saved_objects/ @elastic/kibana-core
#CC# /x-pack/plugins/cloud/ @elastic/kibana-core
Expand Down Expand Up @@ -1258,6 +1279,7 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/test/security_functional/ @elastic/kibana-security
/x-pack/test/spaces_api_integration/ @elastic/kibana-security
/x-pack/test/saved_object_api_integration/ @elastic/kibana-security
/x-pack/test_serverless/**/test_suites/common/platform_security/ @elastic/kibana-security
/packages/core/http/core-http-server-internal/src/cdn_config/ @elastic/kibana-security @elastic/kibana-core
#CC# /x-pack/plugins/security/ @elastic/kibana-security

Expand All @@ -1278,13 +1300,31 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
/x-pack/test_serverless/api_integration/test_suites/search/cases/ @elastic/response-ops
/x-pack/test_serverless/api_integration/test_suites/observability/cases/ @elastic/response-ops
/x-pack/test_serverless/api_integration/test_suites/security/cases/ @elastic/response-ops
/x-pack/test_serverless/functional/test_suites/search/screenshot_creation/response_ops_docs @elastic/response-ops
/x-pack/test_serverless/functional/test_suites/security/screenshot_creation/response_ops_docs @elastic/response-ops
/x-pack/test_serverless/functional/test_suites/observability/screenshot_creation/response_ops_docs @elastic/response-ops
/x-pack/test_serverless/api_integration/test_suites/common/alerting/ @elastic/response-ops

# Enterprise Search
/x-pack/test/functional_enterprise_search/ @elastic/enterprise-search-frontend
/x-pack/plugins/enterprise_search/public/applications/shared/doc_links @elastic/ent-search-docs-team
/x-pack/test_serverless/api_integration/test_suites/search/serverless_search @elastic/enterprise-search-frontend
/x-pack/test_serverless/functional/test_suites/search/ @elastic/enterprise-search-frontend

# Management Experience - Deployment Management
/x-pack/test_serverless/functional/test_suites/common/index_management/ @elastic/kibana-management
/x-pack/test_serverless/**/test_suites/common/index_management/ @elastic/kibana-management
/x-pack/test_serverless/**/test_suites/common/management/index_management/ @elastic/kibana-management
/x-pack/test_serverless/**/test_suites/common/painless_lab/ @elastic/kibana-management
/x-pack/test_serverless/**/test_suites/common/console/ @elastic/kibana-management
/x-pack/test_serverless/api_integration/test_suites/common/management/ @elastic/kibana-management
/x-pack/test_serverless/api_integration/test_suites/common/search_profiler/ @elastic/kibana-management
/x-pack/test_serverless/functional/test_suites/**/advanced_settings.ts @elastic/kibana-management
/x-pack/test_serverless/functional/test_suites/common/management/disabled_uis.ts @elastic/kibana-management
/x-pack/test_serverless/functional/test_suites/common/management/ingest_pipelines.ts @elastic/kibana-management
/x-pack/test_serverless/functional/test_suites/common/management/landing_page.ts @elastic/kibana-management
/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

#CC# /x-pack/plugins/cross_cluster_replication/ @elastic/kibana-management

# Security Solution
Expand Down
3 changes: 3 additions & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The 8.13.2 release includes the following bug fixes.
=== Bug Fixes
Canvas::
* Fixes text settings to be honored in Canvas markdown elements ({kibana-pull}179948[#179948]).
* Fixes custom styling for Canvas markdown Workpads ({kibana-pull}180070[#180070]).
Discover::
* Fixes keyboard navigation for search input on the document viewer flyout ({kibana-pull}180022[#180022]).
Elastic Security::
Expand All @@ -81,6 +82,8 @@ Fleet::
* Fixes having to wait ten minutes after agent upgrade if agent cleared watching state ({kibana-pull}179917[#179917]).
Fixes using the latest available version in K8's manifest instead of the latest compatible version ({kibana-pull}179662[#179662]).
* Fixes a step in add agent instructions where a query to get all agents was unnecessary ({kibana-pull}179603[#179603]).
Lens & Visualizations::
* Fixes custom styling for TSVB markdown visualizations ({kibana-pull}180053[#180053]).
Machine Learning::
* Single Metric Viewer embeddable: Ensures the detector index is passed to chart correctly ({kibana-pull}179761[#179761]).
* AIOps: Fixes text field candidate selection for log rate analysis ({kibana-pull}179699[#179699]).
Expand Down
1 change: 1 addition & 0 deletions packages/deeplinks/security/deep_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

export enum SecurityPageName {
administration = 'administration',
aiInsights = 'ai_insights',
alerts = 'alerts',
assets = 'assets',
blocklist = 'blocklist',
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-rule-data-utils/src/rule_types/o11y_rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const OBSERVABILITY_THRESHOLD_RULE_TYPE_ID = 'observability.rules.custom_
export const SLO_BURN_RATE_RULE_TYPE_ID = 'slo.rules.burnRate';

export const METRIC_INVENTORY_THRESHOLD_ALERT_TYPE_ID = 'metrics.alert.inventory.threshold';
export const METRIC_THRESHOLD_ALERT_TYPE_ID = 'metrics.alert.threshold';
export const LOG_THRESHOLD_ALERT_TYPE_ID = 'logs.alert.document.count';

export enum ApmRuleType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ describe('migration v2', () => {
});

afterEach(async () => {
await Promise.all([rootA.shutdown(), rootB.shutdown(), rootC.shutdown()]);
try {
await Promise.all([rootA.shutdown(), rootB.shutdown(), rootC.shutdown()]);
} catch (e) {
/* trap */
}

if (esServer) {
await esServer.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from '../../../contexts';
import { useSetInitialValue } from './use_set_initial_value';
import { MonacoEditorActionsProvider } from './monaco_editor_actions_provider';
import { useSetupAutocompletePolling } from './use_setup_autocomplete_polling';
import { useSetupAutosave } from './use_setup_autosave';

export interface EditorProps {
Expand All @@ -28,7 +29,14 @@ export interface EditorProps {

export const MonacoEditor = ({ initialTextValue }: EditorProps) => {
const {
services: { notifications, esHostService, trackUiMetric, http },
services: {
notifications,
esHostService,
trackUiMetric,
http,
settings: settingsService,
autocompleteInfo,
},
} = useServicesContext();
const { toasts } = notifications;
const { settings } = useEditorReadContext();
Expand Down Expand Up @@ -57,6 +65,8 @@ export const MonacoEditor = ({ initialTextValue }: EditorProps) => {
setInitialValue({ initialTextValue, setValue, toasts });
}, [initialTextValue, setInitialValue, toasts]);

useSetupAutocompletePolling({ autocompleteInfo, settingsService });

useSetupAutosave({ value });

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* 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.
*/

import { useEffect } from 'react';
import { AutocompleteInfo, Settings } from '../../../../services';

interface SetupAutocompletePollingParams {
/** The Console autocomplete service. */
autocompleteInfo: AutocompleteInfo;
/** The Console settings service. */
settingsService: Settings;
}

/**
* Hook that sets up the autocomplete polling for Console editor.
*
* @param params The {@link SetupAutocompletePollingParams} to use.
*/
export const useSetupAutocompletePolling = (params: SetupAutocompletePollingParams) => {
const { autocompleteInfo, settingsService } = params;

useEffect(() => {
autocompleteInfo.retrieve(settingsService, settingsService.getAutocomplete());

return () => {
autocompleteInfo.clearSubscriptions();
};
}, [autocompleteInfo, settingsService]);
};
78 changes: 77 additions & 1 deletion src/plugins/data_views/common/data_views/data_views.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe('IndexPatterns', () => {
expect(apiClient.getFieldsForWildcard).toBeCalledWith(args);
});

test('getFieldsForWildcard called with allowNoIndex set to true as default ', async () => {
test('getFieldsForWildcard called with allowNoIndex set to true as default', async () => {
const id = '1';
await indexPatterns.get(id);
expect(apiClient.getFieldsForWildcard).toBeCalledWith({
Expand All @@ -214,6 +214,82 @@ describe('IndexPatterns', () => {
});
});

test('getFieldsForIndexPattern called with allowHidden set to undefined as default', async () => {
await indexPatterns.getFieldsForIndexPattern({ id: '1' } as DataViewSpec, {
pattern: 'something',
});
expect(apiClient.getFieldsForWildcard).toBeCalledWith({
allowHidden: undefined,
allowNoIndex: true,
metaFields: false,
pattern: undefined,
rollupIndex: undefined,
type: undefined,
});
});

test('getFieldsForIndexPattern called with allowHidden set to true', async () => {
await indexPatterns.getFieldsForIndexPattern({ id: '1', allowHidden: true } as DataViewSpec, {
pattern: 'something',
});
expect(apiClient.getFieldsForWildcard).toBeCalledWith({
allowHidden: true,
allowNoIndex: true,
metaFields: false,
pattern: undefined,
rollupIndex: undefined,
type: undefined,
});
});

test('getFieldsForIndexPattern called with allowHidden set to false', async () => {
await indexPatterns.getFieldsForIndexPattern({ id: '1', allowHidden: false } as DataViewSpec, {
pattern: 'something',
});
expect(apiClient.getFieldsForWildcard).toBeCalledWith({
allowHidden: false,
allowNoIndex: true,
metaFields: false,
pattern: undefined,
rollupIndex: undefined,
type: undefined,
});
});

test('getFieldsForIndexPattern called with getAllowHidden returning true', async () => {
await indexPatterns.getFieldsForIndexPattern(
{ id: '1', getAllowHidden: () => true } as DataView,
{
pattern: 'something',
}
);
expect(apiClient.getFieldsForWildcard).toBeCalledWith({
allowHidden: true,
allowNoIndex: true,
metaFields: false,
pattern: undefined,
rollupIndex: undefined,
type: undefined,
});
});

test('getFieldsForIndexPattern called with getAllowHidden returning false', async () => {
await indexPatterns.getFieldsForIndexPattern(
{ id: '1', getAllowHidden: () => false } as DataView,
{
pattern: 'something',
}
);
expect(apiClient.getFieldsForWildcard).toBeCalledWith({
allowHidden: false,
allowNoIndex: true,
metaFields: false,
pattern: undefined,
rollupIndex: undefined,
type: undefined,
});
});

test('does cache ad-hoc data views', async () => {
const id = '1';

Expand Down
4 changes: 3 additions & 1 deletion src/plugins/data_views/common/data_views/data_views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,9 @@ export class DataViewsService {
...options,
pattern: indexPattern.title as string,
allowHidden:
(indexPattern as DataViewSpec).allowHidden || (indexPattern as DataView)?.getAllowHidden(),
(indexPattern as DataViewSpec).allowHidden == null
? (indexPattern as DataView)?.getAllowHidden?.()
: (indexPattern as DataViewSpec).allowHidden,
});

private getFieldsAndIndicesForDataView = async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export type AssistantFeatures = { [K in keyof typeof defaultAssistantFeatures]:
* Default features available to the elastic assistant
*/
export const defaultAssistantFeatures = Object.freeze({
assistantAlertsInsights: false,
assistantModelEvaluation: false,
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { Replacements } from '../../schemas';
import { AnonymizationFieldResponse } from '../../schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen';
import { isAllowed } from '../helpers';
import type { AnonymizedData, GetAnonymizedValues } from '../types';
Expand All @@ -16,12 +17,12 @@ export const getAnonymizedData = ({
rawData,
}: {
anonymizationFields?: AnonymizationFieldResponse[];
currentReplacements: Record<string, string> | undefined;
currentReplacements: Replacements | undefined;
getAnonymizedValue: ({
currentReplacements,
rawValue,
}: {
currentReplacements: Record<string, string> | undefined;
currentReplacements: Replacements | undefined;
rawValue: string;
}) => string;
getAnonymizedValues: GetAnonymizedValues;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

import { invert } from 'lodash/fp';
import { v4 } from 'uuid';
import { Replacements } from '../../schemas';

export const getAnonymizedValue = ({
currentReplacements,
rawValue,
}: {
currentReplacements: Record<string, string> | undefined;
currentReplacements: Replacements | undefined;
rawValue: string;
}): string => {
if (currentReplacements != null) {
Expand Down
Loading

0 comments on commit ece77c6

Please sign in to comment.