Skip to content

Commit

Permalink
Merge branch 'main' into feature/add-category-option-for-context-menus
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Agrawal <[email protected]>
  • Loading branch information
lezzago authored Jun 5, 2023
2 parents 5da4b35 + 487cd36 commit 430cfef
Show file tree
Hide file tree
Showing 221 changed files with 5,602 additions and 11,327 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @ananzh @kavilla @seanneumann @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @kristenTian @zhongnansu @manasvinibs
* @ananzh @kavilla @seanneumann @AMoo-Miki @ashwin-pc @joshuarrrr @abbyhu2000 @zengyan-amazon @kristenTian @zhongnansu @manasvinibs @ZilongX @Flyingliuhub
25 changes: 5 additions & 20 deletions .github/workflows/build_and_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ env:
TEST_OPENSEARCH_TRANSPORT_PORT: 9403
TEST_OPENSEARCH_PORT: 9400
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true
# Version 112.0.5615.0
CHROME_VERSION: 1109208
NODE_OPTIONS: "--max-old-space-size=6144 --dns-result-order=ipv4first"

jobs:
build-lint-test:
name: Build and Verify on ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
Expand Down Expand Up @@ -137,22 +137,6 @@ jobs:
steps:
- run: echo Running functional tests for ciGroup${{ matrix.group }}

- name: Setup Chrome
id: setup-chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: ${{ env.CHROME_VERSION }}

