diff --git a/.eslintignore b/.eslintignore index a495516fd869..f25ea426cf26 100644 --- a/.eslintignore +++ b/.eslintignore @@ -31,5 +31,4 @@ target /packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/ /packages/osd-ui-framework/dist /packages/osd-ui-framework/doc_site/build -/packages/osd-ui-framework/generator-kui/*/templates/ /packages/osd-ui-shared-deps/flot_charts diff --git a/.eslintrc.js b/.eslintrc.js index 63ea02147000..b2e07ec15724 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -81,14 +81,6 @@ const APACHE_2_0_LICENSE_HEADER = ` */ `; -const ELASTIC_LICENSE_HEADER = ` -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -`; - const SAFER_LODASH_SET_HEADER = ` /* * Elasticsearch B.V licenses this file to you under the MIT License. @@ -171,7 +163,6 @@ module.exports = { 'error', { licenses: [ - ELASTIC_LICENSE_HEADER, SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_LODASH_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, @@ -207,7 +198,6 @@ module.exports = { 'error', { licenses: [ - ELASTIC_LICENSE_HEADER, APACHE_2_0_LICENSE_HEADER, SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, @@ -230,7 +220,6 @@ module.exports = { { licenses: [ OSS_HEADER, - ELASTIC_LICENSE_HEADER, APACHE_2_0_LICENSE_HEADER, SAFER_LODASH_SET_LODASH_HEADER, SAFER_LODASH_SET_DEFINITELYTYPED_HEADER, @@ -254,7 +243,6 @@ module.exports = { { licenses: [ OSS_HEADER, - ELASTIC_LICENSE_HEADER, APACHE_2_0_LICENSE_HEADER, SAFER_LODASH_SET_HEADER, SAFER_LODASH_SET_LODASH_HEADER, @@ -388,7 +376,6 @@ module.exports = { */ { files: [ - '**/*.stories.tsx', 'test/*/config.ts', 'test/*/config_open.ts', 'test/*/{tests,test_suites,apis,apps}/**/*', @@ -447,7 +434,6 @@ module.exports = { files: [ 'packages/osd-ui-framework/**/*.test.js', 'packages/osd-ui-framework/doc_site/**/*.js', - 'packages/osd-ui-framework/generator-kui/**/*.js', 'packages/osd-ui-framework/Gruntfile.js', 'packages/osd-opensearch/src/**/*.js', 'packages/osd-interpreter/tasks/**/*.js', diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 8dfac58be91d..84a5aaaacedf 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,6 +7,8 @@ ### Check List - [ ] New functionality includes testing. - [ ] All tests pass + - [ ] `yarn test:jest` + - [ ] `yarn test:jest_integration` + - [ ] `yarn test:ftr` - [ ] New functionality has been documented. - - [ ] New functionality has javadoc added - [ ] Commits are signed per the DCO using --signoff \ No newline at end of file diff --git a/.github/workflows/links_checker.yml b/.github/workflows/links_checker.yml new file mode 100644 index 000000000000..c02921d96f91 --- /dev/null +++ b/.github/workflows/links_checker.yml @@ -0,0 +1,31 @@ +# Copyright OpenSearch Contributors +# SPDX-License-Identifier: Apache-2.0 + +name: Link Checker + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + linkchecker: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Load Excludes + run: | + LYCHEE_EXCLUDE=$(sed -e :a -e 'N;s/\n/ --exclude /;ta' .lycheeexclude) + echo "LYCHEE_EXCLUDE=$LYCHEE_EXCLUDE" >> $GITHUB_ENV + - name: Lychee Link Checker + id: lychee + uses: lycheeverse/lychee-action@v1.0.9 + with: + args: --accept=200,403,429 --exclude ${{ env.LYCHEE_EXCLUDE }} --exclude-mail "**/*.html" "**/*.md" "**/*.txt" "**/*.json" "**/*.js" "**/*.ts" "**/*.tsx" + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Fail if there were link errors + run: exit ${{ steps.lychee.outputs.exit_code }} \ No newline at end of file diff --git a/.github/workflows/pr_check_workflow.yml b/.github/workflows/pr_check_workflow.yml index 40f98d2f3042..a7f36b24d478 100644 --- a/.github/workflows/pr_check_workflow.yml +++ b/.github/workflows/pr_check_workflow.yml @@ -1,25 +1,213 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: Build and test +# trigger on every commit push and PR for all branches except feature branches on: push: - branches: [ main ] + branches: [ '**', '!feature/**' ] pull_request: - branches: [ main ] + branches: [ '**', '!feature/**' ] -jobs: - build: +env: + CACHE_NAME: osd-node-modules + TEST_BROWSER_HEADLESS: 1 + CI: 1 + GCS_UPLOAD_PREFIX: fake + TEST_OPENSEARCH_DASHBOARDS_HOST: localhost + TEST_OPENSEARCH_DASHBOARDS_PORT: 6610 + TEST_OPENSEARCH_TRANSPORT_PORT: 9403 + TEST_OPENSEARCH_PORT: 9400 + OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true +jobs: + build-lint-test: runs-on: ubuntu-latest + name: Build and Verify + steps: + # Access a cache of set results from a previous run of the job + # This is to prevent re-running steps that were already successful since it is not native to github actions + # Can be used to verify flaky steps with reduced times + - name: Restore the cached run + uses: actions/cache@v2 + with: + path: | + job_successful + linter_results + unit_tests_results + integration_tests_results + key: ${{ github.run_id }}-${{ github.job }}-${{ github.sha }} + restore-keys: | + ${{ github.run_id }}-${{ github.job }}-${{ github.sha }} + + - name: Get if previous job was successful + id: job_successful + run: cat job_successful 2>/dev/null || echo 'false' + + - name: Get the previous linter results + id: linter_results + run: cat linter_results 2>/dev/null || echo 'default' + + - name: Get the previous unit tests results + id: unit_tests_results + run: cat unit_tests_results 2>/dev/null || echo 'default' + + - name: Get the previous integration tests results + id: integration_tests_results + run: cat integration_tests_results 2>/dev/null || echo 'default' + + - name: Checkout code + if: steps.job_successful.outputs.job_successful != 'true' + uses: actions/checkout@v2 + + - name: Setup Node + if: steps.job_successful.outputs.job_successful != 'true' + uses: actions/setup-node@v2 + with: + node-version-file: ".nvmrc" + registry-url: 'https://registry.npmjs.org' + + - name: Setup Yarn + if: steps.job_successful.outputs.job_successful != 'true' + run: | + npm uninstall -g yarn + npm i -g yarn@1.22.10 + + - name: Run bootstrap + if: steps.job_successful.outputs.job_successful != 'true' + run: yarn osd bootstrap + + - name: Run linter + if: steps.linter_results.outputs.linter_results != 'success' + id: linter + run: yarn lint + + # Runs unit tests while limiting workers because github actions will spawn more than it can handle and crash + # Continues on error but will create a comment on the pull request if this step failed. + - name: Run unit tests + if: steps.unit_tests_results.outputs.unit_tests_results != 'success' + id: unit-tests + continue-on-error: true + run: node scripts/jest --ci --colors --maxWorkers=10 + env: + SKIP_BAD_APPLES: true + + - run: echo Unit tests completed unsuccessfully. However, unit tests are inconsistent on the CI so please verify locally with `yarn test:jest`. + if: steps.unit_tests_results.outputs.unit_tests_results != 'success' && steps.unit-tests.outcome != 'success' + + # TODO: This gets rejected, we need approval to add this + # - name: Add comment if unit tests did not succeed + # if: steps.unit_tests_results.outputs.unit_tests_results != 'success' && steps.unit-tests.outcome != 'success' + # uses: actions/github-script@v5 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # script: | + # github.rest.issues.createComment({ + # issue_number: context.issue.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: 'Unit tests completed unsuccessfully. However, unit tests are inconsistent on the CI so please verify locally with `yarn test:jest`.' + # }) + - name: Run integration tests + if: steps.integration_tests_results.outputs.integration_tests_results != 'success' + id: integration-tests + run: node scripts/jest_integration --ci --colors --max-old-space-size=5120 + + # Set cache if linter, unit tests, and integration tests were successful then the job will be marked successful + # Sets individual results to empower re-runs of the same build without re-running successful steps. + - if: | + (steps.linter.outcome == 'success' || steps.linter.outcome == 'skipped') && + (steps.unit-tests.outcome == 'success' || steps.unit-tests.outcome == 'skipped') && + (steps.integration-tests.outcome == 'success' || steps.integration-tests.outcome == 'skipped') + run: echo "::set-output name=job_successful::true" > job_successful + - if: steps.linter.outcome == 'success' || steps.linter.outcome == 'skipped' + run: echo "::set-output name=linter_results::success" > linter_results + - if: steps.unit-tests.outcome == 'success' || steps.unit-tests.outcome == 'skipped' + run: echo "::set-output name=unit_tests_results::success" > unit_tests_results + - if: steps.integration-tests.outcome == 'success' || steps.integration-tests.outcome == 'skipped' + run: echo "::set-output name=integration_tests_results::success" > integration_tests_results + functional-tests: + needs: [ build-lint-test ] + runs-on: ubuntu-latest + name: Run functional tests + strategy: + matrix: + group: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ] steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v2 - with: - node-version: '10.24.1' - check-latest: false - - run: yarn osd bootstrap - - run: yarn lint + - run: echo Running functional tests for ciGroup${{ matrix.group }} + + # Access a cache of set results from a previous run of the job + # This is to prevent re-running a CI group that was already successful since it is not native to github actions + # Can be used to verify flaky steps with reduced times + - name: Restore the cached run + uses: actions/cache@v2 + with: + path: | + ftr_tests_results + key: ${{ github.run_id }}-${{ github.job }}-${{ matrix.group }}-${{ github.sha }} + restore-keys: | + ${{ github.run_id }}-${{ github.job }}-${{ matrix.group }}-${{ github.sha }} + + - name: Get the cached tests results + id: ftr_tests_results + run: cat ftr_tests_results 2>/dev/null || echo 'default' + + - name: Checkout code + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + uses: actions/checkout@v2 + + - name: Setup Node + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + uses: actions/setup-node@v2 + with: + node-version-file: ".nvmrc" + registry-url: 'https://registry.npmjs.org' + + - name: Setup Yarn + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + run: | + npm uninstall -g yarn + npm i -g yarn@1.22.10 + + - name: Get cache path + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + id: cache-path + run: echo "::set-output name=CACHE_DIR::$(yarn cache dir)" + + - name: Setup cache + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + uses: actions/cache@v2 + with: + path: ${{ steps.cache-path.outputs.CACHE_DIR }} + key: ${{ runner.os }}-yarn-${{ env.CACHE_NAME }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-${{ env.CACHE_NAME }}- + ${{ runner.os }}-yarn- + ${{ runner.os }}- + + # github virtual env is the latest chrome + - name: Setup chromedriver + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + run: yarn add --dev chromedriver@97.0.0 + + - name: Run bootstrap + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + run: yarn osd bootstrap + + - name: Build plugins + if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 + + - if: steps.ftr_tests_results.outputs.ftr_tests_results != 'success' + id: ftr-tests + run: node scripts/functional_tests.js --config test/functional/config.js --include ciGroup${{ matrix.group }} + env: + CI_GROUP: ciGroup${{ matrix.group }} + CI_PARALLEL_PROCESS_NUMBER: ciGroup${{ matrix.group }} + JOB: ci${{ matrix.group }} + CACHE_DIR: ciGroup${{ matrix.group }} + + - if: steps.ftr-tests.outcome == 'success' || steps.ftr-tests.outcome == 'skipped' + run: echo "::set-output name=ftr_tests_results::success" > ftr_tests_results diff --git a/.lycheeexclude b/.lycheeexclude new file mode 100644 index 000000000000..8fbbef27110e --- /dev/null +++ b/.lycheeexclude @@ -0,0 +1,115 @@ +# Copyright OpenSearch Contributors +# SPDX-License-Identifier: Apache-2.0 + +# Local or predefined end points +http://localhost +https://localhost +http://127.0.0.1/ +https://127.0.0.1/ +http://127.0.0.1:10002/bar +http://127.0.0.1:10002/ +http://opensearch +https://opensearch +https://opensearch-dashboards +http://opensearch-dashboards +https://opensearch.internal.org/ +https://maps.search-services.aws.a2z.com/ +https://tiles.maps.search-services.aws.a2z.com/ +https://telemetry.opensearch.org/ +https://telemetry-staging.opensearch.org/ +https://api.github.com/repos/opensearch-project/OpenSearch-Dashboards/ +file:///* +git://* + +# Dummy urls in tests +http://domain. +http://www.domain. +http://somehost +https://somehost +http://some.host +https://some-host.com/ +https://other.some-host.com/ +http://test:user@somehost/ +https://some.another.host/ +http://noone.nowhere.none/ +http://bar +http://foo +http://test.com/ +https://files.foobar/ +https://tiles.foobar/ +https://1.1.1.1:9200/ +http://192.168.1.1:1234/ +http://9.8.7.6/ +http://1.2.3.4/ +http://8.8.8.8/ +https://path.to/ +https://example.com/ +http://example.com/ +https://example.org/ +http://some-url/ +http://buildurl/ +https://dryrun/ +https://url/ +http://url/ +http://notfound.svg/ +https://validurl/ +https://myopensearch-dashboardsdomain.com +http://myopensearch-dashboardsdomain.com +https://other-opensearch-dashboards.external:8080/ +http://myotherdomain.com:5601/ +http://myopensearch-dashboardsdomain.com:5601/ +https://your-cdn-host.com/ +http://not-your-opensearch-dashboards.com/ +http://www.mysite.com/ +http://myserver.mydomain.com:5601/ +https://myexternaldep.com/ +http://notlocalhost/ +http://site.com/ +http://node-b/ +http://node-a:9200/ +https://node-c/ +https://elsewhere +https://opensearch:changeme@example.com:9200 +http://test:user@somehost/ +https://mycloudinstance:9200/ +https://dev-url.co/ +https://extenal.org/_search +http://plugins.example.com/ +https://build-url/ +http://test.com/ +https://path.to/ +http://site.com/ +http://not-your-opensearch-dashboards.com/ +http://evil.com/ +https://opensearch.org/cool/path +https://opensearch.org/redirect +http://www.opensearch.org/painlessDocs +https://opensearch.org/subscriptions +https://www.hostedgraphite.com/ + +# External urls +https://www.zeek.org/ +http://google.com/ +https://api.worldbank.org/ +https://vega.github.io/ +http://twitter.com/ +https://twitter.com/ +https://storage.googleapis.com/ +http://tools.ietf.org/ +https://github.com/ +http://github.com/ +http://jsperf +https://jsperf +https://gist.githubusercontent.com/ +https://nodejs.org/ +https://www.npmjs.com/ +https://microsoft.github.io/ +http://api.worldbank.org/ +https://f1542b814f674090afd914960583265f.apm.us-central1.gcp.cloud.es.io/ +http://www.matthewcopeland.me/ +http://threedubmedia.googlecode.com/* +https://developer.mozilla.org/ +https://a.tile.openstreetmap.org/ +http://www.creedthoughts.gov +https://media-for-the-masses.theacademyofperformingartsandscience.org/ +https://yarnpkg.com/latest.msi \ No newline at end of file diff --git a/.node-version b/.node-version index dc08cc7bd07a..ed9f5a0aff1d 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -10.24.1 +14.18.2 diff --git a/.nvmrc b/.nvmrc index dc08cc7bd07a..ed9f5a0aff1d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -10.24.1 +14.18.2 diff --git a/.whitesource b/.whitesource new file mode 100644 index 000000000000..7dd2131e7c7d --- /dev/null +++ b/.whitesource @@ -0,0 +1,15 @@ +{ + "scanSettings": { + "configMode": "LOCAL", + "configExternalURL": "", + "projectToken": "", + "baseBranches": [] + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + } +} \ No newline at end of file diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 6c3d15eb3d49..0b509b868546 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -1,4 +1,4 @@ -
+= Readonly< { [K in keyof OptionalProperties
]?: TypeOf
} & - { [K in keyof RequiredProperties
]: TypeOf
} + { + [K in keyof RequiredProperties
]: TypeOf
;
+ }
>;
type DefinedProperties
= Omit
&
- { [K in keyof DefinedProperties = ObjectType<
ExtendedProps
diff --git a/packages/osd-config-schema/src/types/stream_type.test.ts b/packages/osd-config-schema/src/types/stream_type.test.ts
index 89ca4d97347c..3081e3fcfb8c 100644
--- a/packages/osd-config-schema/src/types/stream_type.test.ts
+++ b/packages/osd-config-schema/src/types/stream_type.test.ts
@@ -70,7 +70,13 @@ test('includes namespace in failure', () => {
describe('#defaultValue', () => {
test('returns default when undefined', () => {
const value = new Stream();
- expect(schema.stream({ defaultValue: value }).validate(undefined)).toStrictEqual(value);
+ expect(schema.stream({ defaultValue: value }).validate(undefined)).toMatchInlineSnapshot(`
+ Stream {
+ "_events": Object {},
+ "_eventsCount": 0,
+ "_maxListeners": undefined,
+ }
+ `);
});
test('returns value when specified', () => {
diff --git a/packages/osd-dev-utils/certs/README.md b/packages/osd-dev-utils/certs/README.md
index 09eb027982c9..e19f41716ac1 100644
--- a/packages/osd-dev-utils/certs/README.md
+++ b/packages/osd-dev-utils/certs/README.md
@@ -28,7 +28,7 @@ The password used for both of these is "storepass". Other copies are also provid
## Certificate generation
-[OpenSearch cert-util](https://www.opensearch.org/guide/en/elasticsearch/reference/current/certutil.html) and [OpenSSL](https://www.openssl.org/) were used to generate these certificates. The following commands were used from the root directory of OpenSearch:
+[OpenSearch Self-signed Certificates](https://opensearch.org/docs/latest/security-plugin/configuration/generate-certificates/) and [OpenSSL](https://www.openssl.org/) were used to generate these certificates. The following commands were used from the root directory of OpenSearch:
```
# Generate the PKCS #12 keystore for a CA, valid for 50 years
diff --git a/packages/osd-dev-utils/package.json b/packages/osd-dev-utils/package.json
index 579d584c4fa1..3177d8b9fb59 100644
--- a/packages/osd-dev-utils/package.json
+++ b/packages/osd-dev-utils/package.json
@@ -13,7 +13,7 @@
"devOnly": true
},
"dependencies": {
- "@babel/core": "^7.11.6",
+ "@babel/core": "^7.16.5",
"@osd/utils": "1.0.0",
"axios": "^0.21.4",
"chalk": "^4.1.0",
@@ -24,7 +24,7 @@
"getopts": "^2.2.5",
"globby": "^8.0.1",
"load-json-file": "^6.2.0",
- "markdown-it": "^10.0.0",
+ "markdown-it": "^12.3.2",
"moment": "^2.24.0",
"normalize-path": "^3.0.0",
"rxjs": "^6.5.5",
diff --git a/packages/osd-dev-utils/src/proc_runner/proc.ts b/packages/osd-dev-utils/src/proc_runner/proc.ts
index 3bfb29c4646f..f563818b9d98 100644
--- a/packages/osd-dev-utils/src/proc_runner/proc.ts
+++ b/packages/osd-dev-utils/src/proc_runner/proc.ts
@@ -104,9 +104,9 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
});
if (stdin) {
- childProcess.stdin.end(stdin, 'utf8');
+ childProcess.stdin!.end(stdin, 'utf8');
} else {
- childProcess.stdin.end();
+ childProcess.stdin!.end();
}
let stopCalled = false;
@@ -136,8 +136,8 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {
).pipe(share());
const lines$ = Rx.merge(
- observeLines(childProcess.stdout),
- observeLines(childProcess.stderr)
+ observeLines(childProcess.stdout!),
+ observeLines(childProcess.stderr!)
).pipe(
tap((line) => log.write(` ${chalk.gray('proc')} [${chalk.gray(name)}] ${line}`)),
share()
diff --git a/packages/osd-dev-utils/src/tooling_log/__snapshots__/tooling_log_text_writer.test.ts.snap b/packages/osd-dev-utils/src/tooling_log/__snapshots__/tooling_log_text_writer.test.ts.snap
index 76c018fdb366..f5d084da6a4e 100644
--- a/packages/osd-dev-utils/src/tooling_log/__snapshots__/tooling_log_text_writer.test.ts.snap
+++ b/packages/osd-dev-utils/src/tooling_log/__snapshots__/tooling_log_text_writer.test.ts.snap
@@ -2,8 +2,7 @@
exports[`formats %s patterns and indents multi-line messages correctly 1`] = `
" │ [32msucc[39m foo bar
- │ { foo: { bar: { '1': [Array] } },
- │ bar: { bar: { '1': [Array] } } }
+ │ { foo: { bar: { '1': [Array] } }, bar: { bar: { '1': [Array] } } }
│
│ Infinity
"
diff --git a/packages/osd-i18n/package.json b/packages/osd-i18n/package.json
index 2935fa8eaaa6..e3acaba58604 100644
--- a/packages/osd-i18n/package.json
+++ b/packages/osd-i18n/package.json
@@ -12,8 +12,8 @@
"osd:watch": "node scripts/build --watch --source-maps"
},
"devDependencies": {
- "@babel/cli": "^7.14.5",
- "@babel/core": "^7.11.6",
+ "@babel/cli": "^7.16.0",
+ "@babel/core": "^7.16.5",
"@osd/babel-preset": "1.0.0",
"@osd/dev-utils": "1.0.0",
"@types/intl-relativeformat": "^2.1.0",
@@ -28,7 +28,7 @@
"intl-messageformat": "^2.2.0",
"intl-relativeformat": "^2.1.0",
"prop-types": "^15.7.2",
- "react": "^16.12.0",
+ "react": "^16.14.0",
"react-intl": "^2.8.0"
}
}
diff --git a/packages/osd-i18n/src/__snapshots__/loader.test.ts.snap b/packages/osd-i18n/src/__snapshots__/loader.test.ts.snap
index 05b3fd17a674..941d9fbf7d6a 100644
--- a/packages/osd-i18n/src/__snapshots__/loader.test.ts.snap
+++ b/packages/osd-i18n/src/__snapshots__/loader.test.ts.snap
@@ -2,4 +2,4 @@
exports[`I18n loader registerTranslationFile should throw error if path to translation file is not an absolute 1`] = `"Paths to translation files must be absolute. Got relative path: \\"./en.json\\""`;
-exports[`I18n loader registerTranslationFile should throw error if path to translation file is not specified 1`] = `"The \\"path\\" argument must be of type string. Received type undefined"`;
+exports[`I18n loader registerTranslationFile should throw error if path to translation file is not specified 1`] = `"The \\"path\\" argument must be of type string. Received undefined"`;
diff --git a/packages/osd-interpreter/package.json b/packages/osd-interpreter/package.json
index bc44ff47401d..101685976108 100644
--- a/packages/osd-interpreter/package.json
+++ b/packages/osd-interpreter/package.json
@@ -9,25 +9,25 @@
"osd:watch": "node scripts/build --dev --watch"
},
"dependencies": {
- "@babel/runtime": "^7.11.2",
+ "@babel/runtime": "^7.16.5",
"@osd/i18n": "1.0.0",
"lodash": "^4.17.21",
"uuid": "3.3.2"
},
"devDependencies": {
- "@babel/cli": "^7.14.5",
- "@babel/core": "^7.11.6",
- "@babel/plugin-transform-modules-commonjs": "^7.10.4",
- "@babel/plugin-transform-runtime": "^7.11.0",
+ "@babel/cli": "^7.16.0",
+ "@babel/core": "^7.16.5",
+ "@babel/plugin-transform-modules-commonjs": "^7.16.5",
+ "@babel/plugin-transform-runtime": "^7.16.5",
"@osd/babel-preset": "1.0.0",
"@osd/dev-utils": "1.0.0",
- "babel-loader": "^8.0.6",
+ "babel-loader": "^8.2.3",
"copy-webpack-plugin": "^6.0.2",
- "css-loader": "^3.4.2",
+ "css-loader": "^5.2.7",
"del": "^5.1.0",
"getopts": "^2.2.5",
"pegjs": "0.10.0",
- "sass-loader": "^8.0.2",
+ "sass-loader": "^10.2.0",
"style-loader": "^1.1.3",
"supports-color": "^7.0.0",
"url-loader": "^2.2.0",
diff --git a/packages/osd-logging/README.md b/packages/osd-logging/README.md
index b1f641039a36..022fbe392153 100644
--- a/packages/osd-logging/README.md
+++ b/packages/osd-logging/README.md
@@ -10,7 +10,7 @@ is still in `core` for now.
- [Log level](#log-level)
- [Layouts](#layouts)
-The way logging works in OpenSearch Dashboards is inspired by `log4j 2` logging framework used by [Elasticsearch](https://www.opensearch.org/guide/en/elasticsearch/reference/current/settings.html#logging).
+The way logging works in OpenSearch Dashboards is inspired by `log4j 2` logging framework used by [OpenSearch](https://opensearch.org/docs/latest/opensearch/logs/).
The main idea is to have consistent logging behaviour (configuration, log format etc.) across the entire Elastic Stack
where possible.
diff --git a/packages/osd-monaco/package.json b/packages/osd-monaco/package.json
index efdc58849e76..c51bc27efa7f 100644
--- a/packages/osd-monaco/package.json
+++ b/packages/osd-monaco/package.json
@@ -15,10 +15,10 @@
"devDependencies": {
"@osd/babel-preset": "1.0.0",
"@osd/dev-utils": "1.0.0",
- "babel-loader": "^8.0.6",
- "css-loader": "^3.4.2",
+ "babel-loader": "^8.2.3",
+ "css-loader": "^5.2.7",
"del": "^5.1.0",
- "raw-loader": "^3.1.0",
+ "raw-loader": "^4.0.2",
"supports-color": "^7.0.0",
"typescript": "4.0.2",
"webpack": "^4.41.5",
diff --git a/packages/osd-opensearch-archiver/src/lib/streams/concat_stream_providers.test.js b/packages/osd-opensearch-archiver/src/lib/streams/concat_stream_providers.test.js
index 5bb3c23a52ff..7350fc6752ab 100644
--- a/packages/osd-opensearch-archiver/src/lib/streams/concat_stream_providers.test.js
+++ b/packages/osd-opensearch-archiver/src/lib/streams/concat_stream_providers.test.js
@@ -69,11 +69,14 @@ describe('concatStreamProviders() helper', () => {
`"foo"`
);
expect(errorListener.mock.calls).toMatchInlineSnapshot(`
-Array [
- Array [
- [Error: foo],
- ],
-]
-`);
+ Array [
+ Array [
+ [Error: foo],
+ ],
+ Array [
+ [Error: foo],
+ ],
+ ]
+ `);
});
});
diff --git a/packages/osd-opensearch-archiver/src/lib/streams/reduce_stream.test.js b/packages/osd-opensearch-archiver/src/lib/streams/reduce_stream.test.js
index de46ca3a14da..cca405df85e1 100644
--- a/packages/osd-opensearch-archiver/src/lib/streams/reduce_stream.test.js
+++ b/packages/osd-opensearch-archiver/src/lib/streams/reduce_stream.test.js
@@ -80,7 +80,7 @@ describe('reduceStream', () => {
const errorStub = jest.fn();
reduce$.on('data', dataStub);
reduce$.on('error', errorStub);
- const endEvent = promiseFromEvent('end', reduce$);
+ const closeEvent = promiseFromEvent('close', reduce$);
reduce$.write(1);
reduce$.write(2);
@@ -89,7 +89,7 @@ describe('reduceStream', () => {
reduce$.write(1000);
reduce$.end();
- await endEvent;
+ await closeEvent;
expect(reducer).toHaveBeenCalledTimes(3);
expect(dataStub).toHaveBeenCalledTimes(0);
expect(errorStub).toHaveBeenCalledTimes(1);
diff --git a/packages/osd-opensearch/package.json b/packages/osd-opensearch/package.json
index ceb50fdcb88d..e34ec0d626cd 100644
--- a/packages/osd-opensearch/package.json
+++ b/packages/osd-opensearch/package.json
@@ -21,7 +21,7 @@
"execa": "^4.0.2",
"getopts": "^2.2.5",
"glob": "^7.1.7",
- "node-fetch": "^2.6.1",
+ "node-fetch": "^2.6.7",
"simple-git": "1.116.0",
"tar-fs": "^2.1.0",
"tree-kill": "^1.2.2",
@@ -29,7 +29,7 @@
},
"devDependencies": {
"@osd/babel-preset": "1.0.0",
- "@babel/cli": "^7.14.5",
+ "@babel/cli": "^7.16.0",
"del": "^5.1.0"
}
}
diff --git a/packages/osd-opensearch/src/artifact.js b/packages/osd-opensearch/src/artifact.js
index cc1f7a9c8ea6..e57987f2af1c 100644
--- a/packages/osd-opensearch/src/artifact.js
+++ b/packages/osd-opensearch/src/artifact.js
@@ -89,6 +89,11 @@ function shouldUseUnverifiedSnapshot() {
return !!process.env.OSD_OPENSEARCH_SNAPSHOT_USE_UNVERIFIED;
}
+// Setting this flag provides an easy way to skip comparing the checksum
+function skipVerifyChecksum() {
+ return !!process.env.OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM;
+}
+
async function fetchSnapshotManifest(url, log) {
log.info('Downloading snapshot manifest from %s', chalk.bold(url));
@@ -327,7 +332,9 @@ exports.Artifact = class Artifact {
return;
}
- await this._verifyChecksum(artifactResp);
+ if (!skipVerifyChecksum()) {
+ await this._verifyChecksum(artifactResp);
+ }
// cache the etag for future downloads
cache.writeMeta(dest, { etag: artifactResp.etag });
diff --git a/packages/osd-opensearch/src/artifact.test.js b/packages/osd-opensearch/src/artifact.test.js
index 5deddaf8e52a..2711f942bf1b 100644
--- a/packages/osd-opensearch/src/artifact.test.js
+++ b/packages/osd-opensearch/src/artifact.test.js
@@ -77,6 +77,7 @@ const previousEnvVars = {};
const ENV_VARS_TO_RESET = [
'OPENSEARCH_SNAPSHOT_MANIFEST',
'OSD_OPENSEARCH_SNAPSHOT_USE_UNVERIFIED',
+ 'OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM',
];
beforeAll(() => {
diff --git a/packages/osd-optimizer/package.json b/packages/osd-optimizer/package.json
index dd443da2aa5d..7304111570e4 100644
--- a/packages/osd-optimizer/package.json
+++ b/packages/osd-optimizer/package.json
@@ -10,37 +10,36 @@
"osd:watch": "yarn build --watch"
},
"dependencies": {
- "@babel/cli": "^7.14.5",
- "@babel/core": "^7.11.6",
+ "@babel/cli": "^7.16.0",
+ "@babel/core": "^7.16.5",
"@osd/babel-preset": "1.0.0",
"@osd/dev-utils": "1.0.0",
"@osd/std": "1.0.0",
"@osd/ui-shared-deps": "1.0.0",
- "autoprefixer": "^9.7.4",
- "babel-loader": "^8.0.6",
+ "autoprefixer": "^10.4.1",
+ "babel-loader": "^8.2.3",
"clean-webpack-plugin": "^3.0.0",
"compression-webpack-plugin": "^4.0.0",
"cpy": "^8.0.0",
"core-js": "^3.6.5",
- "css-loader": "^3.4.2",
+ "css-loader": "^5.2.7",
"dedent": "^0.7.0",
"del": "^5.1.0",
"execa": "^4.0.2",
"file-loader": "^4.2.0",
- "istanbul-instrumenter-loader": "^3.0.1",
"jest-diff": "^26.4.2",
"js-yaml": "^3.14.0",
"json-stable-stringify": "^1.0.1",
- "lmdb-store": "^0.6.10",
+ "lmdb-store": "^1.6.11",
"loader-utils": "^1.2.3",
- "node-sass": "sass/node-sass#v5",
+ "node-sass": "^6.0.1",
"normalize-path": "^3.0.0",
"pirates": "^4.0.1",
- "postcss": "^8.2.10",
- "postcss-loader": "^3.0.0",
- "raw-loader": "^3.1.0",
+ "postcss": "^8.4.5",
+ "postcss-loader": "^4.2.0",
+ "raw-loader": "^4.0.2",
"rxjs": "^6.5.5",
- "sass-loader": "^8.0.2",
+ "sass-loader": "^10.2.0",
"source-map-support": "^0.5.19",
"style-loader": "^1.1.3",
"terser-webpack-plugin": "^2.1.2",
@@ -52,11 +51,11 @@
"webpack-merge": "^4.2.2"
},
"devDependencies": {
- "@types/babel__core": "^7.1.10",
+ "@types/babel__core": "^7.1.17",
"@types/compression-webpack-plugin": "^2.0.2",
"@types/loader-utils": "^1.1.3",
"@types/source-map-support": "^0.5.3",
"@types/watchpack": "^1.1.6",
- "@types/webpack": "^4.41.3"
+ "@types/webpack": "^4.41.31"
}
}
diff --git a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
index 06f75b8981d6..513566453acf 100644
--- a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
+++ b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap
@@ -74,7 +74,7 @@ OptimizerConfig {
}
`;
-exports[`prepares assets for distribution: bar bundle 1`] = `"(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{enumerable:true,get:getter})}};__webpack_require__.r=function(exports){if(typeof Symbol!==\\"undefined\\"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:\\"Module\\"})}Object.defineProperty(exports,\\"__esModule\\",{value:true})};__webpack_require__.t=function(value,mode){if(mode&1)value=__webpack_require__(value);if(mode&8)return value;if(mode&4&&typeof value===\\"object\\"&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,\\"default\\",{enumerable:true,value:value});if(mode&2&&typeof value!=\\"string\\")for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module[\\"default\\"]}:function getModuleExports(){return module};__webpack_require__.d(getter,\\"a\\",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p=\\"\\";return __webpack_require__(__webpack_require__.s=3)})([function(module,exports,__webpack_require__){\\"use strict\\";var isOldIE=function isOldIE(){var memo;return function memorize(){if(typeof memo===\\"undefined\\"){memo=Boolean(window&&document&&document.all&&!window.atob)}return memo}}();var getTarget=function getTarget(){var memo={};return function memorize(target){if(typeof memo[target]===\\"undefined\\"){var styleTarget=document.querySelector(target);if(window.HTMLIFrameElement&&styleTarget instanceof window.HTMLIFrameElement){try{styleTarget=styleTarget.contentDocument.head}catch(e){styleTarget=null}}memo[target]=styleTarget}return memo[target]}}();var stylesInDom=[];function getIndexByIdentifier(identifier){var result=-1;for(var i=0;i