Skip to content

Commit 0aabff7

Browse files
authored
Merge branch '7.17' into backport/7.17/pr-193107
2 parents 34eb88f + 5420df6 commit 0aabff7

File tree

14 files changed

+155
-103
lines changed

14 files changed

+155
-103
lines changed

.github/workflows/on-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
)
2525
steps:
2626
- name: Checkout Actions
27-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
27+
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
2828
with:
2929
repository: 'elastic/kibana-github-actions'
3030
ref: main

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
"prop-types": "^15.7.2",
323323
"proxy-from-env": "1.0.0",
324324
"puid": "1.0.7",
325-
"puppeteer": "22.13.1",
325+
"puppeteer": "23.3.1",
326326
"query-string": "^6.13.2",
327327
"random-word-slugs": "^0.0.5",
328328
"raw-loader": "^3.1.0",

packages/kbn-screenshotting-server/src/paths.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export class ChromiumArchivePaths {
4545
platform: 'darwin',
4646
architecture: 'x64',
4747
archiveFilename: 'chrome-mac.zip',
48-
archiveChecksum: 'fa8004f3c8c5574c089c901e48429d1b01720bf3dd25e05ac56c41d0ab470c10',
49-
binaryChecksum: '56f25cb6881e5c2b1aac0d8e87630517d1af8effdc9319d35f872add048df1ca',
48+
archiveChecksum: '0a3d18efd00b3406f66139a673616b4b2b4b00323776678cb82295996f5a6733',
49+
binaryChecksum: '8bcdaa973ee11110f6b70eaac2418fda3bb64446cf37f964fce331cdc8907a20',
5050
binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
51-
revision: 1300317, // 1300313 is not available for Mac_x64
51+
revision: 1331485, // 1331488 is not available for Mac_x64
5252
location: 'common',
5353
archivePath: 'Mac',
5454
isPreInstalled: false,
@@ -57,44 +57,44 @@ export class ChromiumArchivePaths {
5757
platform: 'darwin',
5858
architecture: 'arm64',
5959
archiveFilename: 'chrome-mac.zip',
60-
archiveChecksum: 'bea49fd3ccd6aaccd7cdc4df38306f002a2934aaa2c044f3b5a3272b31ec77ca',
61-
binaryChecksum: '4c55d9e47deb1179c377c9785afdcdb5f3d3f351bff62b414d43e32ff195bd55',
60+
archiveChecksum: '426eddf16acb88b9446a91de53cc4364c7d487414248f33e30f68cf488cea0c0',
61+
binaryChecksum: '827931739bfdd2b6790a81d5ade8886c159cd051581d79b84d1ede447293e9cf',
6262
binaryRelativePath: 'chrome-mac/Chromium.app/Contents/MacOS/Chromium',
63-
revision: 1300314, // 1300313 is not available for Mac_Arm
63+
revision: 1331488,
6464
location: 'common',
6565
archivePath: 'Mac_Arm',
6666
isPreInstalled: false,
6767
},
6868
{
6969
platform: 'linux',
7070
architecture: 'x64',
71-
archiveFilename: 'chromium-5b5d829-locales-linux_x64.zip',
72-
archiveChecksum: '799e8fd5f47ea70b8a3972d39b2617c9cbebc7fc433a89251dae312a7c77534b',
73-
binaryChecksum: '216b8f7ff9b41e985397342c2df54e4f8e07a01a3b8a929f39b9a10931d26ff5',
71+
archiveFilename: 'chromium-fe621c5-locales-linux_x64.zip',
72+
archiveChecksum: '12ce2e0eac184072dfcbc7a267328e3eb7fbe10a682997f4111c0378f2397341',
73+
binaryChecksum: '670481cfa8db209401106cd23051009d390c03608724d0822a12c8c0a92b4c25',
7474
binaryRelativePath: 'headless_shell-linux_x64/headless_shell',
75-
revision: 1300313,
75+
revision: 1331488,
7676
location: 'custom',
7777
isPreInstalled: true,
7878
},
7979
{
8080
platform: 'linux',
8181
architecture: 'arm64',
82-
archiveFilename: 'chromium-5b5d829-locales-linux_arm64.zip',
83-
archiveChecksum: '961e20c45c61f8e948efdc4128bb17c23217bbcb28537f270ccf5bf0826981e7',
84-
binaryChecksum: 'fc4027fb6b1c96bef9374d5d9f791097fae2ec2ddc4e0134167075bd52d1458f',
82+
archiveFilename: 'chromium-fe621c5-locales-linux_arm64.zip',
83+
archiveChecksum: 'f7333eaff5235046c8775f0c1a0b7395b7ebc2e054ea638710cf511c4b6f9daf',
84+
binaryChecksum: '8a3a3371b3d04f4b0880b137a3611c223e0d8e65a218943cb7be1ec4a91f5e35',
8585
binaryRelativePath: 'headless_shell-linux_arm64/headless_shell',
86-
revision: 1300313,
86+
revision: 1331488,
8787
location: 'custom',
8888
isPreInstalled: true,
8989
},
9090
{
9191
platform: 'win32',
9292
architecture: 'x64',
9393
archiveFilename: 'chrome-win.zip',
94-
archiveChecksum: '27a2ed1473cefc6f48ff5665faa1fbcc69ef5be47ee21777a60e87c8379fdd93',
95-
binaryChecksum: 'd603401a5e6f8bd734b329876e4221a4d24a1999f14df6e32eeb5e6a72520d96',
94+
archiveChecksum: 'fa62be702f55f37e455bab4291c59ceb40e81e1922d30cf9453a4ee176b909bc',
95+
binaryChecksum: '1345e66583bad1a1f16885f381d1173de8bf931487da9ba155e1b58bf23b2c66',
9696
binaryRelativePath: path.join('chrome-win', 'chrome.exe'),
97-
revision: 1300320, // 1300313 is not available for win32
97+
revision: 1331487, // 1331488 is not available for win32
9898
location: 'common',
9999
archivePath: 'Win',
100100
isPreInstalled: true,

src/plugins/console/server/lib/spec_definitions/js/filter.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -108,38 +108,6 @@ filters.geo_distance = {
108108
},
109109
};
110110

111-
filters.geo_distance_range = {
112-
__template: {
113-
from: 100,
114-
to: 200,
115-
distance_unit: 'km',
116-
FIELD: {
117-
lat: 40.73,
118-
lon: -74.1,
119-
},
120-
},
121-
from: 100,
122-
to: 200,
123-
124-
distance_unit: {
125-
__one_of: ['km', 'miles'],
126-
},
127-
distance_type: {
128-
__one_of: ['arc', 'plane'],
129-
},
130-
include_lower: {
131-
__one_of: [true, false],
132-
},
133-
include_upper: {
134-
__one_of: [true, false],
135-
},
136-
137-
'{field}': {
138-
lat: 40.73,
139-
lon: -74.1,
140-
},
141-
};
142-
143111
filters.geo_polygon = {
144112
__template: {
145113
FIELD: {

src/plugins/data_views/common/fields/utils.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ describe('shortenDottedString', () => {
1616
test('should ignore non-string values', () => {
1717
const obj = { key: 'val' };
1818

19-
expect(shortenDottedString(true)).toBe(true);
20-
expect(shortenDottedString(123)).toBe(123);
21-
expect(shortenDottedString(obj)).toBe(obj);
19+
expect(shortenDottedString(true as unknown as string)).toBe(true);
20+
expect(shortenDottedString(123 as unknown as string)).toBe(123);
21+
expect(shortenDottedString(obj as unknown as string)).toBe(obj);
2222
});
2323
});

src/plugins/data_views/common/fields/utils.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,25 @@ export const isMultiField = isDataViewFieldSubtypeMulti;
2525
export const getFieldSubtypeMulti = getDataViewFieldSubtypeMulti;
2626
export const getFieldSubtypeNested = getDataViewFieldSubtypeNested;
2727

28-
const DOT_PREFIX_RE = /(.).+?\./g;
29-
3028
/**
3129
* Convert a dot.notated.string into a short
3230
* version (d.n.string)
3331
*
3432
* @return {any}
3533
*/
36-
export function shortenDottedString(input: any) {
37-
return typeof input !== 'string' ? input : input.replace(DOT_PREFIX_RE, '$1.');
34+
35+
export function shortenDottedString(input: string): string {
36+
if (typeof input === 'string') {
37+
const split = input.split('.');
38+
return split.reduce((acc, part, i) => {
39+
if (i === split.length - 1) {
40+
return acc + part;
41+
}
42+
return acc + part[0] + '.';
43+
}, '');
44+
}
45+
46+
return input;
3847
}
3948

4049
// Note - this code is duplicated from @kbn/es-query

x-pack/build_chromium/linux/args.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ v8_symbol_level = 0
1717
enable_ink = false
1818
rtc_build_examples = false
1919
angle_build_tests = false
20-
enable_screen_ai_service = false
20+
use_fake_screen_ai = true
2121
enable_vr = false
2222

2323
# Please, consult @elastic/kibana-security before changing/removing this option.

x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.test.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { LEGEND_TYPES } from '../vega_chart/common';
1616

1717
import {
1818
getColorSpec,
19+
getEscapedVegaFieldName,
1920
getScatterplotMatrixVegaLiteSpec,
2021
COLOR_OUTLIER,
2122
COLOR_RANGE_NOMINAL,
@@ -56,6 +57,49 @@ describe('getColorSpec()', () => {
5657
});
5758
});
5859

60+
describe('getEscapedVegaFieldName()', () => {
61+
it('should escape dots in field names', () => {
62+
const fieldName = 'field.name';
63+
const escapedFieldName = getEscapedVegaFieldName(fieldName);
64+
expect(escapedFieldName).toBe('field\\.name');
65+
});
66+
67+
it('should escape brackets in field names', () => {
68+
const fieldName = 'field[name]';
69+
const escapedFieldName = getEscapedVegaFieldName(fieldName);
70+
expect(escapedFieldName).toBe('field\\[name\\]');
71+
});
72+
73+
it('should escape both dots and brackets in field names', () => {
74+
const fieldName = 'field.name[0]';
75+
const escapedFieldName = getEscapedVegaFieldName(fieldName);
76+
expect(escapedFieldName).toBe('field\\.name\\[0\\]');
77+
});
78+
79+
it('should return the same string if there are no special characters', () => {
80+
const fieldName = 'fieldname';
81+
const escapedFieldName = getEscapedVegaFieldName(fieldName);
82+
expect(escapedFieldName).toBe('fieldname');
83+
});
84+
85+
it('should escape newlines in field names', () => {
86+
// String quotes process backslashes, so we need to escape them for
87+
// the test string to contain a backslash. For example, without the
88+
// double backslash, this string would contain a newline character.
89+
const fieldName = 'field\\name';
90+
const escapedFieldName = getEscapedVegaFieldName(fieldName);
91+
expect(escapedFieldName).toBe('field\\\\name');
92+
});
93+
94+
it('should escape backslashes in field names', () => {
95+
// String quotes process backslashes, so we need to escape them for
96+
// the test string to contain a backslash.
97+
const fieldName = 'fieldname\\withbackslash';
98+
const escapedFieldName = getEscapedVegaFieldName(fieldName);
99+
expect(escapedFieldName).toBe('fieldname\\\\withbackslash');
100+
});
101+
});
102+
59103
describe('getScatterplotMatrixVegaLiteSpec()', () => {
60104
it('should return the default spec for non-outliers without a legend', () => {
61105
const data = [{ x: 1, y: 1 }];

x-pack/plugins/ml/public/application/components/scatterplot_matrix/scatterplot_matrix_vega_lite_spec.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,28 @@ export const getColorSpec = (
5959
return { value: DEFAULT_COLOR };
6060
};
6161

62-
// Escapes the characters .[] in field names with double backslashes
62+
// Escapes the characters .[]\ in field names with double backslashes
6363
// since VEGA treats dots/brackets in field names as nested values.
6464
// See https://vega.github.io/vega-lite/docs/field.html for details.
65-
function getEscapedVegaFieldName(fieldName: string) {
66-
return fieldName.replace(/([\.|\[|\]])/g, '\\$1');
65+
export function getEscapedVegaFieldName(fieldName: string) {
66+
// Note the following isn't 100% ideal because there are cases when we may
67+
// end up with an additional backslash being rendered for labels of the
68+
// scatterplot. However, all other variations I tried caused rendering
69+
// problems of the charts and rendering would fail completely.
70+
71+
// For example, just escaping \n in the first replace without the general
72+
// backslash escaping causes the following Vega error:
73+
// Duplicate scale or projection name: "child__row_my_numbercolumn_my_number_x"
74+
75+
// Escaping just the backslash without the additional \n escaping causes
76+
// causes an "expression parse error" in Vega and the chart wouldn't render.
77+
78+
// Escape newline characters
79+
fieldName = fieldName.replace(/\n/g, '\\n');
80+
// Escape .[]\
81+
fieldName = fieldName.replace(/([\.|\[|\]|\\])/g, '\\$1');
82+
83+
return fieldName;
6784
}
6885

6986
type VegaValue = Record<string, string | number>;

x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ export class HeadlessChromiumDriver {
180180
captureBeyondViewport: false, // workaround for an internal resize. See: https://github.com/puppeteer/puppeteer/issues/7043
181181
});
182182

183-
if (Buffer.isBuffer(screenshot)) {
184-
return screenshot;
183+
if (screenshot.byteLength) {
184+
return Buffer.from(screenshot);
185185
}
186186

187187
if (typeof screenshot === 'string') {

0 commit comments

Comments
 (0)