From d2a2b5946b06690af9464f6906fcf7c837932395 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Thu, 25 Jan 2024 21:18:10 +0000 Subject: [PATCH 1/2] move gantt-chart directory to root directory Signed-off-by: Joshua Li --- gantt-chart/.babelrc => .babelrc | 0 {gantt-chart/.cypress => .cypress}/.eslintrc.js | 0 {gantt-chart/.cypress => .cypress}/fixtures/jaeger-sample.txt | 0 {gantt-chart/.cypress => .cypress}/integration/ui.spec.js | 0 {gantt-chart/.cypress => .cypress}/plugins/index.js | 0 {gantt-chart/.cypress => .cypress}/support/commands.js | 0 {gantt-chart/.cypress => .cypress}/support/constants.js | 0 {gantt-chart/.cypress => .cypress}/support/index.js | 0 {gantt-chart/.cypress => .cypress}/tsconfig.json | 0 {gantt-chart/.cypress => .cypress}/utils/constants.js | 0 gantt-chart/.eslintignore => .eslintignore | 0 gantt-chart/.eslintrc.js => .eslintrc.js | 0 gantt-chart/.gitignore => .gitignore | 0 ...gin-helpers.json => .opensearch_dashboards-plugin-helpers.json | 0 gantt-chart/cypress.config.js => cypress.config.js | 0 .../opensearch_dashboards.json => opensearch_dashboards.json | 0 gantt-chart/package.json => package.json | 0 {gantt-chart/public => public}/__tests__/gantt_vis_type.test.ts | 0 .../components/__tests__/__snapshots__/gantt_chart.test.tsx.snap | 0 .../__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap | 0 .../__tests__/__snapshots__/options_editor.test.tsx.snap | 0 .../public => public}/components/__tests__/gantt_chart.test.tsx | 0 .../components/__tests__/gantt_chart_editor.test.tsx | 0 .../components/__tests__/options_editor.test.tsx | 0 {gantt-chart/public => public}/components/gantt_chart.tsx | 0 {gantt-chart/public => public}/components/gantt_chart_editor.tsx | 0 {gantt-chart/public => public}/components/options_editor.tsx | 0 {gantt-chart/public => public}/gantt_request_handler.ts | 0 {gantt-chart/public => public}/gantt_vis_type.ts | 0 {gantt-chart/public => public}/index.scss | 0 {gantt-chart/public => public}/index.ts | 0 {gantt-chart/public => public}/plugin.ts | 0 {gantt-chart/server => server}/index.ts | 0 {gantt-chart/server => server}/plugin.ts | 0 {gantt-chart/server => server}/routes/index.ts | 0 {gantt-chart/server => server}/types.ts | 0 {gantt-chart/test => test}/jest.config.js | 0 {gantt-chart/test => test}/mocks/fileMock.ts | 0 {gantt-chart/test => test}/mocks/httpClientMock.ts | 0 {gantt-chart/test => test}/mocks/mockData.ts | 0 {gantt-chart/test => test}/mocks/routerPropsMock.ts | 0 {gantt-chart/test => test}/mocks/styleMock.ts | 0 {gantt-chart/test => test}/setup.jest.ts | 0 {gantt-chart/test => test}/setupTests.ts | 0 gantt-chart/tsconfig.json => tsconfig.json | 0 gantt-chart/yarn.lock => yarn.lock | 0 46 files changed, 0 insertions(+), 0 deletions(-) rename gantt-chart/.babelrc => .babelrc (100%) rename {gantt-chart/.cypress => .cypress}/.eslintrc.js (100%) rename {gantt-chart/.cypress => .cypress}/fixtures/jaeger-sample.txt (100%) rename {gantt-chart/.cypress => .cypress}/integration/ui.spec.js (100%) rename {gantt-chart/.cypress => .cypress}/plugins/index.js (100%) rename {gantt-chart/.cypress => .cypress}/support/commands.js (100%) rename {gantt-chart/.cypress => .cypress}/support/constants.js (100%) rename {gantt-chart/.cypress => .cypress}/support/index.js (100%) rename {gantt-chart/.cypress => .cypress}/tsconfig.json (100%) rename {gantt-chart/.cypress => .cypress}/utils/constants.js (100%) rename gantt-chart/.eslintignore => .eslintignore (100%) rename gantt-chart/.eslintrc.js => .eslintrc.js (100%) rename gantt-chart/.gitignore => .gitignore (100%) rename gantt-chart/.opensearch_dashboards-plugin-helpers.json => .opensearch_dashboards-plugin-helpers.json (100%) rename gantt-chart/cypress.config.js => cypress.config.js (100%) rename gantt-chart/opensearch_dashboards.json => opensearch_dashboards.json (100%) rename gantt-chart/package.json => package.json (100%) rename {gantt-chart/public => public}/__tests__/gantt_vis_type.test.ts (100%) rename {gantt-chart/public => public}/components/__tests__/__snapshots__/gantt_chart.test.tsx.snap (100%) rename {gantt-chart/public => public}/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap (100%) rename {gantt-chart/public => public}/components/__tests__/__snapshots__/options_editor.test.tsx.snap (100%) rename {gantt-chart/public => public}/components/__tests__/gantt_chart.test.tsx (100%) rename {gantt-chart/public => public}/components/__tests__/gantt_chart_editor.test.tsx (100%) rename {gantt-chart/public => public}/components/__tests__/options_editor.test.tsx (100%) rename {gantt-chart/public => public}/components/gantt_chart.tsx (100%) rename {gantt-chart/public => public}/components/gantt_chart_editor.tsx (100%) rename {gantt-chart/public => public}/components/options_editor.tsx (100%) rename {gantt-chart/public => public}/gantt_request_handler.ts (100%) rename {gantt-chart/public => public}/gantt_vis_type.ts (100%) rename {gantt-chart/public => public}/index.scss (100%) rename {gantt-chart/public => public}/index.ts (100%) rename {gantt-chart/public => public}/plugin.ts (100%) rename {gantt-chart/server => server}/index.ts (100%) rename {gantt-chart/server => server}/plugin.ts (100%) rename {gantt-chart/server => server}/routes/index.ts (100%) rename {gantt-chart/server => server}/types.ts (100%) rename {gantt-chart/test => test}/jest.config.js (100%) rename {gantt-chart/test => test}/mocks/fileMock.ts (100%) rename {gantt-chart/test => test}/mocks/httpClientMock.ts (100%) rename {gantt-chart/test => test}/mocks/mockData.ts (100%) rename {gantt-chart/test => test}/mocks/routerPropsMock.ts (100%) rename {gantt-chart/test => test}/mocks/styleMock.ts (100%) rename {gantt-chart/test => test}/setup.jest.ts (100%) rename {gantt-chart/test => test}/setupTests.ts (100%) rename gantt-chart/tsconfig.json => tsconfig.json (100%) rename gantt-chart/yarn.lock => yarn.lock (100%) diff --git a/gantt-chart/.babelrc b/.babelrc similarity index 100% rename from gantt-chart/.babelrc rename to .babelrc diff --git a/gantt-chart/.cypress/.eslintrc.js b/.cypress/.eslintrc.js similarity index 100% rename from gantt-chart/.cypress/.eslintrc.js rename to .cypress/.eslintrc.js diff --git a/gantt-chart/.cypress/fixtures/jaeger-sample.txt b/.cypress/fixtures/jaeger-sample.txt similarity index 100% rename from gantt-chart/.cypress/fixtures/jaeger-sample.txt rename to .cypress/fixtures/jaeger-sample.txt diff --git a/gantt-chart/.cypress/integration/ui.spec.js b/.cypress/integration/ui.spec.js similarity index 100% rename from gantt-chart/.cypress/integration/ui.spec.js rename to .cypress/integration/ui.spec.js diff --git a/gantt-chart/.cypress/plugins/index.js b/.cypress/plugins/index.js similarity index 100% rename from gantt-chart/.cypress/plugins/index.js rename to .cypress/plugins/index.js diff --git a/gantt-chart/.cypress/support/commands.js b/.cypress/support/commands.js similarity index 100% rename from gantt-chart/.cypress/support/commands.js rename to .cypress/support/commands.js diff --git a/gantt-chart/.cypress/support/constants.js b/.cypress/support/constants.js similarity index 100% rename from gantt-chart/.cypress/support/constants.js rename to .cypress/support/constants.js diff --git a/gantt-chart/.cypress/support/index.js b/.cypress/support/index.js similarity index 100% rename from gantt-chart/.cypress/support/index.js rename to .cypress/support/index.js diff --git a/gantt-chart/.cypress/tsconfig.json b/.cypress/tsconfig.json similarity index 100% rename from gantt-chart/.cypress/tsconfig.json rename to .cypress/tsconfig.json diff --git a/gantt-chart/.cypress/utils/constants.js b/.cypress/utils/constants.js similarity index 100% rename from gantt-chart/.cypress/utils/constants.js rename to .cypress/utils/constants.js diff --git a/gantt-chart/.eslintignore b/.eslintignore similarity index 100% rename from gantt-chart/.eslintignore rename to .eslintignore diff --git a/gantt-chart/.eslintrc.js b/.eslintrc.js similarity index 100% rename from gantt-chart/.eslintrc.js rename to .eslintrc.js diff --git a/gantt-chart/.gitignore b/.gitignore similarity index 100% rename from gantt-chart/.gitignore rename to .gitignore diff --git a/gantt-chart/.opensearch_dashboards-plugin-helpers.json b/.opensearch_dashboards-plugin-helpers.json similarity index 100% rename from gantt-chart/.opensearch_dashboards-plugin-helpers.json rename to .opensearch_dashboards-plugin-helpers.json diff --git a/gantt-chart/cypress.config.js b/cypress.config.js similarity index 100% rename from gantt-chart/cypress.config.js rename to cypress.config.js diff --git a/gantt-chart/opensearch_dashboards.json b/opensearch_dashboards.json similarity index 100% rename from gantt-chart/opensearch_dashboards.json rename to opensearch_dashboards.json diff --git a/gantt-chart/package.json b/package.json similarity index 100% rename from gantt-chart/package.json rename to package.json diff --git a/gantt-chart/public/__tests__/gantt_vis_type.test.ts b/public/__tests__/gantt_vis_type.test.ts similarity index 100% rename from gantt-chart/public/__tests__/gantt_vis_type.test.ts rename to public/__tests__/gantt_vis_type.test.ts diff --git a/gantt-chart/public/components/__tests__/__snapshots__/gantt_chart.test.tsx.snap b/public/components/__tests__/__snapshots__/gantt_chart.test.tsx.snap similarity index 100% rename from gantt-chart/public/components/__tests__/__snapshots__/gantt_chart.test.tsx.snap rename to public/components/__tests__/__snapshots__/gantt_chart.test.tsx.snap diff --git a/gantt-chart/public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap b/public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap similarity index 100% rename from gantt-chart/public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap rename to public/components/__tests__/__snapshots__/gantt_chart_editor.test.tsx.snap diff --git a/gantt-chart/public/components/__tests__/__snapshots__/options_editor.test.tsx.snap b/public/components/__tests__/__snapshots__/options_editor.test.tsx.snap similarity index 100% rename from gantt-chart/public/components/__tests__/__snapshots__/options_editor.test.tsx.snap rename to public/components/__tests__/__snapshots__/options_editor.test.tsx.snap diff --git a/gantt-chart/public/components/__tests__/gantt_chart.test.tsx b/public/components/__tests__/gantt_chart.test.tsx similarity index 100% rename from gantt-chart/public/components/__tests__/gantt_chart.test.tsx rename to public/components/__tests__/gantt_chart.test.tsx diff --git a/gantt-chart/public/components/__tests__/gantt_chart_editor.test.tsx b/public/components/__tests__/gantt_chart_editor.test.tsx similarity index 100% rename from gantt-chart/public/components/__tests__/gantt_chart_editor.test.tsx rename to public/components/__tests__/gantt_chart_editor.test.tsx diff --git a/gantt-chart/public/components/__tests__/options_editor.test.tsx b/public/components/__tests__/options_editor.test.tsx similarity index 100% rename from gantt-chart/public/components/__tests__/options_editor.test.tsx rename to public/components/__tests__/options_editor.test.tsx diff --git a/gantt-chart/public/components/gantt_chart.tsx b/public/components/gantt_chart.tsx similarity index 100% rename from gantt-chart/public/components/gantt_chart.tsx rename to public/components/gantt_chart.tsx diff --git a/gantt-chart/public/components/gantt_chart_editor.tsx b/public/components/gantt_chart_editor.tsx similarity index 100% rename from gantt-chart/public/components/gantt_chart_editor.tsx rename to public/components/gantt_chart_editor.tsx diff --git a/gantt-chart/public/components/options_editor.tsx b/public/components/options_editor.tsx similarity index 100% rename from gantt-chart/public/components/options_editor.tsx rename to public/components/options_editor.tsx diff --git a/gantt-chart/public/gantt_request_handler.ts b/public/gantt_request_handler.ts similarity index 100% rename from gantt-chart/public/gantt_request_handler.ts rename to public/gantt_request_handler.ts diff --git a/gantt-chart/public/gantt_vis_type.ts b/public/gantt_vis_type.ts similarity index 100% rename from gantt-chart/public/gantt_vis_type.ts rename to public/gantt_vis_type.ts diff --git a/gantt-chart/public/index.scss b/public/index.scss similarity index 100% rename from gantt-chart/public/index.scss rename to public/index.scss diff --git a/gantt-chart/public/index.ts b/public/index.ts similarity index 100% rename from gantt-chart/public/index.ts rename to public/index.ts diff --git a/gantt-chart/public/plugin.ts b/public/plugin.ts similarity index 100% rename from gantt-chart/public/plugin.ts rename to public/plugin.ts diff --git a/gantt-chart/server/index.ts b/server/index.ts similarity index 100% rename from gantt-chart/server/index.ts rename to server/index.ts diff --git a/gantt-chart/server/plugin.ts b/server/plugin.ts similarity index 100% rename from gantt-chart/server/plugin.ts rename to server/plugin.ts diff --git a/gantt-chart/server/routes/index.ts b/server/routes/index.ts similarity index 100% rename from gantt-chart/server/routes/index.ts rename to server/routes/index.ts diff --git a/gantt-chart/server/types.ts b/server/types.ts similarity index 100% rename from gantt-chart/server/types.ts rename to server/types.ts diff --git a/gantt-chart/test/jest.config.js b/test/jest.config.js similarity index 100% rename from gantt-chart/test/jest.config.js rename to test/jest.config.js diff --git a/gantt-chart/test/mocks/fileMock.ts b/test/mocks/fileMock.ts similarity index 100% rename from gantt-chart/test/mocks/fileMock.ts rename to test/mocks/fileMock.ts diff --git a/gantt-chart/test/mocks/httpClientMock.ts b/test/mocks/httpClientMock.ts similarity index 100% rename from gantt-chart/test/mocks/httpClientMock.ts rename to test/mocks/httpClientMock.ts diff --git a/gantt-chart/test/mocks/mockData.ts b/test/mocks/mockData.ts similarity index 100% rename from gantt-chart/test/mocks/mockData.ts rename to test/mocks/mockData.ts diff --git a/gantt-chart/test/mocks/routerPropsMock.ts b/test/mocks/routerPropsMock.ts similarity index 100% rename from gantt-chart/test/mocks/routerPropsMock.ts rename to test/mocks/routerPropsMock.ts diff --git a/gantt-chart/test/mocks/styleMock.ts b/test/mocks/styleMock.ts similarity index 100% rename from gantt-chart/test/mocks/styleMock.ts rename to test/mocks/styleMock.ts diff --git a/gantt-chart/test/setup.jest.ts b/test/setup.jest.ts similarity index 100% rename from gantt-chart/test/setup.jest.ts rename to test/setup.jest.ts diff --git a/gantt-chart/test/setupTests.ts b/test/setupTests.ts similarity index 100% rename from gantt-chart/test/setupTests.ts rename to test/setupTests.ts diff --git a/gantt-chart/tsconfig.json b/tsconfig.json similarity index 100% rename from gantt-chart/tsconfig.json rename to tsconfig.json diff --git a/gantt-chart/yarn.lock b/yarn.lock similarity index 100% rename from gantt-chart/yarn.lock rename to yarn.lock From 03cd36408fd7e87b9d1c095272fa8b3bcbc3c13b Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Thu, 25 Jan 2024 21:24:28 +0000 Subject: [PATCH 2/2] update workflow and readme Signed-off-by: Joshua Li --- .../cypress-e2e-gantt-chart-test.yml | 36 ++++----- .../workflows/ftr-e2e-gantt-chart-test.yml | 7 +- .github/workflows/lint.yml | 28 +++---- .github/workflows/test-and-build-workflow.yml | 77 +++++++++---------- DEVELOPER_GUIDE.md | 10 +-- 5 files changed, 70 insertions(+), 88 deletions(-) diff --git a/.github/workflows/cypress-e2e-gantt-chart-test.yml b/.github/workflows/cypress-e2e-gantt-chart-test.yml index 3a4c260..39163c2 100644 --- a/.github/workflows/cypress-e2e-gantt-chart-test.yml +++ b/.github/workflows/cypress-e2e-gantt-chart-test.yml @@ -25,37 +25,34 @@ jobs: uses: actions/setup-java@v1 with: java-version: ${{ matrix.jdk }} - - - name: Checkout Plugin - uses: actions/checkout@v2 - name: Download OpenSearch uses: peternied/download-file@v2 with: url: https://artifacts.opensearch.org/snapshots/core/opensearch/${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/opensearch-min-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz - + - name: Extract OpenSearch run: | tar -xzf opensearch-*.tar.gz rm -f opensearch-*.tar.gz shell: bash - + - name: Run OpenSearch run: | /bin/bash -c "./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/bin/opensearch &" sleep 30 shell: bash - + - name: Check OpenSearch Running on Linux if: ${{ runner.os != 'Windows'}} run: curl http://localhost:9200/ shell: bash - + - name: Show OpenSearch Logs if: always() run: cat ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/logs/opensearch.log shell: bash - + - name: Checkout OpenSearch Dashboards uses: actions/checkout@v2 with: @@ -67,9 +64,10 @@ jobs: cypress test - - name: Install Gantt Chart to Opensearch Dashboards Plugins Dir - run: | - mv gantt-chart ./OpenSearch-Dashboards/plugins + - name: Checkout Plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/dashboards-visualizations - id: tool-versions run: | @@ -97,7 +95,7 @@ jobs: run: | yarn osd bootstrap working-directory: OpenSearch-Dashboards - + - name: Run Opensearch Dashboards with Gantt Chart Installed run: | nohup yarn start --no-base-path --no-watch | tee dashboard.log & @@ -118,29 +116,29 @@ jobs: run: | npx cypress install shell: bash - working-directory: OpenSearch-Dashboards/plugins/gantt-chart + working-directory: OpenSearch-Dashboards/plugins/dashboards-visualizations - name: Get Cypress version id: cypress_version run: | echo "::set-output name=cypress_version::$(cat ./package.json | jq '.dependencies.cypress' | tr -d '"')" - working-directory: OpenSearch-Dashboards/plugins/gantt-chart + working-directory: OpenSearch-Dashboards/plugins/dashboards-visualizations - name: Run Cypress tests run: | yarn cypress:run --browser chrome --headless --spec '.cypress/integration/${{ matrix.testgroups }}/*' - working-directory: OpenSearch-Dashboards/plugins/gantt-chart - + working-directory: OpenSearch-Dashboards/plugins/dashboards-visualizations + - name: Capture failure screenshots uses: actions/upload-artifact@v1 if: failure() with: name: cypress-screenshots-${{ matrix.os }} - path: OpenSearch-Dashboards/plugins/gantt-chart/.cypress/screenshots - + path: OpenSearch-Dashboards/plugins/dashboards-visualizations/.cypress/screenshots + - name: Capture test video uses: actions/upload-artifact@v1 if: failure() with: name: cypress-videos-${{ matrix.os }} - path: OpenSearch-Dashboards/plugins/gantt-chart/.cypress/videos + path: OpenSearch-Dashboards/plugins/dashboards-visualizations/.cypress/videos diff --git a/.github/workflows/ftr-e2e-gantt-chart-test.yml b/.github/workflows/ftr-e2e-gantt-chart-test.yml index 23d568f..dde2a82 100644 --- a/.github/workflows/ftr-e2e-gantt-chart-test.yml +++ b/.github/workflows/ftr-e2e-gantt-chart-test.yml @@ -67,9 +67,10 @@ jobs: cypress test - - name: Install Gantt Chart to Opensearch Dashboards Plugins Dir - run: | - mv gantt-chart ./OpenSearch-Dashboards/plugins + - name: Checkout Plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/dashboards-visualizations - id: tool-versions run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5f5995a..1bed4a8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,9 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout Plugin - uses: actions/checkout@v2 - - name: Checkout OpenSearch Dashboards uses: actions/checkout@v2 with: @@ -22,9 +19,10 @@ jobs: ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards - - name: Install Gantt Chart to Opensearch Dashboards Plugins Dir - run: | - mv gantt-chart ./OpenSearch-Dashboards/plugins + - name: Checkout Plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/dashboards-visualizations - name: Get node and yarn versions working-directory: ${{ env.WORKING_DIR }} @@ -46,7 +44,7 @@ jobs: npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} - name: Bootstrap the plugin - working-directory: OpenSearch-Dashboards/plugins/gantt-chart + working-directory: OpenSearch-Dashboards/plugins/dashboards-visualizations run: yarn osd bootstrap - name: Get list of changed files using GitHub Action @@ -63,18 +61,12 @@ jobs: - name: Lint Changed Files run: | - jq -r '.[]' ${HOME}/files_modified.json ${HOME}/files_added.json | sort | uniq > /tmp/changed_files.txt - CHANGED_FILES=$(cat /tmp/changed_files.txt) - echo "These are the changed files: $CHANGED_FILES" + CHANGED_FILES=($(jq -r '.[]' ${HOME}/files_modified.json ${HOME}/files_added.json | grep '.\+.\(js\|ts\|tsx\)$' | sort -u)) if [[ -n "$CHANGED_FILES" ]]; then - echo "Linting changed files..." - while IFS= read -r file; do - if [[ $file =~ ^gantt-chart/.+\.(js|ts|tsx)$ ]]; then - echo "linting file $file" - yarn lint "../$file" - fi - done < /tmp/changed_files.txt + echo 'These are the changed files:' + printf '%s\n' "${CHANGED_FILES[@]}" + yarn lint "${CHANGED_FILES[@]}" else echo "No matched files to lint." fi - working-directory: OpenSearch-Dashboards/plugins/gantt-chart + working-directory: OpenSearch-Dashboards/plugins/dashboards-visualizations diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index ae3fe08..10e1356 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -25,38 +25,36 @@ jobs: options: --user root steps: - - name: Checkout Plugin - uses: actions/checkout@v2 - - name: Checkout OpenSearch Dashboards uses: actions/checkout@v2 with: repository: opensearch-project/Opensearch-Dashboards ref: ${{ env.OPENSEARCH_VERSION }} - path: dashboards-visualizations/OpenSearch-Dashboards + path: OpenSearch-Dashboards - - name: Move Gantt Chart to Plugins Dir - run: | - mv gantt-chart ./dashboards-visualizations/OpenSearch-Dashboards/plugins + - name: Checkout Plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/dashboards-visualizations - name: Plugin Bootstrap / stylelint / test run: | chown -R 1000:1000 `pwd` - cd dashboards-visualizations/OpenSearch-Dashboards/ + cd OpenSearch-Dashboards/ su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v && - cd ./plugins/gantt-chart && + cd ./plugins/dashboards-visualizations && whoami && yarn osd bootstrap && yarn lint:style && yarn test --coverage" - name: Upload coverage uses: codecov/codecov-action@v1 with: - directory: ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + directory: ./OpenSearch-Dashboards/plugins/dashboards-visualizations token: ${{ secrets.CODECOV_TOKEN }} - name: Build Artifact run: | chown -R 1000:1000 `pwd` - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v && yarn build" mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip @@ -64,14 +62,12 @@ jobs: uses: actions/upload-artifact@v1 with: name: gantt-chart-ubuntu - path: ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart/build + path: ./OpenSearch-Dashboards/plugins/dashboards-visualizations/build windows-build: runs-on: windows-latest steps: - - name: Checkout Plugin - uses: actions/checkout@v2 # Enable longer filenames for windows - name: Enable longer filenames run: git config --system core.longpaths true @@ -81,47 +77,48 @@ jobs: with: repository: opensearch-project/Opensearch-Dashboards ref: ${{ env.OPENSEARCH_VERSION }} - path: dashboards-visualizations/OpenSearch-Dashboards + path: OpenSearch-Dashboards + + - name: Checkout Plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/dashboards-visualizations - name: Setup Node uses: actions/setup-node@v3 with: - node-version-file: './dashboards-visualizations/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('./dashboards-visualizations/OpenSearch-Dashboards/package.json').engines.yarn") + 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: Move Gantt Chart to Plugins Dir - run: | - mv gantt-chart ./dashboards-visualizations/OpenSearch-Dashboards/plugins - - name: Plugin Bootstrap run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn osd bootstrap - name: Run Stylelint run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn lint:style - name: Test run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn test - name: Build Artifact run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip @@ -129,62 +126,60 @@ jobs: uses: actions/upload-artifact@v1 with: name: gantt-chart-windows - path: ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart/build + path: ./OpenSearch-Dashboards/plugins/dashboards-visualizations/build macos-build: runs-on: macos-latest steps: - - name: Checkout Plugin - uses: actions/checkout@v2 - - name: Checkout OpenSearch Dashboards uses: actions/checkout@v2 with: repository: opensearch-project/Opensearch-Dashboards ref: ${{ env.OPENSEARCH_VERSION }} - path: dashboards-visualizations/OpenSearch-Dashboards + path: OpenSearch-Dashboards + + - name: Checkout Plugin + uses: actions/checkout@v2 + with: + path: OpenSearch-Dashboards/plugins/dashboards-visualizations - name: Setup Node uses: actions/setup-node@v3 with: - node-version-file: './dashboards-visualizations/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('./dashboards-visualizations/OpenSearch-Dashboards/package.json').engines.yarn") + 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: Move Gantt Chart to Plugins Dir - run: | - mv gantt-chart ./dashboards-visualizations/OpenSearch-Dashboards/plugins - - name: Plugin Bootstrap run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn osd bootstrap - name: Run Stylelint run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn lint:style - name: Test run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn test - name: Build Artifact run: | - cd ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart + cd ./OpenSearch-Dashboards/plugins/dashboards-visualizations yarn build mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip @@ -192,6 +187,6 @@ jobs: uses: actions/upload-artifact@v1 with: name: gantt-chart-macos - path: ./dashboards-visualizations/OpenSearch-Dashboards/plugins/gantt-chart/build + path: ./OpenSearch-Dashboards/plugins/dashboards-visualizations/build diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 3ebf0ad..fc31cb3 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -11,12 +11,8 @@ So you want to contribute code to this project? Excellent! We're glad you're her 1. cd into the OpenSearch Dashboards source code directory. 1. Check out this package from version control into the `plugins` directory. ``` -rm plugins -r -git clone git@github.com:opensearch-project/dashboards-visualizations.git plugins --no-checkout cd plugins -echo 'gantt-chart/*' >> .git/info/sparse-checkout -git config core.sparseCheckout true -git checkout main +git clone git@github.com:opensearch-project/dashboards-visualizations.git ``` 6. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards` directory. @@ -26,7 +22,7 @@ Ultimately, your directory structure should look like this: . ├── OpenSearch Dashboards │ └── plugins -│ └── gantt-chart +│ └── dashboards-visualizations ``` @@ -57,4 +53,4 @@ The Github workflow in [`backport.yml`](.github/workflows/backport.yml) creates with an appropriate label `backport ` is merged to main with the backport workflow run successfully on the PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR -to the `1.x` branch. \ No newline at end of file +to the `1.x` branch.