Skip to content

Commit 430cfef

Browse files
authored
Merge branch 'main' into feature/add-category-option-for-context-menus
Signed-off-by: Ashish Agrawal <ashish81394@gmail.com>
2 parents 5da4b35 + 487cd36 commit 430cfef

File tree

221 files changed

+5602
-11327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+5602
-11327
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @ananzh @kavilla @seanneumann @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @kristenTian @zhongnansu @manasvinibs
1+
* @ananzh @kavilla @seanneumann @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @kristenTian @zhongnansu @manasvinibs @ZilongX @Flyingliuhub

.github/workflows/build_and_test_workflow.yml

+5-20
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ env:
2525
TEST_OPENSEARCH_TRANSPORT_PORT: 9403
2626
TEST_OPENSEARCH_PORT: 9400
2727
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
28-
# Version 112.0.5615.0
29-
CHROME_VERSION: 1109208
28+
NODE_OPTIONS: "--max-old-space-size=6144 --dns-result-order=ipv4first"
3029

3130
jobs:
3231
build-lint-test:
3332
name: Build and Verify on ${{ matrix.name }}
3433
strategy:
34+
fail-fast: false
3535
matrix:
3636
os: [ubuntu-latest, windows-latest]
3737
include:
@@ -137,22 +137,6 @@ jobs:
137137
steps:
138138
- run: echo Running functional tests for ciGroup${{ matrix.group }}
139139

