Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 16 additions & 46 deletions .github/workflows/cypress-e2e-reporting-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
/<snapshotVersion>/ {in_snap=1; ext=""; val=""; next}
in_snap && /<extension>/ {gsub(/.*<extension>|<\/extension>.*/,""); ext=$0}
in_snap && /<value>/ {gsub(/.*<value>|<\/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 '<extension>zip</extension>' | grep '<value>' | sed 's/.*<value>\(.*\)<\/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 '
/<snapshotVersion>/ {in_snap=1; ext=""; val=""; next}
in_snap && /<extension>/ {gsub(/.*<extension>|<\/extension>.*/,""); ext=$0}
in_snap && /<value>/ {gsub(/.*<value>|<\/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 '<extension>zip</extension>' | grep '<value>' | sed 's/.*<value>\(.*\)<\/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
Expand Down Expand Up @@ -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

Expand Down
43 changes: 30 additions & 13 deletions .github/workflows/dashboards-reports-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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 }}
Expand Down Expand Up @@ -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:
Expand All @@ -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
62 changes: 16 additions & 46 deletions .github/workflows/ftr-e2e-reporting-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
/<snapshotVersion>/ {in_snap=1; ext=""; val=""; next}
in_snap && /<extension>/ {gsub(/.*<extension>|<\/extension>.*/,""); ext=$0}
in_snap && /<value>/ {gsub(/.*<value>|<\/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 '<extension>zip</extension>' | grep '<value>' | sed 's/.*<value>\(.*\)<\/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 '
/<snapshotVersion>/ {in_snap=1; ext=""; val=""; next}
in_snap && /<extension>/ {gsub(/.*<extension>|<\/extension>.*/,""); ext=$0}
in_snap && /<value>/ {gsub(/.*<value>|<\/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 '<extension>zip</extension>' | grep '<value>' | sed 's/.*<value>\(.*\)<\/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
Expand Down Expand Up @@ -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

Expand Down
Loading