From 1164c4be17cb7866da02e944947026f4d46670da Mon Sep 17 00:00:00 2001 From: Guido Modarelli <38738725+guidomodarelli@users.noreply.github.com> Date: Fri, 8 Nov 2024 06:59:38 -0300 Subject: [PATCH] Update the actions' version (#6) * Update GitHub Actions to use checkout@v4 for consistency and improved functionality across workflows * Downgrade actions/checkout from v4 to v3 for consistent versioning across Cypress and FTR workflows * Update actions/checkout to v4 in workflows * Downgrade actions/checkout from v4 to v3 in Cypress and FTR workflows for consistent versioning and setup * Update actions/upload-artifact to v4 and enable overwrite for GitHub artifact uploads * Update actions/setup-node to v4 across all workflows to ensure consistency and benefit from latest features * Update tibdex/github-app-token to v2.1.0 and adjust installation retrieval settings for improved flexibility in workflows * Update actions/setup-java to v4 in cypress and ftr workflows for consistency and access to latest improvements * Update suisei-cn/actions-download-file to v1.6.0 in cypress and ftr workflows for consistent artifact management * Add 'temurin' distribution to JDK setup in cypress and ftr workflows for improved consistency * Upgrade download-file action to v3 in cypress and ftr workflows for enhanced performance and consistency * Replace download-file action with wget command in cypress and ftr workflows for improved reliability in OpenSearch download * Replace download-file action with wget command in cypress workflow for improved reliability in OpenSearch artifact downloads * Check for existing files before downloading OpenSearch artifacts in cypress and ftr workflows to avoid redundant downloads * Adjust existence check to directories instead of files for downloading OpenSearch artifacts in cypress and ftr workflows * Refactor artifact download logic to ensure consistent execution in cypress and ftr workflows by removing existence checks * Update retry action version to v2.9.0 for OpenSearch Dashboards plugin bootstrap and test in workflows * Fix retry action reference in workflows to use single '@' for v2.9.0 in dashboards reports test and build workflow * Update codecov action version to v4.6.0 for improved coverage reporting in dashboards reports test and build workflow * Streamline mkdir usage in workflows by removing redundant checks for plugin-artifacts directory creation * Downgrade codecov action to v3 to address compatibility issues in dashboards reports test and build workflow * Upgrade release-drafter action to v6 for better draft release notes handling in workflows * Upgrade start-opensearch action to v6 for enhanced functionality in binary installation verification workflow * Upgrade setup-opensearch-dashboards action to v3 for improved dashboard setup in binary installation verification workflow * Upgrade actions/checkout to v4 for enhanced functionality in Cypress and FTR E2E reporting test workflows --- .github/workflows/backport.yml | 7 +++- .../workflows/cypress-e2e-reporting-test.yml | 36 ++++++++---------- ...boards-reports-test-and-build-workflow.yml | 28 +++++++------- .github/workflows/dev-environment.yml | 5 ++- .../draft-release-notes-workflow.yml | 3 +- .github/workflows/ftr-e2e-reporting-test.yml | 38 +++++++++---------- .github/workflows/link-checker.yml | 2 +- .github/workflows/lint.yml | 6 +-- .../workflows/verify-binary-installation.yml | 6 +-- 9 files changed, 64 insertions(+), 67 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 6472a968..45be3b06 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -16,11 +16,14 @@ jobs: steps: - name: GitHub App token id: github_app_token - uses: tibdex/github-app-token@v1.5.0 + uses: tibdex/github-app-token@v2.1.0 with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - installation_id: 22958780 + # https://github.com/tibdex/github-app-token/releases/tag/v2.0.0 + # https://github.com/tibdex/github-app-token/compare/v1.5.0...v2.1.0#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6R11-R30 + installation_retrieval_mode: id + installation_retrieval_payload: 22958780 - name: Backport uses: VachaShah/backport@v2.2.0 diff --git a/.github/workflows/cypress-e2e-reporting-test.yml b/.github/workflows/cypress-e2e-reporting-test.yml index c7e30536..6abc5f1a 100644 --- a/.github/workflows/cypress-e2e-reporting-test.yml +++ b/.github/workflows/cypress-e2e-reporting-test.yml @@ -23,28 +23,27 @@ jobs: steps: - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: + distribution: 'temurin' java-version: ${{ matrix.jdk }} - name: Download Job Scheduler artifact - uses: suisei-cn/actions-download-file@v1.4.0 - with: - url: https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-job-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip - target: plugin-artifacts/ - filename: job-scheduler.zip + run: | + mkdir -p plugin-artifacts + wget -O plugin-artifacts/job-scheduler.zip "https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-job-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip" + shell: bash - name: Download Reports Scheduler artifact - uses: suisei-cn/actions-download-file@v1.4.0 - with: - url: https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-reports-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip - target: plugin-artifacts/ - filename: reports-scheduler.zip + run: | + mkdir -p plugin-artifacts + wget -O plugin-artifacts/reports-scheduler.zip "https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-reports-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip" + shell: bash - 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 + run: | + wget 'https://artifacts.opensearch.org/snapshots/core/opensearch/${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/opensearch-min-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz' --retry-connrefused --tries=3 --no-dns-cache --progress=bar:force:noscroll --verbose + shell: bash - name: Extract OpenSearch run: | @@ -79,18 +78,15 @@ jobs: shell: bash - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: OpenSearch-Dashboards repository: opensearch-project/OpenSearch-Dashboards ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} fetch-depth: 0 - filter: | - cypress - test - name: Checkout Dashboards Reporting Plugin in OpenSearch Dashboards Plugins Dir - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} @@ -101,7 +97,7 @@ jobs: working-directory: OpenSearch-Dashboards shell: bash - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 with: node-version: ${{ steps.tool-versions.outputs.node_version }} registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index d5971cd2..8ef3f540 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -27,19 +27,19 @@ jobs: steps: - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: opensearch-project/Opensearch-Dashboards ref: ${{ env.OPENSEARCH_VERSION }} path: OpenSearch-Dashboards - name: Checkout Plugin - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} - name: OpenSearch Dashboards Plugin Bootstrap and test - uses: nick-fields/retry@v1 + uses: nick-fields/retry@v2.9.0 with: timeout_minutes: 30 max_attempts: 3 @@ -51,7 +51,7 @@ jobs: whoami && yarn osd bootstrap --single-version=loose && yarn test --coverage" - name: Upload coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: flags: dashboards-report directory: ./OpenSearch-Dashboards/plugins/ @@ -81,14 +81,14 @@ jobs: # run: git config --system core.longpaths true # - name: Checkout OpenSearch Dashboards - # uses: actions/checkout@v1 + # uses: actions/checkout@v4 # with: # repository: opensearch-project/Opensearch-Dashboards # ref: ${{ env.OPENSEARCH_VERSION }} # path: OpenSearch-Dashboards # - name: Setup Node - # uses: actions/setup-node@v3 + # uses: actions/setup-node@v4 # with: # node-version-file: '../OpenSearch-Dashboards/.nvmrc' # registry-url: 'https://registry.npmjs.org' @@ -105,19 +105,19 @@ jobs: # - run: yarn -v # - name: Checkout Plugin - # uses: actions/checkout@v1 + # uses: actions/checkout@v4 # with: # path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} # - name: OpenSearch Dashboards Plugin Bootstrap - # uses: nick-fields/retry@v1 + # uses: nick-fields/retry@v2.9.0 # with: # timeout_minutes: 30 # max_attempts: 3 # command: yarn osd bootstrap --single-version=loose # - name: Test - # uses: nick-fields/retry@v1 + # uses: nick-fields/retry@v2.9.0 # with: # timeout_minutes: 30 # max_attempts: 3 @@ -138,14 +138,14 @@ jobs: # runs-on: macos-latest # steps: # - name: Checkout OpenSearch Dashboards - # uses: actions/checkout@v1 + # uses: actions/checkout@v4 # with: # repository: opensearch-project/Opensearch-Dashboards # ref: ${{ env.OPENSEARCH_VERSION }} # path: OpenSearch-Dashboards # - name: Setup Node - # uses: actions/setup-node@v3 + # uses: actions/setup-node@v4 # with: # node-version-file: '../OpenSearch-Dashboards/.nvmrc' # registry-url: 'https://registry.npmjs.org' @@ -162,19 +162,19 @@ jobs: # - run: yarn -v # - name: Checkout Plugin - # uses: actions/checkout@v1 + # uses: actions/checkout@v4 # with: # path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} # - name: OpenSearch Dashboards Plugin Bootstrap - # uses: nick-fields/retry@v1 + # uses: nick-fields/retry@v2.9.0 # with: # timeout_minutes: 30 # max_attempts: 3 # command: yarn osd bootstrap --single-version=loose # - name: Test - # uses: nick-fields/retry@v1 + # uses: nick-fields/retry@v2.9.0 # with: # timeout_minutes: 30 # max_attempts: 3 diff --git a/.github/workflows/dev-environment.yml b/.github/workflows/dev-environment.yml index 471c633c..c5974a77 100644 --- a/.github/workflows/dev-environment.yml +++ b/.github/workflows/dev-environment.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Step 01 - Download the plugin's source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: wazuh/wazuh-dashboards-reporting ref: ${{ inputs.reference }} @@ -82,10 +82,11 @@ jobs: - name: Step 04 - Upload artifact to GitHub if: ${{ inputs.artifact_name && inputs.artifact_path }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.artifact_name }}_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip path: ${{ inputs.artifact_path }} + overwrite: true - name: Step 05 - Upload coverage results to GitHub if: ${{ inputs.notify_jest_coverage_summary && github.event_name == 'pull_request' }} diff --git a/.github/workflows/draft-release-notes-workflow.yml b/.github/workflows/draft-release-notes-workflow.yml index e33df5ca..55f74aaf 100644 --- a/.github/workflows/draft-release-notes-workflow.yml +++ b/.github/workflows/draft-release-notes-workflow.yml @@ -12,7 +12,8 @@ jobs: steps: # Drafts your next Release notes as Pull Requests are merged into "main" - name: Update draft release notes - uses: release-drafter/release-drafter@v5 + # https://github.com/release-drafter/release-drafter/compare/v5.25.0...v6.0.0 + uses: release-drafter/release-drafter@v6 with: config-name: draft-release-notes-config.yml tag: (None) diff --git a/.github/workflows/ftr-e2e-reporting-test.yml b/.github/workflows/ftr-e2e-reporting-test.yml index 26055434..d06ed2a7 100644 --- a/.github/workflows/ftr-e2e-reporting-test.yml +++ b/.github/workflows/ftr-e2e-reporting-test.yml @@ -23,28 +23,27 @@ jobs: steps: - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: + distribution: 'temurin' java-version: ${{ matrix.jdk }} - name: Download Job Scheduler artifact - uses: suisei-cn/actions-download-file@v1.4.0 - with: - url: https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-job-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip - target: plugin-artifacts/ - filename: job-scheduler.zip + run: | + mkdir -p plugin-artifacts + wget -O plugin-artifacts/job-scheduler.zip "https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-job-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip" + shell: bash - name: Download Reports Scheduler artifact - uses: suisei-cn/actions-download-file@v1.4.0 - with: - url: https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-reports-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip - target: plugin-artifacts/ - filename: reports-scheduler.zip + run: | + mkdir -p plugin-artifacts + wget -O plugin-artifacts/reports-scheduler.zip "https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-reports-scheduler&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip" + shell: bash - 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 + run: | + wget 'https://artifacts.opensearch.org/snapshots/core/opensearch/${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/opensearch-min-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT-linux-x64-latest.tar.gz' --retry-connrefused --tries=3 --no-dns-cache --progress=bar:force:noscroll --verbose + shell: bash - name: Extract OpenSearch run: | @@ -79,18 +78,15 @@ jobs: shell: bash - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: OpenSearch-Dashboards repository: opensearch-project/OpenSearch-Dashboards ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} fetch-depth: 0 - filter: | - cypress - test - name: Checkout Dashboards Reporting Plugin in OpenSearch Dashboards Plugins Dir - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} @@ -101,7 +97,7 @@ jobs: working-directory: OpenSearch-Dashboards shell: bash - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 with: node-version: ${{ steps.tool-versions.outputs.node_version }} registry-url: 'https://registry.npmjs.org' @@ -137,7 +133,7 @@ jobs: working-directory: OpenSearch-Dashboards - name: Checkout Dashboards Functioanl Test Repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: opensearch-dashboards-functional-test repository: opensearch-project/opensearch-dashboards-functional-test diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index b50f79bf..7a25a666 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: lychee Link Checker id: lychee uses: lycheeverse/lychee-action@master diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 02e8bb0f..037915a9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,14 +13,14 @@ jobs: steps: - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: opensearch-project/Opensearch-Dashboards ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} path: OpenSearch-Dashboards - name: Checkout dashboards reporting - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} fetch-depth: 0 @@ -33,7 +33,7 @@ jobs: echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" - name: Setup node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ steps.versions_step.outputs.node_version }} registry-url: "https://registry.npmjs.org" diff --git a/.github/workflows/verify-binary-installation.yml b/.github/workflows/verify-binary-installation.yml index b4da9c92..5e26922b 100644 --- a/.github/workflows/verify-binary-installation.yml +++ b/.github/workflows/verify-binary-installation.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout Branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set env run: | @@ -29,14 +29,14 @@ jobs: shell: bash - name: Run Opensearch - uses: derek-ho/start-opensearch@v2 + uses: derek-ho/start-opensearch@v6 with: opensearch-version: ${{ env.OPENSEARCH_VERSION }} security-enabled: false - name: Run Dashboard id: setup-dashboards - uses: derek-ho/setup-opensearch-dashboards@v2 + uses: derek-ho/setup-opensearch-dashboards@v3 with: plugin_name: dashboards-reporting built_plugin_name: reportsDashboards