From 7162f624fa3027d670ae702f0f850d87cac7f756 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Wed, 29 Nov 2023 18:03:09 +0800 Subject: [PATCH 1/4] Fix: CI flow on windows main (#145) * feat: remove useless step Signed-off-by: SuZhou-Joe * feat: add opensearch logs Signed-off-by: SuZhou-Joe * feat: update Signed-off-by: SuZhou-Joe * feat: add more requestTimeout Signed-off-by: SuZhou-Joe --------- Signed-off-by: SuZhou-Joe Co-authored-by: Hailong Cui (cherry picked from commit 15c0b72ac44919d691dc459fc61d1f6d6983318c) --- ...t-and-build-workflow-prod-docker-linux.yml | 7 ------- ...-notifications-test-and-build-workflow.yml | 19 +++++++++---------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dashboards-notifications-test-and-build-workflow-prod-docker-linux.yml b/.github/workflows/dashboards-notifications-test-and-build-workflow-prod-docker-linux.yml index 317c7ad3..3022999d 100644 --- a/.github/workflows/dashboards-notifications-test-and-build-workflow-prod-docker-linux.yml +++ b/.github/workflows/dashboards-notifications-test-and-build-workflow-prod-docker-linux.yml @@ -53,13 +53,6 @@ jobs: distribution: temurin # Temurin is a distribution of adoptium java-version: 11 - - name: Checkout Plugin - uses: actions/checkout@v2 - with: - path: notifications - repository: opensearch-project/notifications - ref: '2.x' - - name: Check out the notifications repo uses: actions/checkout@v2 with: diff --git a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml index 7039b0b4..6a9205fc 100644 --- a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml @@ -49,13 +49,6 @@ jobs: with: java-version: 11 - - name: Checkout Plugin - uses: actions/checkout@v2 - with: - path: notifications - repository: opensearch-project/notifications - ref: '2.x' - # This is a hack, but this step creates a link to the X: mounted drive, which makes the path # short enough to work on Windows - name: Shorten Path @@ -72,7 +65,7 @@ jobs: brew install coreutils fi cd notifications/notifications - ./gradlew run -x integTest -x jacocoTestReport & + ./gradlew run -x integTest -x jacocoTestReport | tee -a opensearch.log & timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done' shell: bash env: @@ -136,8 +129,8 @@ jobs: - name: Run OpenSearch Dashboards server run: | - cd OpenSearch-Dashboards - yarn start --no-base-path --no-watch --server.host="0.0.0.0" & + cd ./OpenSearch-Dashboards + yarn start --no-base-path --no-watch --server.host="0.0.0.0" --opensearch.requestTimeout=120000 & timeout 900 bash -c 'while [[ "$(curl -s http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do echo sleeping 5; sleep 5; done' curl -sk localhost:5601/api/status | jq netstat -anp tcp | grep LISTEN | grep 5601 || netstat -ntlp | grep 5601 @@ -191,6 +184,12 @@ jobs: name: cypress-screenshots-${{ matrix.os }} path: OpenSearch-Dashboards/plugins/dashboards-notifications/.cypress/screenshots + - uses: actions/upload-artifact@v1 + if: always() + with: + name: opensearch-logs-${{ matrix.os }} + path: notifications/notifications/opensearch.log + # Test run video was always captured, so this action uses "always()" condition - uses: actions/upload-artifact@v1 if: always() From 2050bb367b8a2178a9a40c3a092553bab493c27e Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Wed, 29 Nov 2023 18:13:43 +0800 Subject: [PATCH 2/4] feat: add missing step Signed-off-by: SuZhou-Joe --- ...oards-notifications-test-and-build-workflow.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml index 6a9205fc..14d4ce6f 100644 --- a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml @@ -56,6 +56,20 @@ jobs: run: | git config --system core.longpaths true subst 'X:' . + + - name: enable long paths in git + if: ${{ matrix.os == 'windows-latest' }} + run: | + # enable long paths to fix "path too long" errors when cloning repos in windows + git config --system core.longpaths true + shell: bash + + - name: Check out the notifications repo + uses: actions/checkout@v2 + with: + repository: opensearch-project/notifications + ref: ${{ env.NOTIFICATIONS_PLUGIN_VERSION }} + path: notifications - name: Run Opensearch with plugin working-directory: ${{ env.WORKING_DIR }} From 089e79071755722f8fbdeb0de7e9644f3c4dd4ca Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Wed, 29 Nov 2023 18:14:44 +0800 Subject: [PATCH 3/4] feat: add variable NOTIFICATIONS_PLUGIN_VERSION Signed-off-by: SuZhou-Joe --- .../dashboards-notifications-test-and-build-workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml index 14d4ce6f..6be6b33e 100644 --- a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml @@ -10,6 +10,7 @@ on: [pull_request, push] env: PLUGIN_NAME: notifications-dashboards OPENSEARCH_DASHBOARDS_VERSION: '2.x' + NOTIFICATIONS_PLUGIN_VERSION: '2.x' jobs: tests: From d599902c8b90d8a5e97727f0909f8abcd199f768 Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Thu, 30 Nov 2023 09:18:28 +0800 Subject: [PATCH 4/4] feat: remove upload opensearch.log Signed-off-by: SuZhou-Joe --- .../dashboards-notifications-test-and-build-workflow.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml index 6be6b33e..585624f7 100644 --- a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml @@ -80,7 +80,7 @@ jobs: brew install coreutils fi cd notifications/notifications - ./gradlew run -x integTest -x jacocoTestReport | tee -a opensearch.log & + ./gradlew run -x integTest -x jacocoTestReport & timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9200)" != "200" ]]; do sleep 5; done' shell: bash env: @@ -199,12 +199,6 @@ jobs: name: cypress-screenshots-${{ matrix.os }} path: OpenSearch-Dashboards/plugins/dashboards-notifications/.cypress/screenshots - - uses: actions/upload-artifact@v1 - if: always() - with: - name: opensearch-logs-${{ matrix.os }} - path: notifications/notifications/opensearch.log - # Test run video was always captured, so this action uses "always()" condition - uses: actions/upload-artifact@v1 if: always()