From 162dfa002b72fcd4a1686cd5a4b14521e72961ab Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 27 Apr 2023 21:46:45 +0000 Subject: [PATCH 01/19] Revert "Add fix for CVE-2023-2251 (#60)" yaml@2.2.2 does not support node v10.24.1 This reverts commit e8bb51ef5943fcb9a52b35dde8e22685f2be004f. Signed-off-by: Ubuntu --- package.json | 3 +-- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index de7c1fad..b2d939be 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "**/@types/react-router-dom": "^4.3.1", "eslint-utils": "^2.0.0", "json-schema": "^0.4.0", - "**/@types/react": "16.3.14", - "yaml": "^2.2.2" + "**/@types/react": "16.3.14" } } diff --git a/yarn.lock b/yarn.lock index abd20e3f..64260b4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2869,10 +2869,10 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yaml@^1.10.0, yaml@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.2.tgz#ec551ef37326e6d42872dad1970300f8eb83a073" - integrity sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA== +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yargs-parser@20.x: version "20.2.9" From 9728b0b7b05c7a7eba65985ca816b439b43c9117 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Thu, 27 Apr 2023 21:51:13 +0000 Subject: [PATCH 02/19] Update qs version for CVE-2022-24999 Signed-off-by: Rupal Mahajan Signed-off-by: Ubuntu --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 64260b4a..fc199450 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2190,9 +2190,9 @@ punycode@^2.1.0, punycode@^2.1.1: integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== querystring@0.2.0: version "0.2.0" From 26617fb75b04f5330e8debd878eec234859a7d7c Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Thu, 27 Apr 2023 21:54:59 +0000 Subject: [PATCH 03/19] Update minimatch version for CVE-2022-3517 Signed-off-by: Rupal Mahajan Signed-off-by: Ubuntu --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index fc199450..7b15b292 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1886,9 +1886,9 @@ mimic-fn@^2.1.0: integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" From d3bdfd29e7b24c97aeee1494715ec4afd9a14a53 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Thu, 27 Apr 2023 15:35:30 -0700 Subject: [PATCH 04/19] Add github workflows (#35) * Add github workflows Signed-off-by: Joshua Li * Fix env name Signed-off-by: Joshua Li --------- Signed-off-by: Joshua Li Signed-off-by: Ubuntu --- .github/CODEOWNERS | 2 + .github/ISSUE_TEMPLATE/bug_report.md | 31 ++++++++ .github/ISSUE_TEMPLATE/config.yml | 7 ++ .github/ISSUE_TEMPLATE/feature_request.md | 18 +++++ .github/PULL_REQUEST_TEMPLATE.md | 16 ++++ .github/draft-release-notes-config.yml | 45 +++++++++++ .github/workflows/backport.yml | 28 +++++++ .github/workflows/dco.yml | 18 +++++ .github/workflows/delete_backport_branch.yml | 15 ++++ .../draft-release-notes-workflow.yml | 21 +++++ .github/workflows/link-checker.yml | 24 ++++++ .../sql-workbench-test-build-workflow.yml | 79 +++++++++++++++++++ 12 files changed, 304 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/draft-release-notes-config.yml create mode 100644 .github/workflows/backport.yml create mode 100644 .github/workflows/dco.yml create mode 100644 .github/workflows/delete_backport_branch.yml create mode 100644 .github/workflows/draft-release-notes-workflow.yml create mode 100644 .github/workflows/link-checker.yml create mode 100644 .github/workflows/sql-workbench-test-build-workflow.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..7f92a3c6 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams +* @opensearch-project/sql \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..29eddb95 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: 🐛 Bug report +about: Create a report to help us improve +title: '[BUG]' +labels: 'bug, untriaged' +assignees: '' +--- + +**What is the bug?** +A clear and concise description of the bug. + +**How can one reproduce the bug?** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**What is the expected behavior?** +A clear and concise description of what you expected to happen. + +**What is your host/environment?** + - OS: [e.g. iOS] + - Version [e.g. 22] + - Plugins + +**Do you have any screenshots?** +If applicable, add screenshots to help explain your problem. + +**Do you have any additional context?** +Add any other context about the problem. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..a8199a10 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,7 @@ +contact_links: + - name: OpenSearch Community Support + url: https://discuss.opendistrocommunity.dev/ + about: Please ask and answer questions here. + - name: AWS/Amazon Security + url: https://aws.amazon.com/security/vulnerability-reporting/ + about: Please report security vulnerabilities here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..6198f338 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: 🎆 Feature request +about: Request a feature in this project +title: '[FEATURE]' +labels: 'enhancement, untriaged' +assignees: '' +--- +**Is your feature request related to a problem?** +A clear and concise description of what the problem is, e.g. _I'm always frustrated when [...]_ + +**What solution would you like?** +A clear and concise description of what you want to happen. + +**What alternatives have you considered?** +A clear and concise description of any alternative solutions or features you've considered. + +**Do you have any additional context?** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..2e325678 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +### Description +[Describe what this change achieves] + +### Issues Resolved +[List any issues this PR will resolve] + +### Check List +- [ ] New functionality includes testing. + - [ ] All tests pass, including unit test, integration test and doctest +- [ ] New functionality has been documented. + - [ ] New functionality has javadoc added + - [ ] New functionality has user manual doc added +- [ ] Commits are signed per the DCO using --signoff + +By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. +For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). \ No newline at end of file diff --git a/.github/draft-release-notes-config.yml b/.github/draft-release-notes-config.yml new file mode 100644 index 00000000..45ab4a08 --- /dev/null +++ b/.github/draft-release-notes-config.yml @@ -0,0 +1,45 @@ +# The overall template of the release notes +template: | + Compatible with OpenSearch and OpenSearch Dashboards Version $RESOLVED_VERSION + $CHANGES + +# Setting the formatting and sorting for the release notes body +name-template: Version $RESOLVED_VERSION +change-template: "* $TITLE ([#$NUMBER](https://github.com/opensearch-project/dashboards-query-workbench/pull/$NUMBER))" +sort-by: merged_at +sort-direction: ascending +replacers: + - search: '##' + replace: '###' + +# Organizing the tagged PRs into unified ODFE categories +categories: + - title: 'Breaking Changes' + labels: + - 'Breaking Changes' + - title: 'Features' + labels: + - 'feature' + - title: 'Enhancements' + labels: + - 'enhancement' + - title: 'Bug Fixes' + labels: + - 'bug' + - title: 'Infrastructure' + labels: + - 'infra' + - 'test' + - 'dependencies' + - 'github actions' + - title: 'Documentation' + labels: + - 'documentation' + - title: 'Maintenance' + labels: + - "version compatibility" + - "maintenance" + - title: 'Refactoring' + labels: + - 'refactor' + - 'code quality' diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 00000000..e47d8d88 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,28 @@ +name: Backport +on: + pull_request_target: + types: + - closed + - labeled + +jobs: + backport: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + name: Backport + steps: + - name: GitHub App token + id: github_app_token + uses: tibdex/github-app-token@v1.5.0 + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + installation_id: 22958780 + + - name: Backport + uses: VachaShah/backport@v1.1.4 + with: + github_token: ${{ steps.github_app_token.outputs.token }} + branch_name: backport/backport-${{ github.event.number }} diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml new file mode 100644 index 00000000..cf30ea89 --- /dev/null +++ b/.github/workflows/dco.yml @@ -0,0 +1,18 @@ +name: Developer Certificate of Origin Check + +on: [pull_request] + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Get PR Commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@v1.1.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: DCO Check + uses: tim-actions/dco@v1.1.0 + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml new file mode 100644 index 00000000..387a124b --- /dev/null +++ b/.github/workflows/delete_backport_branch.yml @@ -0,0 +1,15 @@ +name: Delete merged branch of the backport PRs +on: + pull_request: + types: + - closed + +jobs: + delete-branch: + runs-on: ubuntu-latest + if: startsWith(github.event.pull_request.head.ref,'backport/') + steps: + - name: Delete merged branch + uses: SvanBoxel/delete-merged-branch@main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/draft-release-notes-workflow.yml b/.github/workflows/draft-release-notes-workflow.yml new file mode 100644 index 00000000..2c4567d3 --- /dev/null +++ b/.github/workflows/draft-release-notes-workflow.yml @@ -0,0 +1,21 @@ +name: Release Drafter + +on: + push: + branches: + - main + +jobs: + update_release_draft: + name: Update draft release notes + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "main" + - name: Update draft release notes + uses: release-drafter/release-drafter@v5 + with: + config-name: draft-release-notes-config.yml + tag: (None) + version: x.x.0.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml new file mode 100644 index 00000000..ed4ce699 --- /dev/null +++ b/.github/workflows/link-checker.yml @@ -0,0 +1,24 @@ +name: Link Checker +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + linkchecker: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: lychee Link Checker + id: lychee + uses: lycheeverse/lychee-action@master + with: + args: --accept=200,403,429 "./**/*.html" "./**/*.md" "./**/*.txt" + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Fail if there were link errors + run: exit ${{ steps.lychee.outputs.exit_code }} + diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml new file mode 100644 index 00000000..bf5cacdd --- /dev/null +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -0,0 +1,79 @@ +name: Dashboards SQL Query Workbench Test & Build + +on: + pull_request: + push: + branches-ignore: + - 'dependabot/**' + paths: + - '.' + - '.github/workflows/sql-workbench-test-build-workflow.yml' + +env: + PLUGIN_NAME: dashboards-query-workbench + OPENSEARCH_DASHBOARDS_VERSION: '1.3' + OPENSEARCH_PLUGIN_VERSION: 1.3.8.0 + +jobs: + tests: + name: Run unit tests + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} + steps: + # Enable longer filenames for windows + - name: Enable longer filenames + if: ${{ matrix.os == 'windows-latest' }} + run: git config --system core.longpaths true + - name: Checkout OpenSearch Dashboards + uses: actions/checkout@v2 + with: + repository: opensearch-project/OpenSearch-Dashboards + ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} + path: OpenSearch-Dashboards + - name: Get node and yarn versions + id: versions_step + run: | + echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" + echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: ${{ steps.versions_step.outputs.node_version }} + registry-url: 'https://registry.npmjs.org' + - name: Install correct yarn version for OpenSearch Dashboards + run: | + npm uninstall -g yarn + echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" + npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} + - name: Checkout workbench OpenSearch Dashboards plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/dashboards-query-workbench + - name: Bootstrap plugin/opensearch-dashboards + run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + yarn osd bootstrap + - name: Test + run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + yarn test:jest --coverage + - name: Upload coverage + if: ${{ always() && matrix.os == 'ubuntu-latest' }} + uses: codecov/codecov-action@v3 + with: + flags: dashboards-query-workbench + directory: OpenSearch-Dashboards/plugins/dashboards-query-workbench + token: ${{ secrets.CODECOV_TOKEN }} + - name: Build Artifact + run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + yarn build + mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip + - name: Upload Artifact + if: always() + uses: actions/upload-artifact@v1 # can't update to v3 because upload fails + with: + name: dashboards-query-workbench-${{ matrix.os }} + path: OpenSearch-Dashboards/plugins/dashboards-query-workbench/build From 6318c6cd98d666e75a4ce39c7cf29c95e2df8441 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Thu, 27 Apr 2023 23:09:44 +0000 Subject: [PATCH 05/19] Rerun CI without macos Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index bf5cacdd..ff54f54d 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -19,7 +19,7 @@ jobs: name: Run unit tests strategy: matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: # Enable longer filenames for windows From 377e91b60e2f66e9df86b844ce2dd9dcd56dc5b6 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Fri, 28 Apr 2023 06:18:44 +0000 Subject: [PATCH 06/19] Fix workflow for windows test Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index ff54f54d..d0f96dce 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -58,7 +58,7 @@ jobs: - name: Test run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench - yarn test:jest --coverage + yarn test --coverage - name: Upload coverage if: ${{ always() && matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 From 0ef3b74af51a7662f359aa382cd7ded1d7d7e0f3 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Fri, 28 Apr 2023 06:37:17 +0000 Subject: [PATCH 07/19] Revert "Fix workflow for windows test" This reverts commit 377e91b60e2f66e9df86b844ce2dd9dcd56dc5b6. Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index d0f96dce..ff54f54d 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -58,7 +58,7 @@ jobs: - name: Test run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench - yarn test --coverage + yarn test:jest --coverage - name: Upload coverage if: ${{ always() && matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 From 85e22c18a2ff747d9c0631fb4ad65d64d3282e00 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 17:52:41 +0000 Subject: [PATCH 08/19] Update workflow Signed-off-by: Rupal Mahajan --- .../sql-workbench-test-build-workflow.yml | 67 ++++++++++--------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index ff54f54d..7736e56c 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -15,65 +15,66 @@ env: OPENSEARCH_PLUGIN_VERSION: 1.3.8.0 jobs: - tests: - name: Run unit tests + build: strategy: matrix: - os: [ ubuntu-latest, windows-latest ] + os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - # Enable longer filenames for windows - name: Enable longer filenames if: ${{ matrix.os == 'windows-latest' }} run: git config --system core.longpaths true + + - name: Checkout Plugin + uses: actions/checkout@v3 + - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v2 + uses: actions/checkout@v1 # can't update to v3 because `setup-node` fails with: - repository: opensearch-project/OpenSearch-Dashboards - ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} + repository: opensearch-project/Opensearch-Dashboards + ref: ${{ env.OPENSEARCH_VERSION }} path: OpenSearch-Dashboards - - name: Get node and yarn versions - id: versions_step - run: | - echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" - echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" - - name: Setup node - uses: actions/setup-node@v1 + + - name: Setup Node + uses: actions/setup-node@v3 with: - node-version: ${{ steps.versions_step.outputs.node_version }} + node-version-file: "../OpenSearch-Dashboards/.nvmrc" registry-url: 'https://registry.npmjs.org' - - name: Install correct yarn version for OpenSearch Dashboards + + - name: Move Workbench to Plugins Dir run: | - npm uninstall -g yarn - echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" - npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} - - name: Checkout workbench OpenSearch Dashboards plugin - uses: actions/checkout@v2 + mv workbench ../OpenSearch-Dashboards/plugins + + - name: OpenSearch Dashboards Plugin Bootstrap + uses: nick-fields/retry@v2 with: - path: OpenSearch-Dashboards/plugins/dashboards-query-workbench - - name: Bootstrap plugin/opensearch-dashboards - run: | - cd OpenSearch-Dashboards/plugins/dashboards-query-workbench - yarn osd bootstrap + timeout_minutes: 60 + max_attempts: 3 + command: cd ../OpenSearch-Dashboards/plugins/workbench; yarn osd bootstrap + - name: Test run: | - cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + cd ../OpenSearch-Dashboards/plugins/workbench yarn test:jest --coverage + - name: Upload coverage - if: ${{ always() && matrix.os == 'ubuntu-latest' }} + if: ${{ matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 with: - flags: dashboards-query-workbench - directory: OpenSearch-Dashboards/plugins/dashboards-query-workbench + flags: query-workbench + directory: ./../OpenSearch-Dashboards/plugins/workbench token: ${{ secrets.CODECOV_TOKEN }} + - name: Build Artifact run: | - cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + cd ../OpenSearch-Dashboards/plugins/workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip + - name: Upload Artifact if: always() uses: actions/upload-artifact@v1 # can't update to v3 because upload fails with: - name: dashboards-query-workbench-${{ matrix.os }} - path: OpenSearch-Dashboards/plugins/dashboards-query-workbench/build + name: workbench-${{ matrix.os }} + path: ../OpenSearch-Dashboards/plugins/workbench/build + \ No newline at end of file From 5f014aebba86de9dd716944e51e628cbc9c2360c Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 17:57:11 +0000 Subject: [PATCH 09/19] Revert "Update workflow" This reverts commit 85e22c18a2ff747d9c0631fb4ad65d64d3282e00. Signed-off-by: Rupal Mahajan --- .../sql-workbench-test-build-workflow.yml | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index 7736e56c..ff54f54d 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -15,66 +15,65 @@ env: OPENSEARCH_PLUGIN_VERSION: 1.3.8.0 jobs: - build: + tests: + name: Run unit tests strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: + # Enable longer filenames for windows - name: Enable longer filenames if: ${{ matrix.os == 'windows-latest' }} run: git config --system core.longpaths true - - - name: Checkout Plugin - uses: actions/checkout@v3 - - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v1 # can't update to v3 because `setup-node` fails + uses: actions/checkout@v2 with: - repository: opensearch-project/Opensearch-Dashboards - ref: ${{ env.OPENSEARCH_VERSION }} + repository: opensearch-project/OpenSearch-Dashboards + ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards - - - name: Setup Node - uses: actions/setup-node@v3 + - name: Get node and yarn versions + id: versions_step + run: | + echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" + echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" + - name: Setup node + uses: actions/setup-node@v1 with: - node-version-file: "../OpenSearch-Dashboards/.nvmrc" + node-version: ${{ steps.versions_step.outputs.node_version }} registry-url: 'https://registry.npmjs.org' - - - name: Move Workbench to Plugins Dir + - name: Install correct yarn version for OpenSearch Dashboards run: | - mv workbench ../OpenSearch-Dashboards/plugins - - - name: OpenSearch Dashboards Plugin Bootstrap - uses: nick-fields/retry@v2 + npm uninstall -g yarn + echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" + npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} + - name: Checkout workbench OpenSearch Dashboards plugin + uses: actions/checkout@v2 with: - timeout_minutes: 60 - max_attempts: 3 - command: cd ../OpenSearch-Dashboards/plugins/workbench; yarn osd bootstrap - + path: OpenSearch-Dashboards/plugins/dashboards-query-workbench + - name: Bootstrap plugin/opensearch-dashboards + run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + yarn osd bootstrap - name: Test run: | - cd ../OpenSearch-Dashboards/plugins/workbench + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn test:jest --coverage - - name: Upload coverage - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ always() && matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 with: - flags: query-workbench - directory: ./../OpenSearch-Dashboards/plugins/workbench + flags: dashboards-query-workbench + directory: OpenSearch-Dashboards/plugins/dashboards-query-workbench token: ${{ secrets.CODECOV_TOKEN }} - - name: Build Artifact run: | - cd ../OpenSearch-Dashboards/plugins/workbench + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - - name: Upload Artifact if: always() uses: actions/upload-artifact@v1 # can't update to v3 because upload fails with: - name: workbench-${{ matrix.os }} - path: ../OpenSearch-Dashboards/plugins/workbench/build - \ No newline at end of file + name: dashboards-query-workbench-${{ matrix.os }} + path: OpenSearch-Dashboards/plugins/dashboards-query-workbench/build From 43a27aeaa561858b93e2b5930ae35471cf6ca1d2 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 18:00:12 +0000 Subject: [PATCH 10/19] Retry CI Signed-off-by: Rupal Mahajan --- .../sql-workbench-test-build-workflow.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index ff54f54d..c3ff5e2a 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -26,39 +26,47 @@ jobs: - name: Enable longer filenames if: ${{ matrix.os == 'windows-latest' }} run: git config --system core.longpaths true + - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v2 + uses: actions/checkout@v1 with: repository: opensearch-project/OpenSearch-Dashboards ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards + - name: Get node and yarn versions id: versions_step run: | echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" + - name: Setup node uses: actions/setup-node@v1 with: node-version: ${{ steps.versions_step.outputs.node_version }} registry-url: 'https://registry.npmjs.org' + - name: Install correct yarn version for OpenSearch Dashboards run: | npm uninstall -g yarn echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} + - name: Checkout workbench OpenSearch Dashboards plugin - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: OpenSearch-Dashboards/plugins/dashboards-query-workbench + - name: Bootstrap plugin/opensearch-dashboards run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn osd bootstrap + - name: Test run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn test:jest --coverage + - name: Upload coverage if: ${{ always() && matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 @@ -66,11 +74,13 @@ jobs: flags: dashboards-query-workbench directory: OpenSearch-Dashboards/plugins/dashboards-query-workbench token: ${{ secrets.CODECOV_TOKEN }} + - name: Build Artifact run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip + - name: Upload Artifact if: always() uses: actions/upload-artifact@v1 # can't update to v3 because upload fails From afb139565ec1cdc55652312f9d41fdfdcfd7c0e0 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 18:36:06 +0000 Subject: [PATCH 11/19] Retry workflow Signed-off-by: Rupal Mahajan --- .../sql-workbench-test-build-workflow.yml | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index c3ff5e2a..7a1a651b 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -34,24 +34,12 @@ jobs: ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards - - name: Get node and yarn versions - id: versions_step - run: | - echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" - echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" - - - name: Setup node - uses: actions/setup-node@v1 + - name: Setup Node + uses: actions/setup-node@v3 with: - node-version: ${{ steps.versions_step.outputs.node_version }} + node-version-file: "../OpenSearch-Dashboards/.nvmrc" registry-url: 'https://registry.npmjs.org' - - - name: Install correct yarn version for OpenSearch Dashboards - run: | - npm uninstall -g yarn - echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" - npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} - + - name: Checkout workbench OpenSearch Dashboards plugin uses: actions/checkout@v3 with: From 6de1988f080fb8994e71874ece3dd7fde419d7c4 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 18:42:23 +0000 Subject: [PATCH 12/19] Fix yaml syntax Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index 7a1a651b..64ad96ed 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -34,12 +34,12 @@ jobs: ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards - - name: Setup Node + - name: Setup node uses: actions/setup-node@v3 with: node-version-file: "../OpenSearch-Dashboards/.nvmrc" registry-url: 'https://registry.npmjs.org' - + - name: Checkout workbench OpenSearch Dashboards plugin uses: actions/checkout@v3 with: From 330cba2cd0b555f16a6805edf4929b7533c5decc Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 18:58:49 +0000 Subject: [PATCH 13/19] Rerun CI Signed-off-by: Rupal Mahajan --- .../sql-workbench-test-build-workflow.yml | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index 64ad96ed..9999521a 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -26,35 +26,38 @@ jobs: - name: Enable longer filenames if: ${{ matrix.os == 'windows-latest' }} run: git config --system core.longpaths true - - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: repository: opensearch-project/OpenSearch-Dashboards ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards - - - name: Setup node + - name: Setup Node uses: actions/setup-node@v3 with: - node-version-file: "../OpenSearch-Dashboards/.nvmrc" + node-version-file: './OpenSearch-Dashboards/.nvmrc' registry-url: 'https://registry.npmjs.org' - + - name: Install Yarn + # Need to use bash to avoid having a windows/linux specific step + shell: bash + run: | + YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn") + echo "Installing yarn@$YARN_VERSION" + npm i -g yarn@$YARN_VERSION + - run: node -v + - run: yarn -v - name: Checkout workbench OpenSearch Dashboards plugin - uses: actions/checkout@v3 + uses: actions/checkout@v2 with: path: OpenSearch-Dashboards/plugins/dashboards-query-workbench - - name: Bootstrap plugin/opensearch-dashboards run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn osd bootstrap - - name: Test run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn test:jest --coverage - - name: Upload coverage if: ${{ always() && matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 @@ -62,16 +65,14 @@ jobs: flags: dashboards-query-workbench directory: OpenSearch-Dashboards/plugins/dashboards-query-workbench token: ${{ secrets.CODECOV_TOKEN }} - - name: Build Artifact run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - - name: Upload Artifact if: always() uses: actions/upload-artifact@v1 # can't update to v3 because upload fails with: name: dashboards-query-workbench-${{ matrix.os }} - path: OpenSearch-Dashboards/plugins/dashboards-query-workbench/build + path: OpenSearch-Dashboards/plugins/dashboards-query-workbench/build \ No newline at end of file From c359b8bc70bf2fead2cae24a112f53c7d10de4e2 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 20:03:13 +0000 Subject: [PATCH 14/19] Try bash for test Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index 9999521a..0217a751 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -55,6 +55,7 @@ jobs: cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn osd bootstrap - name: Test + shell: bash run: | cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn test:jest --coverage From fffa8969f4ae41d8c95e90a2dba697e00158e9bc Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 21:01:37 +0000 Subject: [PATCH 15/19] Rerun workflow Signed-off-by: Rupal Mahajan --- .../sql-workbench-test-build-workflow.yml | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index 0217a751..39031f7f 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -27,38 +27,36 @@ jobs: if: ${{ matrix.os == 'windows-latest' }} run: git config --system core.longpaths true - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v2 + uses: actions/checkout@v1 with: repository: opensearch-project/OpenSearch-Dashboards ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards + - name: Get node version + id: versions_step + run: + echo "::set-output name=node_version::$(node -p "(require('../OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v1 with: - node-version-file: './OpenSearch-Dashboards/.nvmrc' + node-version: ${{ steps.versions_step.outputs.node_version }} registry-url: 'https://registry.npmjs.org' - - name: Install Yarn - # Need to use bash to avoid having a windows/linux specific step - shell: bash - run: | - YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn") - echo "Installing yarn@$YARN_VERSION" - npm i -g yarn@$YARN_VERSION - - run: node -v - - run: yarn -v - name: Checkout workbench OpenSearch Dashboards plugin - uses: actions/checkout@v2 + uses: actions/checkout@v1 with: - path: OpenSearch-Dashboards/plugins/dashboards-query-workbench + path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - name: Bootstrap plugin/opensearch-dashboards - run: | - cd OpenSearch-Dashboards/plugins/dashboards-query-workbench - yarn osd bootstrap + uses: nick-fields/retry@v1 + with: + timeout_minutes: 30 + max_attempts: 3 + command: yarn osd bootstrap - name: Test - shell: bash - run: | - cd OpenSearch-Dashboards/plugins/dashboards-query-workbench - yarn test:jest --coverage + uses: nick-fields/retry@v1 + with: + timeout_minutes: 30 + max_attempts: 3 + command: yarn test:jest --coverage - name: Upload coverage if: ${{ always() && matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 @@ -68,7 +66,6 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Build Artifact run: | - cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - name: Upload Artifact From ea7e216e533859cecf3fc26c5135a85b9937b8fa Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 21:30:03 +0000 Subject: [PATCH 16/19] Fix version Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index 39031f7f..df881bb8 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -12,7 +12,7 @@ on: env: PLUGIN_NAME: dashboards-query-workbench OPENSEARCH_DASHBOARDS_VERSION: '1.3' - OPENSEARCH_PLUGIN_VERSION: 1.3.8.0 + OPENSEARCH_PLUGIN_VERSION: 1.3.9.0 jobs: tests: From 3a2f4bdbb8307b595ef144b1f78521876ee37a28 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 22:19:44 +0000 Subject: [PATCH 17/19] Fix Path Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index df881bb8..f06a3ee3 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -66,6 +66,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Build Artifact run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - name: Upload Artifact From c95031f7cdadd0c09ffbeffda1a57c09ddefcf44 Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 22:43:09 +0000 Subject: [PATCH 18/19] fix path Signed-off-by: Rupal Mahajan --- .github/workflows/sql-workbench-test-build-workflow.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index f06a3ee3..5951c477 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -66,7 +66,6 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Build Artifact run: | - cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - name: Upload Artifact @@ -74,4 +73,4 @@ jobs: uses: actions/upload-artifact@v1 # can't update to v3 because upload fails with: name: dashboards-query-workbench-${{ matrix.os }} - path: OpenSearch-Dashboards/plugins/dashboards-query-workbench/build \ No newline at end of file + path: ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip \ No newline at end of file From bec723f6c56d091e4501ac71e3121a872fda614a Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 1 May 2023 23:05:50 +0000 Subject: [PATCH 19/19] Fix node path issue Signed-off-by: Rupal Mahajan --- .../sql-workbench-test-build-workflow.yml | 42 ++++++++++--------- package.json | 2 +- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/sql-workbench-test-build-workflow.yml b/.github/workflows/sql-workbench-test-build-workflow.yml index 5951c477..667f0b33 100644 --- a/.github/workflows/sql-workbench-test-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-build-workflow.yml @@ -27,36 +27,37 @@ jobs: if: ${{ matrix.os == 'windows-latest' }} run: git config --system core.longpaths true - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: repository: opensearch-project/OpenSearch-Dashboards ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards - - name: Get node version - id: versions_step - run: - echo "::set-output name=node_version::$(node -p "(require('../OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")" - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: - node-version: ${{ steps.versions_step.outputs.node_version }} + node-version-file: './OpenSearch-Dashboards/.nvmrc' registry-url: 'https://registry.npmjs.org' + - name: Install Yarn + # Need to use bash to avoid having a windows/linux specific step + shell: bash + run: | + YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn") + echo "Installing yarn@$YARN_VERSION" + npm i -g yarn@$YARN_VERSION + - run: node -v + - run: yarn -v - name: Checkout workbench OpenSearch Dashboards plugin - uses: actions/checkout@v1 + uses: actions/checkout@v2 with: - path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} + path: OpenSearch-Dashboards/plugins/dashboards-query-workbench - name: Bootstrap plugin/opensearch-dashboards - uses: nick-fields/retry@v1 - with: - timeout_minutes: 30 - max_attempts: 3 - command: yarn osd bootstrap + run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + yarn osd bootstrap - name: Test - uses: nick-fields/retry@v1 - with: - timeout_minutes: 30 - max_attempts: 3 - command: yarn test:jest --coverage + run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench + yarn test:jest --coverage - name: Upload coverage if: ${{ always() && matrix.os == 'ubuntu-latest' }} uses: codecov/codecov-action@v3 @@ -66,6 +67,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Build Artifact run: | + cd OpenSearch-Dashboards/plugins/dashboards-query-workbench yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - name: Upload Artifact @@ -73,4 +75,4 @@ jobs: uses: actions/upload-artifact@v1 # can't update to v3 because upload fails with: name: dashboards-query-workbench-${{ matrix.os }} - path: ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip \ No newline at end of file + path: OpenSearch-Dashboards/plugins/dashboards-query-workbench/build \ No newline at end of file diff --git a/package.json b/package.json index b2d939be..db13ca95 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "start": "plugin-helpers start", "test:server": "plugin-helpers test:server", "test:browser": "plugin-helpers test:browser", - "test:jest": "NODE_PATH=../../node_modules ../../node_modules/.bin/jest --config ./test/jest.config.js", + "test:jest": "../../node_modules/.bin/jest --config test/jest.config.js", "build": "yarn plugin_helpers build", "plugin_helpers": "node ../../scripts/plugin_helpers" },