140-
- name: Setup Chrome
141-
id: setup-chrome
142-
uses: browser-actions/setup-chrome@v1
143-
with:
144-
chrome-version: ${{ env.CHROME_VERSION }}
145-
146-
- name: Set Chrome Path
147-
if: matrix.os != 'windows-latest'
148-
run: |
149-
echo "TEST_BROWSER_BINARY_PATH=${{ steps.setup-chrome.outputs.chrome-path }}" >> $GITHUB_ENV
150-
151-
- name: Set Chrome Path (Windows)
152-
if: matrix.os == 'windows-latest'
153-
run: |
154-
echo "TEST_BROWSER_BINARY_PATH=${{ steps.setup-chrome.outputs.chrome-path }}" >> $env:GITHUB_ENV
155-
156140
- name: Configure git's autocrlf (Windows only)
157141
if: matrix.os == 'windows-latest'
158142
run: |
@@ -403,6 +387,7 @@ jobs:
403387
with:
404388
name: ${{ matrix.version }}-test-failures
405389
path: |
406-
./artifacts/bwc_tmp/test/cypress/videos/without-security/*
407-
./artifacts/bwc_tmp/test/cypress/screenshots/without-security/*
390+
./artifacts/bwc_tmp/test/cypress/videos/*
391+
./artifacts/bwc_tmp/test/cypress/screenshots/*
392+
./artifacts/bwc_tmp/test/cypress/results/*
408393
retention-days: 1

.github/workflows/cypress_workflow.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ env:
1212
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch'
1313
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot'
1414
SPEC: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,'
15-
CYPRESS_ENV: 'env CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=false'
15+
CYPRESS_BROWSER: 'chromium'
16+
CYPRESS_VISBUILDER_ENABLED: true
17+
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
18+
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
1619

1720
jobs:
1821
cypress-tests:
@@ -76,7 +79,7 @@ jobs:
7679
working-directory: ${{ env.FTR_PATH }}
7780
start: ${{ env.OPENSEARCH_SNAPSHOT_CMD }}, ${{ env.START_CMD }}
7881
wait-on: 'http://localhost:9200, http://localhost:5601'
79-
command: ${{ env.CYPRESS_ENV }} yarn cypress:run-without-security --browser chromium --spec ${{ env.SPEC }}
82+
command: yarn cypress:run-without-security --browser ${{ env.CYPRESS_BROWSER }} --spec ${{ env.SPEC }}
8083

8184
# Screenshots are only captured on failure, will change this once we do visual regression tests
8285
- uses: actions/upload-artifact@v3

.i18nrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"src/plugins/telemetry_management_section"
4949
],
5050
"tileMap": "src/plugins/tile_map",
51-
"timeline": ["src/plugins/timeline", "src/plugins/vis_type_timeline"],
51+
"timeline": ["src/plugins/vis_type_timeline"],
5252
"uiActions": "src/plugins/ui_actions",
5353
"visDefaultEditor": "src/plugins/vis_default_editor",
5454
"visTypeMarkdown": "src/plugins/vis_type_markdown",

.lycheeexclude

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ http://www.opensearch.org/painlessDocs
8989
https://www.hostedgraphite.com/
9090
https://connectionurl.com
9191
http://169.254.169.254/latest/meta-data/
92+
http://company.net/*
9293

9394
# External urls
9495
https://www.zeek.org/

.node-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.21.3
1+
18.16.0

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.21.3
1+
18.16.0

CHANGELOG.md

+521-219
Large diffs are not rendered by default.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG NODE_VERSION=14.20.1
1+
ARG NODE_VERSION=18.16.0
22
FROM node:${NODE_VERSION} AS base
33

44
ENV HOME '.'

cypress/integration/with-security/check_advanced_settings.js

-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ describe('verify the advanced settings are saved', () => {
2525
.should('eq', 'true');
2626
});
2727

28-
it('the Timeline default columns field is set to 4', () => {
29-
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').should(
30-
'have.value',
31-
4
32-
);
33-
});
34-
3528
it('the Timeline Maximum buckets field is set to 4', () => {
3629
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').should(
3730
'have.value',

cypress/integration/with-security/helpers/generate_data.js

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ describe('Generating BWC test data with security', () => {
3131
it('adds advanced settings', () => {
3232
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
3333
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click();
34-
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type(
35-
'{selectAll}4'
36-
);
3734
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type(
3835
'{selectAll}4'
3936
);

cypress/integration/without-security/check_advanced_settings.js

-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ describe('verify the advanced settings are saved', () => {
1818
.should('eq', 'true');
1919
});
2020

21-
it('the Timeline default columns field is set to 4', () => {
22-
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').should(
23-
'have.value',
24-
4
25-
);
26-
});
27-
2821
it('the Timeline Maximum buckets field is set to 4', () => {
2922
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').should(
3023
'have.value',

cypress/integration/without-security/helpers/generate_data.js

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ describe('Generating BWC test data without security', () => {
1414
it('adds advanced settings', () => {
1515
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
1616
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click();
17-
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type(
18-
'{selectAll}4'
19-
);
2017
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type(
2118
'{selectAll}4'
2219
);

package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"test:jest:ci": "scripts/use_node scripts/jest --ci --colors --runInBand",
5050
"test:jest:ci:coverage": "scripts/use_node scripts/jest --ci --colors --runInBand --coverage",
5151
"test:jest_integration": "scripts/use_node scripts/jest_integration",
52-
"test:jest_integration:ci": "scripts/use_node scripts/jest_integration --ci --colors --max-old-space-size=5120",
52+
"test:jest_integration:ci": "scripts/use_node scripts/jest_integration --ci --colors",
5353
"test:mocha": "scripts/use_node scripts/mocha",
5454
"test:mocha:coverage": "yarn nyc --reporter=text-summary --reporter=lcov --report-dir=./target/opensearch-dashboards-coverage/mocha scripts/use_node scripts/mocha",
5555
"test:ftr": "scripts/use_node scripts/functional_tests",
@@ -81,7 +81,7 @@
8181
"url": "https://github.com/opensearch-project/opensearch-dashboards.git"
8282
},
8383
"resolutions": {
84-
"**/@types/node": "^14.17.32",
84+
"**/@types/node": "~18.7.0",
8585
"**/ansi-regex": "^5.0.1",
8686
"**/async": "^3.2.3",
8787
"**/d3-color": "^3.1.0",
@@ -97,6 +97,7 @@
9797
"**/unset-value": "^2.0.1",
9898
"**/jest-config": "npm:@amoo-miki/jest-config@27.5.1",
9999
"**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@27.5.1",
100+
"**/set-value": "^4.1.0",
100101
"**/xml2js": "^0.5.0",
101102
"**/yaml": "^2.2.2"
102103
},
@@ -167,7 +168,7 @@
167168
"deep-freeze-strict": "^1.1.1",
168169
"del": "^6.1.1",
169170
"dns-sync": "^0.2.1",
170-
"elastic-apm-node": "^3.7.0",
171+
"elastic-apm-node": "^3.43.0",
171172
"elasticsearch": "^16.7.0",
172173
"http-aws-es": "npm:@zhongnansu/http-aws-es@6.0.1",
173174
"execa": "^4.0.2",
@@ -177,7 +178,7 @@
177178
"getos": "^3.2.1",
178179
"glob": "^7.1.7",
179180
"glob-all": "^3.2.1",
180-
"globby": "^8.0.1",
181+
"globby": "^11.1.0",
181182
"handlebars": "4.7.7",
182183
"hjson": "3.2.1",
183184
"http-proxy-agent": "^2.1.0",
@@ -211,6 +212,7 @@
211212
"rison-node": "1.0.2",
212213
"rxjs": "^6.5.5",
213214
"semver": "^5.7.0",
215+
"set-value": "^4.1.0",
214216
"source-map-support": "^0.5.19",
215217
"symbol-observable": "^1.2.0",
216218
"tar": "^6.1.11",
@@ -301,7 +303,7 @@
301303
"@types/mock-fs": "^4.10.0",
302304
"@types/moment-timezone": "^0.5.12",
303305
"@types/mustache": "^0.8.31",
304-
"@types/node": "^14.17.32",
306+
"@types/node": "~18.7.0",
305307
"@types/node-forge": "^1.0.1",
306308
"@types/normalize-path": "^3.0.0",
307309
"@types/pegjs": "^0.10.1",
@@ -342,7 +344,6 @@
342344
"angular-mocks": "^1.8.2",
343345
"angular-recursion": "^1.0.5",
344346
"angular-route": "^1.8.0",
345-
"angular-sortable-view": "^0.0.17",
346347
"archiver": "^5.3.0",
347348
"axe-core": "^4.0.2",
348349
"babel-eslint": "^10.0.3",
@@ -396,7 +397,7 @@
396397
"immer": "^9.0.6",
397398
"intl-messageformat-parser": "^1.4.0",
398399
"jest": "^27.5.1",
399-
"jest-canvas-mock": "^2.3.1",
400+
"jest-canvas-mock": "^2.5.1",
400401
"jest-raw-loader": "^1.0.1",
401402
"jimp": "^0.14.0",
402403
"jquery": "^3.5.0",
@@ -468,7 +469,7 @@
468469
"zlib": "^1.0.5"
469470
},
470471
"engines": {
471-
"node": "^14.20.1",
472+
"node": ">=14.20.1 <19",
472473
"yarn": "^1.22.10"
473474
}
474475
}

