diff --git a/.github/workflows/cypress-e2e-reporting-test.yml b/.github/workflows/cypress-e2e-reporting-test.yml index c0ef0e25..fce900cd 100644 --- a/.github/workflows/cypress-e2e-reporting-test.yml +++ b/.github/workflows/cypress-e2e-reporting-test.yml @@ -47,65 +47,33 @@ jobs: shell: bash working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - - name: Download Job Scheduler artifact (latest snapshot from ci.opensearch.org) + - name: Download Job Scheduler artifact shell: bash run: | - set -euo pipefail - BASE="https://ci.opensearch.org/ci/dbc/snapshots/maven" - GROUP="org.opensearch.plugin" + GROUP_PATH="org/opensearch/plugin" ARTIFACT="opensearch-job-scheduler" VERSION="${{ env.PLUGIN_VERSION }}-SNAPSHOT" - - GROUP_PATH="${GROUP//./\/}" - DIR_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION" - - SNAPSHOT_VALUE="$( - curl -fsSL "$DIR_URL/maven-metadata.xml" \ - | awk ' - // {in_snap=1; ext=""; val=""; next} - in_snap && // {gsub(/.*|<\/extension>.*/,""); ext=$0} - in_snap && // {gsub(/.*|<\/value>.*/,""); val=$0} - in_snap && /<\/snapshotVersion>/ { - if (ext=="zip" && val!="") { print val; exit } - in_snap=0 - } - ' - )" - - FILE="$ARTIFACT-$SNAPSHOT_VALUE.zip" + + METADATA_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/maven-metadata.xml" + SNAPSHOT_VALUE=$(curl -fsSL "$METADATA_URL" | grep -A1 'zip' | grep '' | sed 's/.*\(.*\)<\/value>.*/\1/') + mkdir -p plugin-artifacts - curl -fL --retry 5 --retry-delay 2 -o plugin-artifacts/job-scheduler.zip "$DIR_URL/$FILE" + curl -fL --retry 5 -o plugin-artifacts/job-scheduler.zip "$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/$ARTIFACT-$SNAPSHOT_VALUE.zip" - - name: Download Reports Scheduler artifact (latest snapshot from ci.opensearch.org) + - name: Download Reports Scheduler artifact shell: bash run: | - set -euo pipefail - BASE="https://ci.opensearch.org/ci/dbc/snapshots/maven" - GROUP="org.opensearch.plugin" + GROUP_PATH="org/opensearch/plugin" ARTIFACT="opensearch-reports-scheduler" VERSION="${{ env.PLUGIN_VERSION }}-SNAPSHOT" - - GROUP_PATH="${GROUP//./\/}" - DIR_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION" - - SNAPSHOT_VALUE="$( - curl -fsSL "$DIR_URL/maven-metadata.xml" \ - | awk ' - // {in_snap=1; ext=""; val=""; next} - in_snap && // {gsub(/.*|<\/extension>.*/,""); ext=$0} - in_snap && // {gsub(/.*|<\/value>.*/,""); val=$0} - in_snap && /<\/snapshotVersion>/ { - if (ext=="zip" && val!="") { print val; exit } - in_snap=0 - } - ' - )" - - FILE="$ARTIFACT-$SNAPSHOT_VALUE.zip" + + METADATA_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/maven-metadata.xml" + SNAPSHOT_VALUE=$(curl -fsSL "$METADATA_URL" | grep -A1 'zip' | grep '' | sed 's/.*\(.*\)<\/value>.*/\1/') + mkdir -p plugin-artifacts - curl -fL --retry 5 --retry-delay 2 -o plugin-artifacts/reports-scheduler.zip "$DIR_URL/$FILE" + curl -fL --retry 5 -o plugin-artifacts/reports-scheduler.zip "$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/$ARTIFACT-$SNAPSHOT_VALUE.zip" - name: Download OpenSearch uses: peternied/download-file@v2 @@ -172,6 +140,8 @@ jobs: - name: Run Opensearch Dashboards with Dashboards Reporting Plugin Installed run: | + echo "home.disableWelcomeScreen: true" >> config/opensearch_dashboards.yml + echo "home.disableExperienceModal: true" >> config/opensearch_dashboards.yml nohup yarn start --no-base-path --no-watch | tee dashboard.log & working-directory: OpenSearch-Dashboards diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index d1bf0960..c8e51543 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -6,7 +6,6 @@ env: PLUGIN_NAME: reportsDashboards ARTIFACT_NAME: reports-dashboards OPENSEARCH_DASHBOARDS_VERSION: 'main' - OPENSEARCH_PLUGIN_VERSION: '3.5.0.0' jobs: Get-CI-Image-Tag: @@ -37,6 +36,15 @@ jobs: with: path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} + - 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 + working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} + - name: OpenSearch Dashboards Plugin Bootstrap and test uses: nick-fields/retry@v1 with: @@ -45,10 +53,10 @@ jobs: command: | chown -R 1000:1000 `pwd` cd ./OpenSearch-Dashboards/ - su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm install \$(cat .nvmrc) && node -v && - YARN_VERSION=\$(node -p \"require('./package.json').engines.yarn\") && - npm i -g yarn@\$YARN_VERSION && yarn -v && - cd ./plugins/${{ env.PLUGIN_NAME }} && + su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm install && nvm use && \ + npm i -g corepack && corepack install && \ + node -v && yarn -v && \ + cd ./plugins/${{ env.PLUGIN_NAME }} && \ whoami && yarn osd bootstrap --single-version=loose && yarn test --coverage" - name: Upload coverage @@ -62,17 +70,17 @@ jobs: run: | chown -R 1000:1000 `pwd` cd ./OpenSearch-Dashboards/ - su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm install \$(cat .nvmrc) && node -v && - YARN_VERSION=\$(node -p \"require('./package.json').engines.yarn\") && - npm i -g yarn@\$YARN_VERSION && yarn -v && - cd ./plugins/${{ env.PLUGIN_NAME }} && - whoami && yarn build && mv -v ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip" + su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm install && nvm use && \ + npm i -g corepack && corepack install && \ + node -v && yarn -v && \ + cd ./plugins/${{ env.PLUGIN_NAME }} && \ + whoami && yarn build && mv -v ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.PLUGIN_VERSION }}.zip" - name: Upload Artifact For Linux uses: actions/upload-artifact@v4.4.0 with: name: dashboards-reports-linux - path: ./OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip + path: ./OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.PLUGIN_VERSION }}.zip windows-mac-builds: runs-on: ${{ matrix.os }} @@ -113,6 +121,15 @@ jobs: with: path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} + - 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 + working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} + - name: OpenSearch Dashboards Plugin Bootstrap uses: nick-fields/retry@v1 with: @@ -130,10 +147,10 @@ jobs: - name: Build Artifact run: | cd ./OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn build - mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-${{ runner.os }}.zip + mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.PLUGIN_VERSION }}-${{ runner.os }}.zip - name: Upload Artifact uses: actions/upload-artifact@v4.4.0 with: name: dashboards-reports-${{ runner.os }} - path: ./OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-${{ runner.os }}.zip + path: ./OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.PLUGIN_VERSION }}-${{ runner.os }}.zip diff --git a/.github/workflows/ftr-e2e-reporting-test.yml b/.github/workflows/ftr-e2e-reporting-test.yml index 75e78011..6580d7a0 100644 --- a/.github/workflows/ftr-e2e-reporting-test.yml +++ b/.github/workflows/ftr-e2e-reporting-test.yml @@ -47,65 +47,33 @@ jobs: shell: bash working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - - name: Download Job Scheduler artifact (latest snapshot from ci.opensearch.org) + - name: Download Job Scheduler artifact shell: bash run: | - set -euo pipefail - BASE="https://ci.opensearch.org/ci/dbc/snapshots/maven" - GROUP="org.opensearch.plugin" + GROUP_PATH="org/opensearch/plugin" ARTIFACT="opensearch-job-scheduler" VERSION="${{ env.PLUGIN_VERSION }}-SNAPSHOT" - - GROUP_PATH="${GROUP//./\/}" - DIR_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION" - - SNAPSHOT_VALUE="$( - curl -fsSL "$DIR_URL/maven-metadata.xml" \ - | awk ' - // {in_snap=1; ext=""; val=""; next} - in_snap && // {gsub(/.*|<\/extension>.*/,""); ext=$0} - in_snap && // {gsub(/.*|<\/value>.*/,""); val=$0} - in_snap && /<\/snapshotVersion>/ { - if (ext=="zip" && val!="") { print val; exit } - in_snap=0 - } - ' - )" - - FILE="$ARTIFACT-$SNAPSHOT_VALUE.zip" + + METADATA_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/maven-metadata.xml" + SNAPSHOT_VALUE=$(curl -fsSL "$METADATA_URL" | grep -A1 'zip' | grep '' | sed 's/.*\(.*\)<\/value>.*/\1/') + mkdir -p plugin-artifacts - curl -fL --retry 5 --retry-delay 2 -o plugin-artifacts/job-scheduler.zip "$DIR_URL/$FILE" + curl -fL --retry 5 -o plugin-artifacts/job-scheduler.zip "$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/$ARTIFACT-$SNAPSHOT_VALUE.zip" - - name: Download Reports Scheduler artifact (latest snapshot from ci.opensearch.org) + - name: Download Reports Scheduler artifact shell: bash run: | - set -euo pipefail - BASE="https://ci.opensearch.org/ci/dbc/snapshots/maven" - GROUP="org.opensearch.plugin" + GROUP_PATH="org/opensearch/plugin" ARTIFACT="opensearch-reports-scheduler" VERSION="${{ env.PLUGIN_VERSION }}-SNAPSHOT" - - GROUP_PATH="${GROUP//./\/}" - DIR_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION" - - SNAPSHOT_VALUE="$( - curl -fsSL "$DIR_URL/maven-metadata.xml" \ - | awk ' - // {in_snap=1; ext=""; val=""; next} - in_snap && // {gsub(/.*|<\/extension>.*/,""); ext=$0} - in_snap && // {gsub(/.*|<\/value>.*/,""); val=$0} - in_snap && /<\/snapshotVersion>/ { - if (ext=="zip" && val!="") { print val; exit } - in_snap=0 - } - ' - )" - - FILE="$ARTIFACT-$SNAPSHOT_VALUE.zip" + + METADATA_URL="$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/maven-metadata.xml" + SNAPSHOT_VALUE=$(curl -fsSL "$METADATA_URL" | grep -A1 'zip' | grep '' | sed 's/.*\(.*\)<\/value>.*/\1/') + mkdir -p plugin-artifacts - curl -fL --retry 5 --retry-delay 2 -o plugin-artifacts/reports-scheduler.zip "$DIR_URL/$FILE" + curl -fL --retry 5 -o plugin-artifacts/reports-scheduler.zip "$BASE/$GROUP_PATH/$ARTIFACT/$VERSION/$ARTIFACT-$SNAPSHOT_VALUE.zip" - name: Download OpenSearch uses: peternied/download-file@v2 @@ -172,6 +140,8 @@ jobs: - name: Run Opensearch Dashboards with Dashboards Reporting Plugin Installed run: | + echo "home.disableWelcomeScreen: true" >> config/opensearch_dashboards.yml + echo "home.disableExperienceModal: true" >> config/opensearch_dashboards.yml nohup yarn start --no-base-path --no-watch | tee dashboard.log & working-directory: OpenSearch-Dashboards