From 58d52f71d19a8b96bbdf4f296d52e5a3ffecfc73 Mon Sep 17 00:00:00 2001 From: Danila Gulderov Date: Fri, 16 Feb 2024 05:00:25 +0300 Subject: [PATCH 1/5] Nav menu length check (#295) (#295) Signed-off-by: Danila Gulderov --- .cypress/integration/04-download.spec.ts | 8 ++++---- public/components/context_menu/context_menu.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.cypress/integration/04-download.spec.ts b/.cypress/integration/04-download.spec.ts index af7e6409..9bab9894 100644 --- a/.cypress/integration/04-download.spec.ts +++ b/.cypress/integration/04-download.spec.ts @@ -33,7 +33,7 @@ describe('Cypress', () => { // click Reporting in-context menu cy.get('#downloadReport > span:nth-child(1) > span:nth-child(1)').click({ force: true }); - // download PDF + // download PDF cy.get('#generatePDF > span:nth-child(1) > span:nth-child(2)').click({ force: true }); cy.get('#reportGenerationProgressModal'); @@ -59,7 +59,7 @@ describe('Cypress', () => { cy.wait(5000); // open saved search list - cy.get('button.euiButtonEmpty:nth-child(3) > span:nth-child(1) > span:nth-child(1)').click({ force: true }); + cy.get('[data-test-subj="discoverOpenButton"]').click({ force: true }); cy.wait(5000); // click first entry @@ -72,7 +72,7 @@ describe('Cypress', () => { }); it('Download from Report definition details page', () => { - // create an on-demand report definition + // create an on-demand report definition cy.visit(`${Cypress.env('opensearchDashboards')}/app/reports-dashboards#/`); cy.location('pathname', { timeout: 60000 }).should( @@ -81,7 +81,7 @@ describe('Cypress', () => { ); cy.wait(10000); - cy.get('tr.euiTableRow-isSelectable:nth-child(1) > td:nth-child(1) > div:nth-child(2) > button:nth-child(1)').first().click(); + cy.get('tr.euiTableRow-isSelectable:nth-child(1) > td:nth-child(1) > div:nth-child(2) > button:nth-child(1)').first().click(); cy.url().should('include', 'report_definition_details'); diff --git a/public/components/context_menu/context_menu.js b/public/components/context_menu/context_menu.js index 99b9a35f..d2738185 100644 --- a/public/components/context_menu/context_menu.js +++ b/public/components/context_menu/context_menu.js @@ -254,7 +254,7 @@ const checkURLParams = async () => { const isDiscoverNavMenu = (navMenu) => { return ( - navMenu[0].children.length === 5 && + (navMenu[0].children.length === 5 || navMenu[0].children.length === 6) && ($('[data-test-subj="breadcrumb first"]').prop('title') === 'Discover' || $('[data-test-subj="breadcrumb first last"]').prop('title') === 'Discover') From 69f6da896c0e8e7d592756c72ef0829a813ada08 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Mon, 19 Feb 2024 09:53:39 -0800 Subject: [PATCH 2/5] allow negative signs in duration (#284) Signed-off-by: Joshua Li --- .../utils/__tests__/validationHelper.test.ts | 40 ++++++++++++------- server/utils/validationHelper.ts | 13 +++--- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/server/utils/__tests__/validationHelper.test.ts b/server/utils/__tests__/validationHelper.test.ts index 798409ad..e662ef11 100644 --- a/server/utils/__tests__/validationHelper.test.ts +++ b/server/utils/__tests__/validationHelper.test.ts @@ -5,12 +5,16 @@ import { ReportDefinitionSchemaType, ReportSchemaType } from '../../model'; import { - DELIVERY_TYPE, FORMAT, REPORT_TYPE, TRIGGER_TYPE, } from '../../routes/utils/constants'; -import { isValidRelativeUrl, validateReport, validateReportDefinition } from '../validationHelper'; +import { + isValidRelativeUrl, + regexDuration, + validateReport, + validateReportDefinition, +} from '../validationHelper'; const SAMPLE_SAVED_OBJECT_ID = '3ba638e0-b894-11e8-a6d9-e546fe2bba5f'; const createReportDefinitionInput: ReportDefinitionSchemaType = { @@ -31,7 +35,7 @@ const createReportDefinitionInput: ReportDefinitionSchemaType = { configIds: [], title: 'title', textDescription: 'text description', - htmlDescription: 'html description' + htmlDescription: 'html description', }, trigger: { trigger_type: TRIGGER_TYPE.onDemand, @@ -63,12 +67,12 @@ const createReportDefinitionNotebookLegacyInput: ReportDefinitionSchemaType = { configIds: [], title: 'title', textDescription: 'text description', - htmlDescription: 'html description' + htmlDescription: 'html description', }, trigger: { trigger_type: TRIGGER_TYPE.onDemand, }, -} +}; const createReportDefinitionNotebookInput: ReportDefinitionSchemaType = { report_params: { @@ -88,12 +92,12 @@ const createReportDefinitionNotebookInput: ReportDefinitionSchemaType = { configIds: [], title: 'title', textDescription: 'text description', - htmlDescription: 'html description' + htmlDescription: 'html description', }, trigger: { trigger_type: TRIGGER_TYPE.onDemand, }, -} +}; const createReportDefinitionNotebookPostNavBarInput: ReportDefinitionSchemaType = { report_params: { @@ -113,12 +117,12 @@ const createReportDefinitionNotebookPostNavBarInput: ReportDefinitionSchemaType configIds: [], title: 'title', textDescription: 'text description', - htmlDescription: 'html description' + htmlDescription: 'html description', }, trigger: { trigger_type: TRIGGER_TYPE.onDemand, }, -} +}; describe('test input validation', () => { test('create report with correct saved object id', async () => { @@ -189,7 +193,7 @@ describe('test input validation', () => { }); test('validation against query_url', async () => { - const urls: [string, boolean][] = [ + const urls: Array<[string, boolean]> = [ ['/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=', true], [ '/_plugin/kibana/app/dashboards#/view/7adfa750-4c81-11e8-b3d7-01146121b73d?_g=', @@ -223,15 +227,23 @@ describe('test input validation', () => { '/app/data-explorer/discover?security_tenant=private#/view/571aaf70-4c88-11e8-b3d7-01146121b73d', true, ], - [ - '/app/discoverLegacy#/view/571aaf70-4c88-11e8-b3d7-01146121b73d', - true, - ], + ['/app/discoverLegacy#/view/571aaf70-4c88-11e8-b3d7-01146121b73d', true], ]; expect(urls.map((url) => isValidRelativeUrl(url[0]))).toEqual( urls.map((url) => url[1]) ); }); + + test('validate ISO 8601 durations', () => { + const durations: Array<[string, boolean]> = [ + ['PT30M', true], + ['PT-30M', true], + ['PT-2H-30M', true], + ]; + expect( + durations.map((duration) => regexDuration.test(duration[0])) + ).toEqual(durations.map((duration) => duration[1])); + }); }); // TODO: merge this with other mock clients used in testing, to create some mock helpers file diff --git a/server/utils/validationHelper.ts b/server/utils/validationHelper.ts index 08fa1b4a..3677f898 100644 --- a/server/utils/validationHelper.ts +++ b/server/utils/validationHelper.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { RequestParams } from '@elastic/elasticsearch'; +import { RequestParams } from '@opensearch-project/opensearch'; import path from 'path'; import { ILegacyScopedClusterClient } from '../../../../src/core/server'; import { @@ -15,7 +15,7 @@ import { import { REPORT_TYPE } from '../../server/routes/utils/constants'; export const isValidRelativeUrl = (relativeUrl: string) => { - let normalizedRelativeUrl = relativeUrl + let normalizedRelativeUrl = relativeUrl; if ( !relativeUrl.includes('observability#/notebooks') && !relativeUrl.includes('notebooks-dashboards') @@ -34,7 +34,7 @@ export const isValidRelativeUrl = (relativeUrl: string) => { * moment.js isValid() API fails to validate time duration, so use regex * https://github.com/moment/moment/issues/1805 **/ -export const regexDuration = /^(-?)P(?=\d|T\d)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)([DW]))?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/; +export const regexDuration = /^([-+]?)P(?=\d|T[-+]?\d)(?:([-+]?\d+)Y)?(?:([-+]?\d+)M)?(?:([-+]?\d+)([DW]))?(?:T(?:([-+]?\d+)H)?(?:([-+]?\d+)M)?(?:([-+]?\d+(?:\.\d+)?)S)?)?$/; export const regexEmailAddress = /\S+@\S+\.\S+/; export const regexReportName = /^[\w\-\s\(\)\[\]\,\_\-+]+$/; export const regexRelativeUrl = /^\/(_plugin\/kibana\/|_dashboards\/)?app\/(dashboards|visualize|discover|discoverLegacy|data-explorer\/discover\/?|observability-dashboards|observability-notebooks|notebooks-dashboards\?view=output_only(&security_tenant=.+)?)(\?security_tenant=.+)?#\/(notebooks\/|view\/|edit\/)?[^\/]+$/; @@ -42,7 +42,7 @@ export const regexRelativeUrl = /^\/(_plugin\/kibana\/|_dashboards\/)?app\/(dash export const validateReport = async ( client: ILegacyScopedClusterClient, report: ReportSchemaType, - basePath: String + basePath: string ) => { report.query_url = report.query_url.replace(basePath, ''); report.report_definition.report_params.core_params.base_url = report.report_definition.report_params.core_params.base_url.replace( @@ -66,7 +66,7 @@ export const validateReport = async ( export const validateReportDefinition = async ( client: ILegacyScopedClusterClient, reportDefinition: ReportDefinitionSchemaType, - basePath: String + basePath: string ) => { reportDefinition.report_params.core_params.base_url = reportDefinition.report_params.core_params.base_url.replace( basePath, @@ -115,8 +115,7 @@ const validateSavedObject = async ( if (getType(source) === 'notebook') { // no backend check for notebooks because we would just be checking against the notebooks api again exist = true; - } - else { + } else { savedObjectId = `${getType(source)}:${getId(url)}`; const params: RequestParams.Exists = { index: '.kibana', From 617881add5bca8ad46608fb50229256e5c12bb57 Mon Sep 17 00:00:00 2001 From: Jialiang Liang Date: Mon, 19 Feb 2024 14:24:00 -0800 Subject: [PATCH 3/5] Add single version flag during bootstrap to fix version conflicts (#303) Signed-off-by: Ryan Liang --- .github/workflows/cypress-e2e-reporting-test.yml | 2 +- .github/workflows/ftr-e2e-reporting-test.yml | 2 +- .github/workflows/lint.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cypress-e2e-reporting-test.yml b/.github/workflows/cypress-e2e-reporting-test.yml index 8e591380..54ba0cb4 100644 --- a/.github/workflows/cypress-e2e-reporting-test.yml +++ b/.github/workflows/cypress-e2e-reporting-test.yml @@ -117,7 +117,7 @@ jobs: - name: Boodstrap Opensearch Dashboards run: | - yarn osd bootstrap + yarn osd bootstrap --single-version=loose working-directory: OpenSearch-Dashboards - name: Run Opensearch Dashboards with Dashboards Reporting Plugin Installed diff --git a/.github/workflows/ftr-e2e-reporting-test.yml b/.github/workflows/ftr-e2e-reporting-test.yml index a7e8f3f5..67f67c83 100644 --- a/.github/workflows/ftr-e2e-reporting-test.yml +++ b/.github/workflows/ftr-e2e-reporting-test.yml @@ -117,7 +117,7 @@ jobs: - name: Boodstrap Opensearch Dashboards run: | - yarn osd bootstrap + yarn osd bootstrap --single-version=loose working-directory: OpenSearch-Dashboards - name: Run Opensearch Dashboards with Dashboards Reporting Plugin Installed diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ed6dcb90..f953cdaa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -46,7 +46,7 @@ jobs: - name: Bootstrap the plugin working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - run: yarn osd bootstrap + run: yarn osd bootstrap --single-version=loose - name: Get list of changed files using GitHub Action uses: lots0logs/gh-action-get-changed-files@2.2.2 From 2d39d2477d9219210618e1a9ed561d0b94d77bee Mon Sep 17 00:00:00 2001 From: Rupal Mahajan Date: Mon, 19 Feb 2024 16:57:39 -0800 Subject: [PATCH 4/5] Fix condition to determine if the date field's value is an array (#299) * Change cypress version Signed-off-by: Rupal Mahajan * Fix condition to check if date field Signed-off-by: Rupal Mahajan * Fix cypress test Signed-off-by: Rupal Mahajan * update cypress e2e workflow Signed-off-by: Rupal Mahajan * Revert "update cypress e2e workflow" This reverts commit 0db4d739925a7e508fb6bafbb58fe29597dee6d2. Signed-off-by: Rupal Mahajan * Fix cypress error Signed-off-by: Rupal Mahajan * Try cypress CI without --spec Signed-off-by: Rupal Mahajan * Revert cypress to v13.6.0 Signed-off-by: Rupal Mahajan --------- Signed-off-by: Rupal Mahajan --- .cypress/integration/04-download.spec.ts | 25 ++++++++++--------- .../workflows/cypress-e2e-reporting-test.yml | 2 +- ...boards-reports-test-and-build-workflow.yml | 6 ++--- DEVELOPER_GUIDE.md | 2 +- server/routes/utils/dataReportHelpers.ts | 8 +++--- yarn.lock | 20 +++++---------- 6 files changed, 28 insertions(+), 35 deletions(-) diff --git a/.cypress/integration/04-download.spec.ts b/.cypress/integration/04-download.spec.ts index 9bab9894..1c4fb5b2 100644 --- a/.cypress/integration/04-download.spec.ts +++ b/.cypress/integration/04-download.spec.ts @@ -12,15 +12,12 @@ describe('Cypress', () => { ); cy.wait(12500); - cy.get('#landingPageOnDemandDownload').click({ force: true }); - cy.get('body').then($body => { - if ($body.find('#downloadInProgressLoadingModal').length > 0) { - return; - } - else { - assert(false); - } - }) + cy.get('[id="landingPageOnDemandDownload"]') + .contains('CSV') + .click({ force: true }); + cy.get('.euiToastHeader__title') + .contains('Successfully downloaded report') + .should('exist'); }); it('Download pdf from in-context menu', () => { @@ -85,10 +82,14 @@ describe('Cypress', () => { cy.url().should('include', 'report_definition_details'); - cy.get('#generateReportFromDetailsButton').should('exist'); + cy.wait(5000); + + cy.get('#generateReportFromDetailsFileFormat').should('exist'); - cy.get('#generateReportFromDetailsButton').click({ force: true }); + cy.get('#generateReportFromDetailsFileFormat').click({ force: true }); - cy.get('#downloadInProgressLoadingModal'); + cy.get('.euiToastHeader__title') + .contains('Successfully generated report') + .should('exist'); }); }); diff --git a/.github/workflows/cypress-e2e-reporting-test.yml b/.github/workflows/cypress-e2e-reporting-test.yml index 54ba0cb4..1c687bb4 100644 --- a/.github/workflows/cypress-e2e-reporting-test.yml +++ b/.github/workflows/cypress-e2e-reporting-test.yml @@ -150,7 +150,7 @@ jobs: - name: Run Cypress tests run: | - yarn cypress:run --browser chrome --headless --spec '.cypress/integration/*' + yarn cypress:run --browser chrome --headless working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - name: Capture failure screenshots diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index 5481d40a..44ccb464 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -48,7 +48,7 @@ jobs: cd ./OpenSearch-Dashboards/ su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v && cd ./plugins/${{ env.PLUGIN_NAME }} && - whoami && yarn osd bootstrap && yarn test --coverage" + whoami && yarn osd bootstrap --single-version=loose && yarn test --coverage" - name: Upload coverage uses: codecov/codecov-action@v1 @@ -113,7 +113,7 @@ jobs: with: timeout_minutes: 30 max_attempts: 3 - command: yarn osd bootstrap + command: yarn osd bootstrap --single-version=loose - name: Test uses: nick-fields/retry@v1 @@ -171,7 +171,7 @@ jobs: with: timeout_minutes: 30 max_attempts: 3 - command: yarn osd bootstrap + command: yarn osd bootstrap --single-version=loose - name: Test uses: nick-fields/retry@v1 diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 245e9f9c..2e883c72 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -27,7 +27,7 @@ another JDK installation, e.g. `RUNTIME_JAVA_HOME=/usr/lib/jvm/jdk-8`. cd plugins git clone https://github.com/opensearch-project/dashboards-reporting.git ``` -1. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/dashboards-reporting`. +1. Run `yarn osd bootstrap --single-version=loose` inside `OpenSearch-Dashboards/plugins/dashboards-reporting`. Ultimately, your directory structure should look like this: diff --git a/server/routes/utils/dataReportHelpers.ts b/server/routes/utils/dataReportHelpers.ts index 466a4b15..27349f2d 100644 --- a/server/routes/utils/dataReportHelpers.ts +++ b/server/routes/utils/dataReportHelpers.ts @@ -145,8 +145,8 @@ export const getOpenSearchData = ( if (typeof dateValue === 'string') { data._source[keys] = moment.utc(dateValue).tz(timezone).format(dateFormat); } else if ( - fieldDateValue.length !== 0 && - fieldDateValue instanceof Array + dateValue.length !== 0 && + dateValue instanceof Array ) { fieldDateValue.forEach((element, index) => { data._source[keys][index] = moment.utc(element).tz(timezone).format(dateFormat); @@ -161,8 +161,8 @@ export const getOpenSearchData = ( if (typeof fieldDateValue === 'string') { keys.push(moment.utc(fieldDateValue).tz(timezone).format(dateFormat)); } else if ( - fieldDateValue.length !== 0 && - fieldDateValue instanceof Array + dateValue.length !== 0 && + dateValue instanceof Array ) { let tempArray: string[] = []; fieldDateValue.forEach((index) => { diff --git a/yarn.lock b/yarn.lock index 03e14cfb..490cb873 100644 --- a/yarn.lock +++ b/yarn.lock @@ -757,13 +757,6 @@ dependencies: undici-types "~5.26.4" -"@types/node@^18.17.5": - version "18.19.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.6.tgz#537beece2c8ad4d9abdaa3b0f428e601eb57dac8" - integrity sha512-X36s5CXMrrJOs2lQCdDF68apW4Rfx9ixYMawlepwmE4Anezv/AV2LSpKD1Ub8DAc+urp5bk0BGZ6NtmBitfnsg== - dependencies: - undici-types "~5.26.4" - "@types/parse-json@^4.0.0": version "4.0.2" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" @@ -2195,13 +2188,12 @@ cyclist@^1.0.1: integrity sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA== cypress@^13.6.0: - version "13.6.2" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.6.2.tgz#c70df09db0a45063298b3cecba2fa21109768e08" - integrity sha512-TW3bGdPU4BrfvMQYv1z3oMqj71YI4AlgJgnrycicmPZAXtvywVFZW9DAToshO65D97rCWfG/kqMFsYB6Kp91gQ== + version "13.6.4" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.6.4.tgz#42c88d3ee0342f1681abfacabf9c1f082676bc53" + integrity sha512-pYJjCfDYB+hoOoZuhysbbYhEmNW7DEDsqn+ToCLwuVowxUXppIWRr7qk4TVRIU471ksfzyZcH+mkoF0CQUKnpw== dependencies: "@cypress/request" "^3.0.0" "@cypress/xvfb" "^1.2.4" - "@types/node" "^18.17.5" "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" @@ -5343,9 +5335,9 @@ ret@~0.1.10: integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== rfdc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== + version "1.3.1" + resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.1.tgz#2b6d4df52dffe8bb346992a10ea9451f24373a8f" + integrity sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg== rgbcolor@^1.0.1: version "1.0.1" From a9c0c951085f67aceca7f86a3e0c97bd3b734acd Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Fri, 23 Feb 2024 18:30:33 -0500 Subject: [PATCH 5/5] Add workflow to verify binary installation is successful (#313) * Add workflow to verify binary installation is successful Signed-off-by: Derek Ho * Use new version to pass in custom suffix Signed-off-by: Derek Ho --------- Signed-off-by: Derek Ho --- .../workflows/verify-binary-installation.yml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/verify-binary-installation.yml diff --git a/.github/workflows/verify-binary-installation.yml b/.github/workflows/verify-binary-installation.yml new file mode 100644 index 00000000..d8264c49 --- /dev/null +++ b/.github/workflows/verify-binary-installation.yml @@ -0,0 +1,55 @@ +name: 'Install Dashboards with Plugin via Binary' + +on: [push, pull_request] +env: + OPENSEARCH_VERSION: '3.0.0' + CI: 1 + # avoid warnings like "tput: No value for $TERM and no -T specified" + TERM: xterm + +jobs: + verify-binary-installation: + name: Run binary installation + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + # TODO: add windows support when OSD core is stable on windows + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Branch + uses: actions/checkout@v3 + + - name: Set env + run: | + opensearch_version=$(node -p "require('./opensearch_dashboards.json').opensearchDashboardsVersion") + plugin_version=$(node -p "require('./opensearch_dashboards.json').version") + echo "OPENSEARCH_VERSION=$opensearch_version" >> $GITHUB_ENV + echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV + shell: bash + + - name: Run Opensearch + uses: derek-ho/start-opensearch@v2 + with: + opensearch-version: ${{ env.OPENSEARCH_VERSION }} + security-enabled: false + + - name: Run Dashboard + id: setup-dashboards + uses: derek-ho/setup-opensearch-dashboards@v2 + with: + plugin_name: dashboards-reporting + built_plugin_name: reportsDashboards + built_plugin_suffix: ${{ env.OPENSEARCH_VERSION }} + install_zip: true + + - name: Start the binary + run: | + nohup ./bin/opensearch-dashboards & + working-directory: ${{ steps.setup-dashboards.outputs.dashboards-binary-directory }} + shell: bash + + - name: Health check + run: | + timeout 300 bash -c 'while [[ "$(curl http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done' + shell: bash \ No newline at end of file