Skip to content

Commit d1dcd81

Browse files
authored
Merge branch 'main' into update-k8s-templates-20220812091605
2 parents fb9088e + ad135e9 commit d1dcd81

25 files changed

Lines changed: 158 additions & 203 deletions

File tree

src/core/server/ui_settings/saved_objects/migrations.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,3 +310,38 @@ describe('ui_settings 8.1.0 migrations', () => {
310310
});
311311
});
312312
});
313+
314+
describe('ui_settings 8.5.0 migrations', () => {
315+
const migration = migrations['8.5.0'];
316+
317+
test('returns doc on empty object', () => {
318+
expect(migration({} as SavedObjectUnsanitizedDoc)).toEqual({
319+
references: [],
320+
});
321+
});
322+
323+
test('removes "observability:enableInfrastructureView" setting', () => {
324+
const doc = {
325+
type: 'config',
326+
id: '8.5.0',
327+
attributes: {
328+
buildNum: 9007199254740991,
329+
'observability:enableInfrastructureView': true,
330+
},
331+
references: [],
332+
updated_at: '2020-06-09T20:18:20.349Z',
333+
migrationVersion: {},
334+
};
335+
336+
expect(migration(doc)).toEqual({
337+
type: 'config',
338+
id: '8.5.0',
339+
attributes: {
340+
buildNum: 9007199254740991,
341+
},
342+
references: [],
343+
updated_at: '2020-06-09T20:18:20.349Z',
344+
migrationVersion: {},
345+
});
346+
});
347+
});

src/core/server/ui_settings/saved_objects/migrations.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,25 @@ export const migrations = {
138138
}),
139139
references: doc.references || [],
140140
}),
141+
'8.5.0': (doc: SavedObjectUnsanitizedDoc<any>): SavedObjectSanitizedDoc<any> => ({
142+
...doc,
143+
...(doc.attributes && {
144+
attributes: Object.keys(doc.attributes).reduce(
145+
(acc, key) =>
146+
[
147+
// owner: Team:Apm
148+
'observability:enableInfrastructureView',
149+
].includes(key)
150+
? {
151+
...acc,
152+
}
153+
: {
154+
...acc,
155+
[key]: doc.attributes[key],
156+
},
157+
{}
158+
),
159+
}),
160+
references: doc.references || [],
161+
}),
141162
};

src/plugins/kibana_usage_collection/server/collectors/management/schema.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,6 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
430430
type: 'boolean',
431431
_meta: { description: 'Non-default value of setting.' },
432432
},
433-
'observability:enableInfrastructureView': {
434-
type: 'boolean',
435-
_meta: { description: 'Non-default value of setting.' },
436-
},
437433
'observability:enableServiceGroups': {
438434
type: 'boolean',
439435
_meta: { description: 'Non-default value of setting.' },

src/plugins/kibana_usage_collection/server/collectors/management/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export interface UsageStats {
4141
'observability:enableNewSyntheticsView': boolean;
4242
'observability:maxSuggestions': number;
4343
'observability:enableComparisonByDefault': boolean;
44-
'observability:enableInfrastructureView': boolean;
4544
'observability:enableServiceGroups': boolean;
4645
'visualize:enableLabs': boolean;
4746
'visualization:heatmap:maxBuckets': number;

src/plugins/telemetry/schema/oss_plugins.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8282,12 +8282,6 @@
82828282
"description": "Non-default value of setting."
82838283
}
82848284
},
8285-
"observability:enableInfrastructureView": {
8286-
"type": "boolean",
8287-
"_meta": {
8288-
"description": "Non-default value of setting."
8289-
}
8290-
},
82918285
"observability:enableServiceGroups": {
82928286
"type": "boolean",
82938287
"_meta": {

x-pack/plugins/apm/ftr_e2e/cypress/integration/power_user/feature_flag/infrastructure.spec.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

x-pack/plugins/apm/public/components/routing/templates/apm_service_template/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
import { i18n } from '@kbn/i18n';
1515
import { omit } from 'lodash';
1616
import React from 'react';
17-
import { enableInfrastructureView } from '@kbn/observability-plugin/public';
1817
import {
1918
isMobileAgentName,
2019
isJavaAgentName,
@@ -177,8 +176,6 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) {
177176
capabilities
178177
);
179178

180-
const showInfraTab = core.uiSettings.get<boolean>(enableInfrastructureView);
181-
182179
const router = useApmRouter();
183180

184181
const {
@@ -269,8 +266,6 @@ function useTabs({ selectedTab }: { selectedTab: Tab['key'] }) {
269266
label: i18n.translate('xpack.apm.home.infraTabLabel', {
270267
defaultMessage: 'Infrastructure',
271268
}),
272-
273-
hidden: !showInfraTab,
274269
},
275270
{
276271
key: 'service-map',

x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.test.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,6 @@ describe('geoPointToGeometry', () => {
360360
expect(points[0].coordinates).toEqual([lon, lat]);
361361
});
362362

363-
it('Should convert runtime geo_point value', () => {
364-
const points = [];
365-
geoPointToGeometry(`${lat},${lon}`, points);
366-
expect(points.length).toBe(1);
367-
expect(points[0].type).toBe('Point');
368-
expect(points[0].coordinates).toEqual([lon, lat]);
369-
});
370-
371363
it('Should convert array of values', () => {
372364
const lat2 = 30;
373365
const lon2 = -60;

x-pack/plugins/maps/common/elasticsearch_util/elasticsearch_geo_utils.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function hitsToGeoJson(
129129

130130
// Parse geo_point fields API response
131131
export function geoPointToGeometry(
132-
value: Point[] | Point | string | undefined,
132+
value: Point[] | Point | undefined,
133133
accumulator: Geometry[]
134134
): void {
135135
if (!value) {
@@ -143,19 +143,6 @@ export function geoPointToGeometry(
143143
return;
144144
}
145145

146-
// runtime geo_point field returns value as "lat,lon" string instead of GeoJSON
147-
// This is a workaround for a bug - https://github.com/elastic/elasticsearch/issues/85245
148-
if (typeof value === 'string') {
149-
const commaSplit = value.split(',');
150-
const lat = parseFloat(commaSplit[0]);
151-
const lon = parseFloat(commaSplit[1]);
152-
accumulator.push({
153-
type: GEO_JSON_TYPE.POINT,
154-
coordinates: [lon, lat],
155-
} as Point);
156-
return;
157-
}
158-
159146
// geo_point fields API returns GeoJSON
160147
accumulator.push(value as Point);
161148
}

x-pack/plugins/maps/public/classes/sources/es_search_source/__snapshots__/update_source_editor.test.js.snap

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)