-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.10] [maps] fix Air-gapped enviroment hitting 400 error loading fon…
…ts for layer (#165986) (#166375) # Backport This will backport the following commits from `main` to `8.10`: - [[maps] fix Air-gapped enviroment hitting 400 error loading fonts for layer (#165986)](#165986) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-09-13T16:06:05Z","message":"[maps] fix Air-gapped enviroment hitting 400 error loading fonts for layer (#165986)\n\nCloses https://github.com/elastic/kibana/issues/165974\r\n\r\nThe root cause of the problem is calling `basePath.prepend` on a path\r\nwithout a leading `/`. Maps is not consistent with path constants. Some\r\nhave leading `/` while others do not. To resolve the issue, this PR\r\nupdates all path constants to consistently have leading `/`.\r\n\r\nPR adds functional test runner with `map.includeElasticMapsService:\r\nfalse` to ensure maps is tested without EMS enabled to catch future\r\nregressions.\r\n\r\n### Test instructions\r\n* set *map.includeElasticMapsService: false* in kibana.dev.yml\r\n* install sample data set\r\n* create new map with documents layer\r\n* Configure label styling\r\n* Verify layer is displayed with labels\r\n\r\n<img width=\"500\" alt=\"Screen Shot 2023-09-13 at 6 26 23 AM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/373691/44d12e87-9b80-424c-9bc9-126b373bdf18\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"691311ce7c38cff3ca89758f1a45e31b7f292759","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","Feature:Maps","v8.11.0","v8.10.1"],"number":165986,"url":"https://github.com/elastic/kibana/pull/165986","mergeCommit":{"message":"[maps] fix Air-gapped enviroment hitting 400 error loading fonts for layer (#165986)\n\nCloses https://github.com/elastic/kibana/issues/165974\r\n\r\nThe root cause of the problem is calling `basePath.prepend` on a path\r\nwithout a leading `/`. Maps is not consistent with path constants. Some\r\nhave leading `/` while others do not. To resolve the issue, this PR\r\nupdates all path constants to consistently have leading `/`.\r\n\r\nPR adds functional test runner with `map.includeElasticMapsService:\r\nfalse` to ensure maps is tested without EMS enabled to catch future\r\nregressions.\r\n\r\n### Test instructions\r\n* set *map.includeElasticMapsService: false* in kibana.dev.yml\r\n* install sample data set\r\n* create new map with documents layer\r\n* Configure label styling\r\n* Verify layer is displayed with labels\r\n\r\n<img width=\"500\" alt=\"Screen Shot 2023-09-13 at 6 26 23 AM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/373691/44d12e87-9b80-424c-9bc9-126b373bdf18\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"691311ce7c38cff3ca89758f1a45e31b7f292759"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165986","number":165986,"mergeCommit":{"message":"[maps] fix Air-gapped enviroment hitting 400 error loading fonts for layer (#165986)\n\nCloses https://github.com/elastic/kibana/issues/165974\r\n\r\nThe root cause of the problem is calling `basePath.prepend` on a path\r\nwithout a leading `/`. Maps is not consistent with path constants. Some\r\nhave leading `/` while others do not. To resolve the issue, this PR\r\nupdates all path constants to consistently have leading `/`.\r\n\r\nPR adds functional test runner with `map.includeElasticMapsService:\r\nfalse` to ensure maps is tested without EMS enabled to catch future\r\nregressions.\r\n\r\n### Test instructions\r\n* set *map.includeElasticMapsService: false* in kibana.dev.yml\r\n* install sample data set\r\n* create new map with documents layer\r\n* Configure label styling\r\n* Verify layer is displayed with labels\r\n\r\n<img width=\"500\" alt=\"Screen Shot 2023-09-13 at 6 26 23 AM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/373691/44d12e87-9b80-424c-9bc9-126b373bdf18\">\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"691311ce7c38cff3ca89758f1a45e31b7f292759"}},{"branch":"8.10","label":"v8.10.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <[email protected]>
- Loading branch information
1 parent
61055bf
commit 713bfd2
Showing
13 changed files
with
171 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# FTR tests for map.includeElasticMapsService: false | ||
|
||
Verify Kibana functionallity when connection to Elastic Maps Service is disabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrConfigProviderContext } from '@kbn/test'; | ||
import { services, pageObjects } from './ftr_provider_context'; | ||
|
||
export default async function ({ readConfigFile }: FtrConfigProviderContext) { | ||
const kibanaFunctionalConfig = await readConfigFile( | ||
require.resolve('../functional/config.base.js') | ||
); | ||
|
||
return { | ||
...kibanaFunctionalConfig.getAll(), | ||
testFiles: [require.resolve('./tests')], | ||
services, | ||
pageObjects, | ||
junit: { | ||
reportName: `Kibana Maps without access to Elastic Maps Service`, | ||
}, | ||
kbnTestServer: { | ||
...kibanaFunctionalConfig.get('kbnTestServer'), | ||
serverArgs: [ | ||
...kibanaFunctionalConfig.get('kbnTestServer.serverArgs'), | ||
`--map.includeElasticMapsService=false`, | ||
], | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { GenericFtrProviderContext } from '@kbn/test'; | ||
import { services } from '../functional/services'; | ||
import { pageObjects } from '../functional/page_objects'; | ||
|
||
export type FtrProviderContext = GenericFtrProviderContext<typeof services, typeof pageObjects>; | ||
export { services, pageObjects }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"attributes": { | ||
"fieldAttrs":"{}", | ||
"fieldFormatMap":"{}", | ||
"fields":"[]", | ||
"name":"logstash-*", | ||
"runtimeFieldMap":"{}", | ||
"sourceFilters":"[]", | ||
"timeFieldName":"@timestamp", | ||
"title":"logstash-*", | ||
"typeMeta":"{}" | ||
}, | ||
"coreMigrationVersion":"8.8.0", | ||
"created_at":"2023-09-07T14:49:04.891Z", | ||
"id":"fd405dbb-002b-4caa-aae1-0893e5ffb75b", | ||
"managed":false, | ||
"references":[], | ||
"type":"index-pattern", | ||
"typeMigrationVersion":"8.0.0", | ||
"updated_at":"2023-09-07T14:49:04.891Z", | ||
"version":"WzEwLDFd" | ||
} | ||
|
||
{ | ||
"id": "ee65a3b0-4d8d-11ee-a8ed-97fb2d02a957", | ||
"type": "map", | ||
"namespaces": [ | ||
"default" | ||
], | ||
"updated_at": "2023-09-07T14:50:48.043Z", | ||
"created_at": "2023-09-07T14:50:48.043Z", | ||
"version": "WzE1LDFd", | ||
"attributes": { | ||
"title": "mvt documents with labels", | ||
"description": "", | ||
"layerListJSON": "[{\"sourceDescriptor\":{\"geoField\":\"geo.coordinates\",\"scalingType\":\"MVT\",\"id\":\"57798aca-8a4e-4c35-9225-e8d4133ae8a7\",\"type\":\"ES_SEARCH\",\"applyGlobalQuery\":true,\"applyGlobalTime\":true,\"applyForceRefresh\":true,\"filterByMapBounds\":true,\"tooltipProperties\":[],\"sortField\":\"\",\"sortOrder\":\"desc\",\"topHitsGroupByTimeseries\":false,\"topHitsSplitField\":\"\",\"topHitsSize\":1,\"indexPatternRefName\":\"layer_0_source_index_pattern\"},\"id\":\"00c8d672-dc32-42cc-9e11-1c43d3e9a3be\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":0.75,\"visible\":true,\"style\":{\"type\":\"VECTOR\",\"properties\":{\"icon\":{\"type\":\"STATIC\",\"options\":{\"value\":\"marker\"}},\"fillColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#54B399\"}},\"lineColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#41937c\"}},\"lineWidth\":{\"type\":\"STATIC\",\"options\":{\"size\":0}},\"iconSize\":{\"type\":\"STATIC\",\"options\":{\"size\":6}},\"iconOrientation\":{\"type\":\"STATIC\",\"options\":{\"orientation\":0}},\"labelText\":{\"type\":\"DYNAMIC\",\"options\":{\"field\":{\"label\":\"bytes\",\"name\":\"bytes\",\"origin\":\"source\",\"type\":\"number\",\"supportsAutoDomain\":true,\"isUnsupported\":false}}},\"labelColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#000000\"}},\"labelSize\":{\"type\":\"STATIC\",\"options\":{\"size\":14}},\"labelZoomRange\":{\"options\":{\"useLayerZoomRange\":true,\"minZoom\":0,\"maxZoom\":24}},\"labelBorderColor\":{\"type\":\"STATIC\",\"options\":{\"color\":\"#FFFFFF\"}},\"symbolizeAs\":{\"options\":{\"value\":\"circle\"}},\"labelBorderSize\":{\"options\":{\"size\":\"SMALL\"}},\"labelPosition\":{\"options\":{\"position\":\"CENTER\"}}},\"isTimeAware\":true},\"includeInFitToBounds\":true,\"type\":\"MVT_VECTOR\",\"joins\":[],\"disableTooltips\":false}]", | ||
"mapStateJSON": "{\"adHocDataViews\":[],\"zoom\":2.19,\"center\":{\"lon\":-116.75537,\"lat\":55.05932},\"timeFilters\":{\"from\":\"2015-09-19T21:21:45.309Z\",\"to\":\"2015-09-23T01:33:44.867Z\"},\"refreshConfig\":{\"isPaused\":true,\"interval\":60000},\"query\":{\"query\":\"\",\"language\":\"kuery\"},\"filters\":[],\"settings\":{\"autoFitToDataBounds\":false,\"backgroundColor\":\"#ffffff\",\"customIcons\":[],\"disableInteractive\":false,\"disableTooltipControl\":false,\"hideToolbarOverlay\":false,\"hideLayerControl\":false,\"hideViewControl\":false,\"initialLocation\":\"LAST_SAVED_LOCATION\",\"fixedLocation\":{\"lat\":0,\"lon\":0,\"zoom\":2},\"browserLocation\":{\"zoom\":2},\"keydownScrollZoom\":false,\"maxZoom\":24,\"minZoom\":0,\"showScaleControl\":false,\"showSpatialFilters\":true,\"showTimesliderToggleButton\":true,\"spatialFiltersAlpa\":0.3,\"spatialFiltersFillColor\":\"#DA8B45\",\"spatialFiltersLineColor\":\"#DA8B45\"}}", | ||
"uiStateJSON": "{\"isLayerTOCOpen\":true,\"openTOCDetails\":[\"00c8d672-dc32-42cc-9e11-1c43d3e9a3be\"]}" | ||
}, | ||
"references": [ | ||
{ | ||
"name": "layer_0_source_index_pattern", | ||
"type": "index-pattern", | ||
"id": "fd405dbb-002b-4caa-aae1-0893e5ffb75b" | ||
} | ||
], | ||
"managed": false, | ||
"coreMigrationVersion": "8.8.0", | ||
"typeMigrationVersion": "8.4.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
|
||
export default function ({ getService, getPageObjects }: FtrProviderContext) { | ||
const PageObjects = getPageObjects(['maps']); | ||
const security = getService('security'); | ||
|
||
describe('Fonts', function () { | ||
before(async () => { | ||
await security.testUser.setRoles(['test_logstash_reader', 'global_maps_all']); | ||
await PageObjects.maps.loadSavedMap('mvt documents with labels'); | ||
}); | ||
|
||
after(async () => { | ||
await security.testUser.restoreDefaults(); | ||
}); | ||
|
||
it('should load map with labels', async () => { | ||
const doesLayerExist = await PageObjects.maps.doesLayerExist('logstash-*'); | ||
expect(doesLayerExist).to.equal(true); | ||
const tooltipText = await PageObjects.maps.getLayerTocTooltipMsg('logstash-*'); | ||
expect(tooltipText).to.equal( | ||
'logstash-*\nFound 14,000 documents.\nResults narrowed by global time' | ||
); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile, getService }: FtrProviderContext) { | ||
const kibanaServer = getService('kibanaServer'); | ||
const esArchiver = getService('esArchiver'); | ||
const browser = getService('browser'); | ||
|
||
describe('disable Elastic Maps Service', () => { | ||
before(async () => { | ||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); | ||
await kibanaServer.importExport.load('x-pack/test/disable_ems/kbn_archive.json'); | ||
await browser.setWindowSize(1600, 1000); | ||
}); | ||
|
||
after(async () => { | ||
await esArchiver.unload('x-pack/test/functional/es_archives/maps/data'); | ||
await kibanaServer.importExport.unload('x-pack/test/disable_ems/kbn_archive.json'); | ||
}); | ||
|
||
loadTestFile(require.resolve('./fonts')); | ||
}); | ||
} |