- name: Set Chrome Path
if: matrix.os != 'windows-latest'
run: |
echo "TEST_BROWSER_BINARY_PATH=${{ steps.setup-chrome.outputs.chrome-path }}" >> $GITHUB_ENV
- name: Set Chrome Path (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "TEST_BROWSER_BINARY_PATH=${{ steps.setup-chrome.outputs.chrome-path }}" >> $env:GITHUB_ENV
- name: Configure git's autocrlf (Windows only)
if: matrix.os == 'windows-latest'
run: |
Expand Down Expand Up @@ -403,6 +387,7 @@ jobs:
with:
name: ${{ matrix.version }}-test-failures
path: |
./artifacts/bwc_tmp/test/cypress/videos/without-security/*
./artifacts/bwc_tmp/test/cypress/screenshots/without-security/*
./artifacts/bwc_tmp/test/cypress/videos/*
./artifacts/bwc_tmp/test/cypress/screenshots/*
./artifacts/bwc_tmp/test/cypress/results/*
retention-days: 1
7 changes: 5 additions & 2 deletions .github/workflows/cypress_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ env:
START_CMD: 'node ../scripts/opensearch_dashboards --dev --no-base-path --no-watch'
OPENSEARCH_SNAPSHOT_CMD: 'node ../scripts/opensearch snapshot'
SPEC: 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js,'
CYPRESS_ENV: 'env CYPRESS_VISBUILDER_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=false'
CYPRESS_BROWSER: 'chromium'
CYPRESS_VISBUILDER_ENABLED: true
CYPRESS_DATASOURCE_MANAGEMENT_ENABLED: false
OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true

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

# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"src/plugins/telemetry_management_section"
],
"tileMap": "src/plugins/tile_map",
"timeline": ["src/plugins/timeline", "src/plugins/vis_type_timeline"],
"timeline": ["src/plugins/vis_type_timeline"],
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/plugins/vis_default_editor",
"visTypeMarkdown": "src/plugins/vis_type_markdown",
Expand Down
1 change: 1 addition & 0 deletions .lycheeexclude
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ http://www.opensearch.org/painlessDocs
https://www.hostedgraphite.com/
https://connectionurl.com
http://169.254.169.254/latest/meta-data/
http://company.net/*

# External urls
https://www.zeek.org/
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.21.3
18.16.0
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.21.3
18.16.0
740 changes: 521 additions & 219 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NODE_VERSION=14.20.1
ARG NODE_VERSION=18.16.0
FROM node:${NODE_VERSION} AS base

ENV HOME '.'
Expand Down
7 changes: 0 additions & 7 deletions cypress/integration/with-security/check_advanced_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ describe('verify the advanced settings are saved', () => {
.should('eq', 'true');
});

it('the Timeline default columns field is set to 4', () => {
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').should(
'have.value',
4
);
});

it('the Timeline Maximum buckets field is set to 4', () => {
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').should(
'have.value',
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/with-security/helpers/generate_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ describe('Generating BWC test data with security', () => {
it('adds advanced settings', () => {
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click();
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type(
'{selectAll}4'
);
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type(
'{selectAll}4'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ describe('verify the advanced settings are saved', () => {
.should('eq', 'true');
});

it('the Timeline default columns field is set to 4', () => {
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').should(
'have.value',
4
);
});

it('the Timeline Maximum buckets field is set to 4', () => {
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').should(
'have.value',
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/without-security/helpers/generate_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ describe('Generating BWC test data without security', () => {
it('adds advanced settings', () => {
miscUtils.visitPage('app/management/opensearch-dashboards/settings');
cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click();
cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type(
'{selectAll}4'
);
cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type(
'{selectAll}4'
);
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"test:jest:ci": "scripts/use_node scripts/jest --ci --colors --runInBand",
"test:jest:ci:coverage": "scripts/use_node scripts/jest --ci --colors --runInBand --coverage",
"test:jest_integration": "scripts/use_node scripts/jest_integration",
"test:jest_integration:ci": "scripts/use_node scripts/jest_integration --ci --colors --max-old-space-size=5120",
"test:jest_integration:ci": "scripts/use_node scripts/jest_integration --ci --colors",
"test:mocha": "scripts/use_node scripts/mocha",
"test:mocha:coverage": "yarn nyc --reporter=text-summary --reporter=lcov --report-dir=./target/opensearch-dashboards-coverage/mocha scripts/use_node scripts/mocha",
"test:ftr": "scripts/use_node scripts/functional_tests",
Expand Down Expand Up @@ -81,7 +81,7 @@
"url": "https://github.com/opensearch-project/opensearch-dashboards.git"
},
"resolutions": {
"**/@types/node": "^14.17.32",
"**/@types/node": "~18.7.0",
"**/ansi-regex": "^5.0.1",
"**/async": "^3.2.3",
"**/d3-color": "^3.1.0",
Expand All @@ -97,6 +97,7 @@
"**/unset-value": "^2.0.1",
"**/jest-config": "npm:@amoo-miki/[email protected]",
"**/jest-jasmine2": "npm:@amoo-miki/[email protected]",
"**/set-value": "^4.1.0",
"**/xml2js": "^0.5.0",
"**/yaml": "^2.2.2"
},
Expand Down Expand Up @@ -167,7 +168,7 @@
"deep-freeze-strict": "^1.1.1",
"del": "^6.1.1",
"dns-sync": "^0.2.1",
"elastic-apm-node": "^3.7.0",
"elastic-apm-node": "^3.43.0",
"elasticsearch": "^16.7.0",
"http-aws-es": "npm:@zhongnansu/[email protected]",
"execa": "^4.0.2",
Expand All @@ -177,7 +178,7 @@
"getos": "^3.2.1",
"glob": "^7.1.7",
"glob-all": "^3.2.1",
"globby": "^8.0.1",
"globby": "^11.1.0",
"handlebars": "4.7.7",
"hjson": "3.2.1",
"http-proxy-agent": "^2.1.0",
Expand Down Expand Up @@ -211,6 +212,7 @@
"rison-node": "1.0.2",
"rxjs": "^6.5.5",
"semver": "^5.7.0",
"set-value": "^4.1.0",
"source-map-support": "^0.5.19",
"symbol-observable": "^1.2.0",
"tar": "^6.1.11",
Expand Down Expand Up @@ -301,7 +303,7 @@
"@types/mock-fs": "^4.10.0",
"@types/moment-timezone": "^0.5.12",
"@types/mustache": "^0.8.31",
"@types/node": "^14.17.32",
"@types/node": "~18.7.0",
"@types/node-forge": "^1.0.1",
"@types/normalize-path": "^3.0.0",
"@types/pegjs": "^0.10.1",
Expand Down Expand Up @@ -342,7 +344,6 @@
"angular-mocks": "^1.8.2",
"angular-recursion": "^1.0.5",
"angular-route": "^1.8.0",
"angular-sortable-view": "^0.0.17",
"archiver": "^5.3.0",
"axe-core": "^4.0.2",
"babel-eslint": "^10.0.3",
Expand Down Expand Up @@ -396,7 +397,7 @@
"immer": "^9.0.6",
"intl-messageformat-parser": "^1.4.0",
"jest": "^27.5.1",
"jest-canvas-mock": "^2.3.1",
"jest-canvas-mock": "^2.5.1",
"jest-raw-loader": "^1.0.1",
"jimp": "^0.14.0",
"jquery": "^3.5.0",
Expand Down Expand Up @@ -468,7 +469,7 @@
"zlib": "^1.0.5"
},
"engines": {
"node": "^14.20.1",
"node": ">=14.20.1 <19",
"yarn": "^1.22.10"
}
}
2 changes: 1 addition & 1 deletion packages/osd-ace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@osd/babel-preset": "1.0.0",
"raw-loader": "^4.0.2",
"typescript": "4.0.2",
"webpack": "^4.41.5"
"webpack": "npm:@amoo-miki/[email protected]"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions packages/osd-config-schema/src/errors/schema_error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ import { SchemaError } from '.';

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