packages/osd-ace/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"@osd/babel-preset": "1.0.0",
1717
"raw-loader": "^4.0.2",
1818
"typescript": "4.0.2",
19-
"webpack": "^4.41.5"
19+
"webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2"
2020
}
2121
}

packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap

+2-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/osd-config-schema/src/errors/schema_error.test.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ import { SchemaError } from '.';
3333

3434
import { standardize, getRepoRoot } from '@osd/cross-platform';
3535

36+
// ToDo: Remove this logic when Node 14 support is removed
37+
const isNode14 = process.version.startsWith('v14.');
38+
3639
/**
3740
* Make all paths in stacktrace relative.
3841
*/
39-
export const cleanStack = (stack: string) =>
40-
stack
42+
export const cleanStack = (stack: string) => {
43+
const result = stack
4144
.split('\n')
4245
.filter((line) => !line.includes('node_modules' + sep) && !line.includes('internal/'))
4346
.map((line) => {
@@ -54,6 +57,11 @@ export const cleanStack = (stack: string) =>
5457
})
5558
.join('\n');
5659

60+
return isNode14
61+
? result.replace(/Error:\s([^\n]+)\n\s*at new ([^ ]+) [^\n]*\n/, '$2: $1\n')
62+
: result;
63+
};
64+
5765
it('includes stack', () => {
5866
try {
5967
throw new SchemaError('test');

packages/osd-config-schema/src/errors/schema_error.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class SchemaError extends Error {
3434
constructor(message: string, cause?: Error) {
3535
super(message);
3636
this.cause = cause;
37+
this.name = this.constructor.name;
3738

3839
// Set the prototype explicitly, see:
3940
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work

packages/osd-config/src/config_service.test.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ test('throws if config at path does not match schema', async () => {
9494
);
9595

9696
await expect(valuesReceived).toMatchInlineSnapshot(`
97-
Array [
98-
[Error: [config validation of [key]]: expected value of type [string] but got [number]],
99-
]
100-
`);
97+
Array [
98+
[ValidationError: [config validation of [key]]: expected value of type [string] but got [number]],
99+
]
100+
`);
101101
});
102102

103103
test('re-validate config when updated', async () => {
@@ -120,11 +120,11 @@ test('re-validate config when updated', async () => {
120120
rawConfig$.next({ key: 123 });
121121

122122
await expect(valuesReceived).toMatchInlineSnapshot(`
123-
Array [
124-
"value",
125-
[Error: [config validation of [key]]: expected value of type [string] but got [number]],
126-
]
127-
`);
123+
Array [
124+
"value",
125+
[ValidationError: [config validation of [key]]: expected value of type [string] but got [number]],
126+
]
127+
`);
128128
});
129129

130130
test("returns undefined if fetching optional config at a path that doesn't exist", async () => {

packages/osd-cross-platform/src/path.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import path from 'path';
77
import fs from 'fs';
8-
import { access, rmdir, mkdir, writeFile, symlink } from 'fs/promises';
8+
import { access, rm, mkdir, writeFile, symlink } from 'fs/promises';
99

1010
import {
1111
resolveToFullNameSync,
@@ -43,9 +43,9 @@ describe('Cross Platform', () => {
4343
try {
4444
// If leftover artifacts were found, get rid of them
4545
await access(tmpTestFolder);
46-
await rmdir(tmpTestFolder, { recursive: true });
46+
await rm(tmpTestFolder, { recursive: true });
4747
} catch (ex) {
48-
// Do nothing; if `rmdir` failed, let the `mkdir` below throw the error
48+
// Do nothing; if `rm` failed, let the `mkdir` below throw the error
4949
}
5050

5151
await mkdir(tmpTestFolder);
@@ -60,7 +60,7 @@ describe('Cross Platform', () => {
6060

6161
afterAll(async () => {
6262
try {
63-
await rmdir(tmpTestFolder, { recursive: true });
63+
await rm(tmpTestFolder, { recursive: true });
6464
} catch (ex) {
6565
// Do nothing
6666
}

packages/osd-dev-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"execa": "^4.0.2",
2323
"exit-hook": "^2.2.0",
2424
"getopts": "^2.2.5",
25-
"globby": "^8.0.1",
25+
"globby": "^11.1.0",
2626
"load-json-file": "^6.2.0",
2727
"markdown-it": "^12.3.2",
2828
"moment": "^2.24.0",

packages/osd-dev-utils/src/proc_runner/proc.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
153153
await withTimeout(
154154
async () => {
155155
log.debug(`Sending "${signal}" to proc "${name}"`);
156-
await treeKillAsync(childProcess.pid, signal);
156+
await treeKillAsync(childProcess.pid!, signal);
157157
await outcomePromise;
158158
},
159159
STOP_TIMEOUT,
160160
async () => {
161161
log.warning(
162162
`Proc "${name}" was sent "${signal}" didn't emit the "exit" or "error" events after ${STOP_TIMEOUT} ms, sending SIGKILL`
163163
);
164-
await treeKillAsync(childProcess.pid, 'SIGKILL');
164+
await treeKillAsync(childProcess.pid!, 'SIGKILL');
165165
}
166166
);
167167

packages/osd-dev-utils/src/serializers/absolute_path_serializer.ts

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export function createAbsolutePathSerializer(
3737
) {
3838
const rootPaths = Array.isArray(rootPath) ? rootPath : [rootPath];
3939

40+
if (process.platform === 'win32') {
41+
rootPaths.push(...rootPaths.map((name) => name.replace(/\\/g, '/')));
42+
}
43+
4044
return {
4145
test: (value: any) =>
4246
typeof value === 'string' && rootPaths.some((path) => value.startsWith(path)),

packages/osd-dev-utils/src/serializers/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ export * from './strip_ansi_serializer';
3333
export * from './recursive_serializer';
3434
export * from './any_instance_serizlizer';
3535
export * from './replace_serializer';
36+
export * from './strip_promises_serizlizer';

0 commit comments

Comments
 (0)