// ToDo: Remove this logic when Node 14 support is removed
const isNode14 = process.version.startsWith('v14.');

/**
* Make all paths in stacktrace relative.
*/
export const cleanStack = (stack: string) =>
stack
export const cleanStack = (stack: string) => {
const result = stack
.split('\n')
.filter((line) => !line.includes('node_modules' + sep) && !line.includes('internal/'))
.map((line) => {
Expand All @@ -54,6 +57,11 @@ export const cleanStack = (stack: string) =>
})
.join('\n');

return isNode14
? result.replace(/Error:\s([^\n]+)\n\s*at new ([^ ]+) [^\n]*\n/, '$2: $1\n')
: result;
};

it('includes stack', () => {
try {
throw new SchemaError('test');
Expand Down
1 change: 1 addition & 0 deletions packages/osd-config-schema/src/errors/schema_error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class SchemaError extends Error {
constructor(message: string, cause?: Error) {
super(message);
this.cause = cause;
this.name = this.constructor.name;

// Set the prototype explicitly, see:
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
Expand Down
18 changes: 9 additions & 9 deletions packages/osd-config/src/config_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ test('throws if config at path does not match schema', async () => {
);

await expect(valuesReceived).toMatchInlineSnapshot(`
Array [
[Error: [config validation of [key]]: expected value of type [string] but got [number]],
]
`);
Array [
[ValidationError: [config validation of [key]]: expected value of type [string] but got [number]],
]
`);
});

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

await expect(valuesReceived).toMatchInlineSnapshot(`
Array [
"value",
[Error: [config validation of [key]]: expected value of type [string] but got [number]],
]
`);
Array [
"value",
[ValidationError: [config validation of [key]]: expected value of type [string] but got [number]],
]
`);
});

test("returns undefined if fetching optional config at a path that doesn't exist", async () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/osd-cross-platform/src/path.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import path from 'path';
import fs from 'fs';
import { access, rmdir, mkdir, writeFile, symlink } from 'fs/promises';
import { access, rm, mkdir, writeFile, symlink } from 'fs/promises';

import {
resolveToFullNameSync,
Expand Down Expand Up @@ -43,9 +43,9 @@ describe('Cross Platform', () => {
try {
// If leftover artifacts were found, get rid of them
await access(tmpTestFolder);
await rmdir(tmpTestFolder, { recursive: true });
await rm(tmpTestFolder, { recursive: true });
} catch (ex) {
// Do nothing; if `rmdir` failed, let the `mkdir` below throw the error
// Do nothing; if `rm` failed, let the `mkdir` below throw the error
}

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

afterAll(async () => {
try {
await rmdir(tmpTestFolder, { recursive: true });
await rm(tmpTestFolder, { recursive: true });
} catch (ex) {
// Do nothing
}
Expand Down
2 changes: 1 addition & 1 deletion packages/osd-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"execa": "^4.0.2",
"exit-hook": "^2.2.0",
"getopts": "^2.2.5",
"globby": "^8.0.1",
"globby": "^11.1.0",
"load-json-file": "^6.2.0",
"markdown-it": "^12.3.2",
"moment": "^2.24.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/osd-dev-utils/src/proc_runner/proc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
await withTimeout(
async () => {
log.debug(`Sending "${signal}" to proc "${name}"`);
await treeKillAsync(childProcess.pid, signal);
await treeKillAsync(childProcess.pid!, signal);
await outcomePromise;
},
STOP_TIMEOUT,
async () => {
log.warning(
`Proc "${name}" was sent "${signal}" didn't emit the "exit" or "error" events after ${STOP_TIMEOUT} ms, sending SIGKILL`
);
await treeKillAsync(childProcess.pid, 'SIGKILL');
await treeKillAsync(childProcess.pid!, 'SIGKILL');
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export function createAbsolutePathSerializer(
) {
const rootPaths = Array.isArray(rootPath) ? rootPath : [rootPath];

if (process.platform === 'win32') {
rootPaths.push(...rootPaths.map((name) => name.replace(/\\/g, '/')));
}

return {
test: (value: any) =>
typeof value === 'string' && rootPaths.some((path) => value.startsWith(path)),
Expand Down
1 change: 1 addition & 0 deletions packages/osd-dev-utils/src/serializers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ export * from './strip_ansi_serializer';
export * from './recursive_serializer';
export * from './any_instance_serizlizer';
export * from './replace_serializer';
export * from './strip_promises_serizlizer';
Loading

0 comments on commit 430cfef

Please sign in to comment.