From acb9fcc3c58a15dc1ff92e722cac1b864041b0e3 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Fri, 16 Sep 2022 14:16:31 -0700 Subject: [PATCH 1/4] Reorganize GitHub workflows. (#118) **Reorganize GitHub workflows:** * Remove obsoleve workflows, mostly related to releaseing ODFE artifacts. * Update actions in rest workflows. * Limit workflow scopes: * Reduce file scope, for example, JDBC workflow will be triggered on JDBC changes only. * Reduce action scope, so workflows shouldn't be triggered twice on PR. * Strictly define env version to avoid unexpected failures. * Upload test reports for SQL plugin workflow. * Activate tests for SQL CLI. Signed-off-by: Yury-Fridlyand --- .github/workflows/backport.yml | 2 +- .github/workflows/bi-connectors.yml | 4 +- .github/workflows/codeql-analysis.yml | 64 ++---- .github/workflows/dco.yml | 4 +- .github/workflows/delete_backport_branch.yml | 2 +- .../draft-release-notes-workflow.yml | 8 +- .github/workflows/link-checker.yml | 20 +- .../workflows/sql-cli-release-workflow.yml | 71 ------ .../sql-cli-test-and-build-workflow.yml | 52 +++-- .../workflows/sql-jdbc-push-jdbc-maven.yml | 49 ---- .../workflows/sql-jdbc-release-workflow.yml | 58 ----- .../sql-jdbc-test-and-build-workflow.yml | 19 +- .github/workflows/sql-odbc-main.yml | 40 ++-- .../workflows/sql-odbc-release-workflow.yml | 212 ------------------ .github/workflows/sql-release-workflow.yml | 58 ----- .../workflows/sql-test-and-build-workflow.yml | 45 +++- .../sql-workbench-release-workflow.yml | 72 ------ .../sql-workbench-test-and-build-workflow.yml | 33 ++- sql-cli/tests/test_opensearch_connection.py | 1 + 19 files changed, 181 insertions(+), 633 deletions(-) delete mode 100644 .github/workflows/sql-cli-release-workflow.yml delete mode 100644 .github/workflows/sql-jdbc-push-jdbc-maven.yml delete mode 100644 .github/workflows/sql-jdbc-release-workflow.yml delete mode 100644 .github/workflows/sql-odbc-release-workflow.yml delete mode 100644 .github/workflows/sql-release-workflow.yml delete mode 100644 .github/workflows/sql-workbench-release-workflow.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index e47d8d88c0..7cb0856a86 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -7,7 +7,7 @@ on: jobs: backport: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 permissions: contents: write pull-requests: write diff --git a/.github/workflows/bi-connectors.yml b/.github/workflows/bi-connectors.yml index d39314f29e..245c568fa9 100644 --- a/.github/workflows/bi-connectors.yml +++ b/.github/workflows/bi-connectors.yml @@ -1,6 +1,8 @@ name: Build connectors for BI tools on: + pull_request: + types: [opened, reopened] push: paths: - 'bi-connectors/PowerBIConnector/**' @@ -9,7 +11,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - name: Pack Tableau JDBC connector diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 08d827bd45..e043581de9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,70 +1,40 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# ******** NOTE ******** - name: "CodeQL" on: pull_request: branches: - - master - - opendistro-* + - 'main' + - '[1-9]+.[0-9x]+' + - '[1-9]+.[0-9x]+.[0-9x]+' + types: [opened, reopened] push: - branches: - - master - - opendistro-* - + branches-ignore: + - 'dependabot/**' + paths: + - '**/*.java' + - '.github/workflows/codeql-analysis.yml' jobs: analyze: name: CodeQL-Scan - runs-on: ubuntu-18.04 - + runs-on: ubuntu-20.04 + permissions: + security-events: write + actions: read strategy: fail-fast: false matrix: language: [ 'java' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - + uses: github/codeql-action/autobuild@v2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml index 53ed5304c2..fc206f5ae1 100644 --- a/.github/workflows/dco.yml +++ b/.github/workflows/dco.yml @@ -4,7 +4,7 @@ on: [pull_request] jobs: check: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Get PR Commits @@ -15,4 +15,4 @@ jobs: - name: DCO Check uses: tim-actions/dco@v1.1.0 with: - commits: ${{ steps.get-pr-commits.outputs.commits }} \ No newline at end of file + commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml index 387a124b8c..ec69dcaa06 100644 --- a/.github/workflows/delete_backport_branch.yml +++ b/.github/workflows/delete_backport_branch.yml @@ -6,7 +6,7 @@ on: jobs: delete-branch: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 if: startsWith(github.event.pull_request.head.ref,'backport/') steps: - name: Delete merged branch diff --git a/.github/workflows/draft-release-notes-workflow.yml b/.github/workflows/draft-release-notes-workflow.yml index 7f5a124ddd..c0a157ee40 100644 --- a/.github/workflows/draft-release-notes-workflow.yml +++ b/.github/workflows/draft-release-notes-workflow.yml @@ -1,14 +1,18 @@ name: Release Drafter on: + pull_request: + types: [opened, reopened] push: branches: - - main + - 'main' + - '[1-9]+.[0-9x]+' + - '[1-9]+.[0-9x]+.[0-9x]+' jobs: update_release_draft: name: Update draft release notes - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: # Drafts your next Release notes as Pull Requests are merged into "develop" - name: Update draft release notes diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index b113ef24ec..5e42a68947 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -1,14 +1,26 @@ name: Link Checker + on: - push: - branches: [ main ] pull_request: - branches: [ main ] + types: [opened, reopened] + push: + branches: + - 'main' + - '[1-9]+.[0-9x]+' + - '[1-9]+.[0-9x]+.[0-9x]+' + paths: + - '**/*.pdf' + - '**/*.pnj' + - '**/*.jpg' + - '**/*.json' + - '**/*.md' + - '**/*.txt' + - '**/*.rst' jobs: linkchecker: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/sql-cli-release-workflow.yml b/.github/workflows/sql-cli-release-workflow.yml deleted file mode 100644 index 606d848829..0000000000 --- a/.github/workflows/sql-cli-release-workflow.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Release SQL CLI Artifacts -# This workflows is triggered on creating tags to main -on: - push: - tags: - - 'v*' - -jobs: - build: - - runs-on: ubuntu-latest - defaults: - run: - working-directory: sql-cli - strategy: - matrix: - python-version: [3.8] - - steps: - - name: Checkout SQL CLI - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - - name: Build - run: | - python setup.py sdist bdist_wheel - - - name: Publish to S3 - shell: bash - run: | - tarball=`ls ./dist/*.tar.gz` - wheel=`ls ./dist/*.whl` - - renamed_wheel=`echo $wheel | sed 's/_/-/g'` - mv "$wheel" "$renamed_wheel" - wheel=`ls ./dist/*.whl` - - # Inject the build number before the suffix - tarball_outfile=`basename ${tarball%.tar.gz}-build-${GITHUB_RUN_NUMBER}.tar.gz` - wheel_outfile=`basename ${wheel%.whl}-build-${GITHUB_RUN_NUMBER}.whl` - - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-clients/sql-cli/" - - echo "Copying ${tarball} to ${s3_prefix}${tarball_outfile}" - aws s3 cp --quiet $tarball ${s3_prefix}${tarball_outfile} - - echo "Copying ${wheel} to ${s3_prefix}${wheel_outfile}" - aws s3 cp --quiet $wheel ${s3_prefix}${wheel_outfile} - - # TODO: Publish to PyPI - # - name: Publish to PyPI - # env: - # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - # run: twine upload dist/* diff --git a/.github/workflows/sql-cli-test-and-build-workflow.yml b/.github/workflows/sql-cli-test-and-build-workflow.yml index 3de1ff3aa5..114813b9e2 100644 --- a/.github/workflows/sql-cli-test-and-build-workflow.yml +++ b/.github/workflows/sql-cli-test-and-build-workflow.yml @@ -1,24 +1,33 @@ name: SQL CLI Test and Build -on: [pull_request, push] +on: + pull_request: + types: [opened, reopened] + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'sql-cli/**' + - '.github/workflows/sql-cli-test-and-build-workflow.yml' jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 defaults: run: working-directory: sql-cli strategy: matrix: python-version: [3.8] + opensearch-version: [ 2.2.1, latest ] steps: - name: Checkout SQL CLI - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -28,26 +37,21 @@ jobs: pip install -r requirements-dev.txt pip install setuptools wheel - #TODO: will setup CI for IT once we have OpenSearch and sql plugin release. Not it only runs UT - # It can also be refactored by launching OpenSearch instance with plugin installed from gradle. - - # - name: Set up ES and install SQL plugin - # run: | - # sudo add-apt-repository ppa:openjdk-r/ppa - # sudo apt update - # sudo apt install openjdk-14-jdk - # sudo apt install unzip - # wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.10.0-amd64.deb - # sudo dpkg -i elasticsearch-oss-7.10.0-amd64.deb - # sudo /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opensearch-sql/opensearch_sql-1.12.0.0.zip - # sudo systemctl start elasticsearch.service + # tests are designed to run against http://localhost:9200, so we have to disable/remove security plugin + - name: Download and run OpenSearch + run: | + docker run -p 9200:9200 -e "discovery.type=single-node" -e "DISABLE_SECURITY_PLUGIN=true" --name test -d opensearchproject/opensearch:${{ matrix.opensearch-version }} + + - name: Wait for cluster to start + uses: nick-fields/retry@v2 + with: + timeout_seconds: 1 + max_attempts: 30 + command: curl -q localhost:9200 - name: Run Tox Testing run: tox - # - name: Stop ES - # run: sudo systemctl stop elasticsearch.service - - name: Build Artifact run: python setup.py sdist bdist_wheel @@ -57,7 +61,13 @@ jobs: cp -r ./dist/*.tar.gz ./dist/*.whl opensearchsql-builds/ - name: Upload Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: opensearchsql path: sql-cli/opensearchsql-builds + + - name: Clean up container + if: always() + run: | + docker container stop test + docker container rm test diff --git a/.github/workflows/sql-jdbc-push-jdbc-maven.yml b/.github/workflows/sql-jdbc-push-jdbc-maven.yml deleted file mode 100644 index 3c96447233..0000000000 --- a/.github/workflows/sql-jdbc-push-jdbc-maven.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Upload sql-jdbc Jar to Maven - -# This workflow will upload the sql-jdbc jar to maven when a new tag is cut -on: - push: - tags: - - v* - -jobs: - upload-jdbc-jar: - runs-on: ubuntu-latest - defaults: - run: - working-directory: sql-jdbc - name: Upload Jar to Maven - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - - - name: Configure AWS CLI - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - # Since release workflow uses java 10 - - name: Setup Java - uses: actions/setup-java@v1 - with: - java-version: '10' - - - name: Upload jdbc Jar to Maven - env: - passphrase: ${{ secrets.PASSPHRASE }} - run: | - cd .. - export JAVA10_HOME=$JAVA_HOME - aws s3 cp s3://opendistro-docs/github-actions/pgp-public-key . - aws s3 cp s3://opendistro-docs/github-actions/pgp-private-key . - - gpg --import pgp-public-key - gpg --allow-secret-key-import --import pgp-private-key - - - mkdir /home/runner/.gradle - aws s3 cp s3://opendistro-docs/github-actions/gradle.properties /home/runner/.gradle/ - cd sql-jdbc - ./gradlew publishShadowPublicationToSonatype-stagingRepository -Dcompiler.java=10 -Dbuild.snapshot=false -Djavax.net.ssl.trustStore=$JAVA_HOME/lib/security/cacerts diff --git a/.github/workflows/sql-jdbc-release-workflow.yml b/.github/workflows/sql-jdbc-release-workflow.yml deleted file mode 100644 index 39053615ee..0000000000 --- a/.github/workflows/sql-jdbc-release-workflow.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Build and Release SQL-JDBC -# This workflow is triggered on creating tags to main or an opensearch release branch -on: - push: - tags: - - "v*" - -jobs: - Release-SQL-JDBC: - strategy: - matrix: - java: [10] - - name: Build and Release JDBC Plugin - runs-on: ubuntu-latest - defaults: - run: - working-directory: sql-jdbc - - steps: - - name: Checkout SQL-JDBC - uses: actions/checkout@v1 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Setup Java ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - - name: Run build - run: | - ./gradlew publishShadowPublicationToInternal-releasesRepository '-Dorg.gradle.jvmargs=--add-modules java.xml.bind' -Dbuild.snapshot=false - - - name: Configure Staging AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Publish to S3 - shell: bash - run: | - jar=`ls -1t build/libs/*.jar | grep -v "SNAPSHOT.jar" | grep -v "sources.jar" | head -1` - - # Inject the build number before the suffix - jar_outfile=`basename ${jar%.jar}-build-${GITHUB_RUN_NUMBER}.jar` - - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-clients/sql-jdbc/" - - echo "Copying ${jar} to ${s3_prefix}${jar_outfile}" - aws s3 cp --quiet $jar ${s3_prefix}${jar_outfile} diff --git a/.github/workflows/sql-jdbc-test-and-build-workflow.yml b/.github/workflows/sql-jdbc-test-and-build-workflow.yml index 52d0dd68f8..2342e00cd6 100644 --- a/.github/workflows/sql-jdbc-test-and-build-workflow.yml +++ b/.github/workflows/sql-jdbc-test-and-build-workflow.yml @@ -1,6 +1,14 @@ name: SQL JDBC Java CI -on: [push, pull_request] +on: + pull_request: + types: [opened, reopened] + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'sql-jdbc/**' + - '.github/workflows/sql-jdbc-test-and-build-workflow.yml' jobs: build: @@ -9,17 +17,18 @@ jobs: java: - 11 - 17 - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 defaults: run: working-directory: sql-jdbc steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: ${{ matrix.java }} - name: Build with Gradle @@ -31,7 +40,7 @@ jobs: cp ./build/libs/*.jar sql-jdbc-builds - name: Upload Artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: sql-jdbc path: sql-jdbc/sql-jdbc-builds diff --git a/.github/workflows/sql-odbc-main.yml b/.github/workflows/sql-odbc-main.yml index 0a22780aa9..eee65e5b29 100644 --- a/.github/workflows/sql-odbc-main.yml +++ b/.github/workflows/sql-odbc-main.yml @@ -1,6 +1,14 @@ name: OpenSearch ODBC Driver -on: [push, pull_request] +on: + pull_request: + types: [opened, reopened] + push: + branches-ignore: + - 'dependabot/**' + paths: + - 'sql-odbc/**' + - '.github/workflows/sql-odbc-main.yml' env: CI_OUTPUT_PATH: "sql-odbc/ci-output" @@ -9,6 +17,8 @@ env: ODBC_BUILD_PATH: "./build/odbc/build" AWS_SDK_INSTALL_PATH: "./build/aws-sdk/install" +# Tests are disabled (commented out) in all jobs because they are fail and/or outdated +# Keeping them for the brighten future when we can re-activate them jobs: build-mac: runs-on: macos-10.15 @@ -16,14 +26,14 @@ jobs: run: working-directory: sql-odbc steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: run-cppcheck run: | brew install cppcheck sh run_cppcheck.sh - name: upload-cppcheck-results if: failure() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: cppcheck-results path: sql-odbc/cppcheck-results.log @@ -61,19 +71,19 @@ jobs: # cp ./bin64/*.log test-output - name: upload-build if: success() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: mac64-build path: sql-odbc/build-output - name: upload-installer if: success() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: mac64-installer path: sql-odbc/installer #- name: upload-test-results - # if: success() - # uses: actions/upload-artifact@v1 + # if: always() + # uses: actions/upload-artifact@v3 # with: # name: mac-test-results # path: test-output @@ -83,7 +93,7 @@ jobs: run: working-directory: sql-odbc steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Get specific version CMake, v3.18.3 uses: lukka/get-cmake@v3.18.3 - name: add-msbuild-to-path @@ -106,19 +116,19 @@ jobs: .\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH - name: upload-build if: always() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: windows32-build path: sql-odbc/ci-output/build - name: upload-installer if: always() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: windows32-installer path: sql-odbc/ci-output/installer #- name: upload-test-results # if: always() - # uses: actions/upload-artifact@v1 + # uses: actions/upload-artifact@v3 # with: # name: windows-test-results # path: $CI_OUTPUT_PATH/test @@ -128,7 +138,7 @@ jobs: run: working-directory: sql-odbc steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Get specific version CMake, v3.18.3 uses: lukka/get-cmake@v3.18.3 - name: add-msbuild-to-path @@ -151,19 +161,19 @@ jobs: .\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH - name: upload-build if: always() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: windows64-build path: sql-odbc/ci-output/build - name: upload-installer if: always() - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: windows64-installer path: sql-odbc/ci-output/installer #- name: upload-test-results # if: always() - # uses: actions/upload-artifact@v1 + # uses: actions/upload-artifact@v3 # with: # name: windows-test-results # path: sql-odbc/ci-output/test-output diff --git a/.github/workflows/sql-odbc-release-workflow.yml b/.github/workflows/sql-odbc-release-workflow.yml deleted file mode 100644 index 5aea61ed16..0000000000 --- a/.github/workflows/sql-odbc-release-workflow.yml +++ /dev/null @@ -1,212 +0,0 @@ -name: Build and Release SQL-ODBC -# This workflow is triggered on creating tags to main or an opensearch release branch -on: - push: - tags: - - 'v*' - -env: - CI_OUTPUT_PATH: "sql-odbc/ci-output" - ODBC_LIB_PATH: "./build/odbc/lib" - ODBC_BIN_PATH: "./build/odbc/bin" - ODBC_BUILD_PATH: "./build/odbc/build" - AWS_SDK_INSTALL_PATH: "./build/aws-sdk/install" - PLUGIN_NAME: opensearch-sql-odbc - OD_VERSION: 2.4.0.0 - -jobs: - build-mac: - runs-on: macos-10.15 - defaults: - run: - working-directory: sql-odbc - steps: - - uses: actions/checkout@v1 - - name: run-cppcheck - run: | - brew install cppcheck - sh run_cppcheck.sh - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: upload-cppcheck-results - if: failure() - uses: actions/upload-artifact@v1 - with: - name: cppcheck-results - path: sql-odbc/cppcheck-results.log - - name: get-dependencies - run: | - brew unlink unixodbc - brew install curl - brew install cmake - brew install libiodbc - - name: configure-and-build-driver - run: | - ./build_mac_release64.sh - - name: build-installer - if: success() - run: | - cd cmake-build64 - cmake ../src - make - cpack . - cd .. - - name: create-output - if: success() - run: | - mkdir build-output - mkdir test-output - mkdir installer - cp ./build/odbc/lib/*.dylib build-output/ - cp ./build/odbc/lib/*.a build-output/ - cp ./cmake-build64/*.pkg installer/ - # cp $(ls -d bin64/* | grep -v "\.") build - - name: upload-build - if: success() - uses: actions/upload-artifact@v1 - with: - name: mac64-build - path: sql-odbc/build-output - - name: upload-installer - if: success() - uses: actions/upload-artifact@v1 - with: - name: mac64-installer - path: sql-odbc/installer - - name: upload-artifacts-s3 - if: success() - run: | - cd installer - - pkg=`ls -1t *.pkg | grep "OpenSearch SQL ODBC Driver" | head -1` - mv "$pkg" "${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-macos-x64.pkg" - pkg=`ls -1t *.pkg | grep "${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-macos-x64.pkg" | head -1` - - # Inject the build number before the suffix - pkg_outfile=`basename ${pkg%.pkg}-build-${GITHUB_RUN_NUMBER}.pkg` - - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-clients/sql-odbc/" - - echo "Copying ${pkg} to ${s3_prefix}${pkg_outfile}" - aws s3 cp --quiet $pkg ${s3_prefix}${pkg_outfile} - - build-windows32: - runs-on: windows-latest - defaults: - run: - working-directory: sql-odbc - steps: - - uses: actions/checkout@v1 - - name: Get specific version CMake, v3.18.3 - uses: lukka/get-cmake@v3.18.3 - - name: add-msbuild-to-path - uses: microsoft/setup-msbuild@v1.0.2 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: configure-and-build-driver - run: | - .\build_win_release32.ps1 - - name: build-installer - if: success() - run: | - .\scripts\build_installer.ps1 Release Win32 .\src $Env:ODBC_BUILD_PATH $Env:AWS_SDK_INSTALL_PATH - - name: prepare-output - if: always() - run: | - .\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH - - name: upload-build - if: always() - uses: actions/upload-artifact@v1 - with: - name: windows32-build - path: sql-odbc/ci-output/build - - name: upload-installer - if: always() - uses: actions/upload-artifact@v1 - with: - name: windows32-installer - path: sql-odbc/ci-output/installer - - name: upload-artifacts-s3 - if: success() - shell: bash - run: | - cd ci-output/installer - - msi=`ls -1t *.msi | grep "OpenSearch SQL ODBC Driver" | head -1` - mv "$msi" "${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x86.msi" - msi=`ls -1t *.msi | grep "${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x86.msi" | head -1` - - # Inject the build number before the suffix - msi_outfile=`basename ${msi%.msi}-build-${GITHUB_RUN_NUMBER}.msi` - - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-clients/sql-odbc/" - - echo "Copying ${msi} to ${s3_prefix}${msi_outfile}" - aws s3 cp --quiet $msi ${s3_prefix}${msi_outfile} - - build-windows64: - runs-on: windows-latest - defaults: - run: - working-directory: sql-odbc - steps: - - uses: actions/checkout@v1 - - name: Get specific version CMake, v3.18.3 - uses: lukka/get-cmake@v3.18.3 - - name: add-msbuild-to-path - uses: microsoft/setup-msbuild@v1.0.2 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: configure-and-build-driver - run: | - .\build_win_release64.ps1 - - name: build-installer - if: success() - run: | - .\scripts\build_installer.ps1 Release x64 .\src $Env:ODBC_BUILD_PATH $Env:AWS_SDK_INSTALL_PATH - - name: prepare-output - if: always() - run: | - .\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH - - name: upload-build - if: always() - uses: actions/upload-artifact@v1 - with: - name: windows64-build - path: sql-odbc/ci-output/build - - name: upload-installer - if: always() - uses: actions/upload-artifact@v1 - with: - name: windows64-installer - path: sql-odbc/ci-output/installer - - name: upload-artifacts-s3 - if: success() - shell: bash - run: | - cd ci-output/installer - - msi=`ls -1t *.msi | grep "OpenSearch SQL ODBC Driver" | head -1` - mv "$msi" "${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.msi" - msi=`ls -1t *.msi | grep "${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.msi" | head -1` - - # Inject the build number before the suffix - msi_outfile=`basename ${msi%.msi}-build-${GITHUB_RUN_NUMBER}.msi` - - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-clients/sql-odbc/" - - echo "Copying ${msi} to ${s3_prefix}${msi_outfile}" - aws s3 cp --quiet $msi ${s3_prefix}${msi_outfile} - diff --git a/.github/workflows/sql-release-workflow.yml b/.github/workflows/sql-release-workflow.yml deleted file mode 100644 index e371723f34..0000000000 --- a/.github/workflows/sql-release-workflow.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Release SQL Artifacts -# This workflow is triggered on creating tags to main or an opensearch release branch -on: - push: - tags: - - 'v*' - -jobs: - build: - strategy: - matrix: - java: [14] - - name: Build and Release SQL Plugin - runs-on: ubuntu-latest - - steps: - - name: Checkout SQL - uses: actions/checkout@v1 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Setup Java ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - - name: Run build - run: | - ./gradlew build buildDeb buildRpm --no-daemon --refresh-dependencies --console=plain -Dbuild.snapshot=false -x doctest:doctest - - - name: Upload to S3 - shell: bash - run: | - zip=`ls plugin/build/distributions/*.zip` - rpm=`ls plugin/build/distributions/*.rpm` - deb=`ls plugin/build/distributions/*.deb` - - # Inject the build number before the suffix - zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip` - rpm_outfile=`basename ${rpm%.rpm}-build-${GITHUB_RUN_NUMBER}.rpm` - deb_outfile=`basename ${deb%.deb}-build-${GITHUB_RUN_NUMBER}.deb` - - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/elasticsearch-plugins/sql/" - - echo "Copying ${zip} to ${s3_prefix}${zip_outfile}" - aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile} - - echo "Copying ${rpm} to ${s3_prefix}${rpm_outfile}" - aws s3 cp --quiet $rpm ${s3_prefix}${rpm_outfile} - - echo "Copying ${deb} to ${s3_prefix}${deb_outfile}" - aws s3 cp --quiet $deb ${s3_prefix}${deb_outfile} diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index fcc63433a8..91bee808bf 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -1,6 +1,22 @@ name: SQL Java CI -on: [push, pull_request] +on: + pull_request: + types: [opened, reopened] + push: + branches-ignore: + - 'dependabot/**' + paths: + - '**/*.java' + - '**/*.g4' + - '!sql-jdbc/**' + - '**gradle*' + - '**lombok*' + - '**checkstyle*' + - 'integ-test/**' + - '**/*.jar' + - '**/*.pom' + - '.github/workflows/sql-test-and-build-workflow.yml' jobs: build: @@ -9,14 +25,15 @@ jobs: java: - 11 - 17 - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: ${{ matrix.java }} - name: Build with Gradle @@ -32,13 +49,29 @@ jobs: # This step uses the codecov-action Github action: https://github.com/codecov/codecov-action - name: Upload SQL Coverage Report - uses: codecov/codecov-action@v1 + if: always() + uses: codecov/codecov-action@v3 with: flags: sql-engine token: ${{ secrets.CODECOV_TOKEN }} - name: Upload Artifacts - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: opensearch-sql path: opensearch-sql-builds + + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-reports + path: | + sql/build/reports/** + ppl/build/reports/** + core/build/reports/** + common/build/reports/** + opensearch/build/reports/** + integ-test/build/reports/** + protocol/build/reports/** + legacy/build/reports/** diff --git a/.github/workflows/sql-workbench-release-workflow.yml b/.github/workflows/sql-workbench-release-workflow.yml deleted file mode 100644 index 631eb3049a..0000000000 --- a/.github/workflows/sql-workbench-release-workflow.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Release SQL-Workbench Artifacts - -on: - push: - tags: - - 'v*' - -env: - PLUGIN_NAME: query-workbench-dashboards - OPENSEARCH_VERSION: 'main' - OPENSEARCH_PLUGIN_VERSION: 2.4.0.0 - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_STAGING_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_STAGING_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - - name: Checkout Plugin - uses: actions/checkout@v1 - - - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v1 - with: - repository: opensearch-project/Opensearch-Dashboards - ref: ${{ env.OPENSEARCH_VERSION }} - path: sql/OpenSearch-Dashboards - - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: '14.18.2' - - - name: Move Workbench to Plugins Dir - run: | - mv workbench OpenSearch-Dashboards/plugins - - - name: OpenSearch Dashboards Plugin Bootstrap - uses: nick-invision/retry@v1 - with: - timeout_minutes: 60 - max_attempts: 3 - command: cd OpenSearch-Dashboards/plugins/workbench; yarn osd bootstrap - - - name: Build - run: | - cd OpenSearch-Dashboards/plugins/workbench - yarn build - mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - - - name: Upload to S3 - shell: bash - run: | - cd OpenSearch-Dashboards/plugins/workbench - zip=`ls ./build/*.zip` - - # Inject the build number before the suffix - zip_outfile=`basename ${zip%.zip}-build-${GITHUB_RUN_NUMBER}.zip` - - s3_prefix="s3://staging.artifacts.opendistroforelasticsearch.amazon.com/snapshots/kibana-plugins/query-workbench/" - - echo "Copying ${zip} to ${s3_prefix}${zip_outfile}" - aws s3 cp --quiet $zip ${s3_prefix}${zip_outfile} diff --git a/.github/workflows/sql-workbench-test-and-build-workflow.yml b/.github/workflows/sql-workbench-test-and-build-workflow.yml index a7f788c8af..588c2ee3d7 100644 --- a/.github/workflows/sql-workbench-test-and-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-and-build-workflow.yml @@ -1,6 +1,21 @@ name: SQL Workbench Test and Build -on: [pull_request, push] +on: + pull_request: + types: [opened, reopened] + push: + branches-ignore: + - 'dependabot/**' + paths: + - '**/*.java' + - '**/*.g4' + - '!sql-jdbc/**' + - '**gradle*' + - '**lombok*' + - '**/*.jar' + - '**/*.pom' + - 'workbench/**' + - '.github/workflows/sql-workbench-test-and-build-workflow.yml' env: PLUGIN_NAME: query-workbench-dashboards @@ -11,21 +26,21 @@ jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout Plugin - uses: actions/checkout@v1 + uses: actions/checkout@v3 - name: Checkout OpenSearch Dashboards - uses: actions/checkout@v1 + uses: actions/checkout@v1 # can't update to v3 because `setup-node` fails with: repository: opensearch-project/Opensearch-Dashboards ref: ${{ env.OPENSEARCH_VERSION }} path: OpenSearch-Dashboards - name: Setup Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: "../OpenSearch-Dashboards/.nvmrc" registry-url: 'https://registry.npmjs.org' @@ -35,7 +50,7 @@ jobs: mv workbench ../OpenSearch-Dashboards/plugins - name: OpenSearch Dashboards Plugin Bootstrap - uses: nick-invision/retry@v1 + uses: nick-fields/retry@v2 with: timeout_minutes: 60 max_attempts: 3 @@ -47,7 +62,8 @@ jobs: yarn test:jest --coverage - name: Upload coverage - uses: codecov/codecov-action@v1 + if: always() + uses: codecov/codecov-action@v3 with: flags: query-workbench directory: ../OpenSearch-Dashboards/plugins/workbench @@ -60,7 +76,8 @@ jobs: mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip - name: Upload Artifact - uses: actions/upload-artifact@v1 + if: always() + uses: actions/upload-artifact@v1 # can't update to v3 because upload fails with: name: workbench path: ../OpenSearch-Dashboards/plugins/workbench/build diff --git a/sql-cli/tests/test_opensearch_connection.py b/sql-cli/tests/test_opensearch_connection.py index 1a1aa76ecc..75740881c4 100644 --- a/sql-cli/tests/test_opensearch_connection.py +++ b/sql-cli/tests/test_opensearch_connection.py @@ -39,6 +39,7 @@ def test_query(self, connection): ) @estest + @pytest.mark.skip(reason="Test is not compatible with OpenSearch >= 2.3.0, it returns HTTP/503 instead of HTTP/400") def test_query_nonexistent_index(self, connection): self.load_data_to_es(connection) From 921791bfa2def92f780de66a9d8b9e1a7bdd658a Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Fri, 23 Sep 2022 09:49:54 -0700 Subject: [PATCH 2/4] Add new test workflow. (#119) * Add new test workflow. Signed-off-by: Yury-Fridlyand --- .../workflows/sql-test-and-build-workflow.yml | 1 + .github/workflows/sql-test-workflow.yml | 104 ++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 .github/workflows/sql-test-workflow.yml diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index 91bee808bf..bd9e496728 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -75,3 +75,4 @@ jobs: integ-test/build/reports/** protocol/build/reports/** legacy/build/reports/** + plugin/build/reports/** diff --git a/.github/workflows/sql-test-workflow.yml b/.github/workflows/sql-test-workflow.yml new file mode 100644 index 0000000000..5ff8bbfc3b --- /dev/null +++ b/.github/workflows/sql-test-workflow.yml @@ -0,0 +1,104 @@ +name: SQL Plugin Tests + +on: + workflow_dispatch: + push: + branches: + - 'dev-*' + paths: + - '**/*.java' + - '**/*.g4' + - '!sql-jdbc/**' + - '**gradle*' + - '**lombok*' + - '**checkstyle*' + - 'integ-test/**' + - 'docs/**' + - 'doctest/**' + - '**/*.jar' + - '**/*.pom' + - '.github/workflows/sql-test-workflow.yml' + +jobs: + build: + strategy: + matrix: + java: + - 11 + - 17 + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + + - name: Run tests + id: tests + run: | + # checkstyle + ./gradlew :opensearch:checkstyleMain || echo "* Checkstyle failed for opensearch/src" > report.log + ./gradlew :opensearch:checkstyleTest || echo "* Checkstyle failed for opensearch/test" >> report.log + ./gradlew :sql:checkstyleMain || echo "* Checkstyle failed for sql/src" >> report.log + ./gradlew :sql:checkstyleTest || echo "* Checkstyle failed for sql/test" >> report.log + ./gradlew :ppl:checkstyleMain || echo "* Checkstyle failed for ppl/src" >> report.log + ./gradlew :ppl:checkstyleTest || echo "* Checkstyle failed for ppl/test" >> report.log + ./gradlew :core:checkstyleMain || echo "* Checkstyle failed for core/src" >> report.log + ./gradlew :core:checkstyleTest || echo "* Checkstyle failed for core/test" >> report.log + ./gradlew :common:checkstyleMain || echo "* Checkstyle failed for common/src" >> report.log + ./gradlew :common:checkstyleTest || echo "* Checkstyle failed for common/test" >> report.log + ./gradlew :legacy:checkstyleMain || echo "* Checkstyle failed for legacy/src" >> report.log + ./gradlew :legacy:checkstyleTest || echo "* Checkstyle failed for legacy/test" >> report.log + ./gradlew :protocol:checkstyleMain || echo "* Checkstyle failed for protocol/src" >> report.log + ./gradlew :protocol:checkstyleTest || echo "* Checkstyle failed for protocol/test" >> report.log + ./gradlew :opensearch-sql-plugin:checkstyleMain || echo "* Checkstyle failed for plugin/src" >> report.log + ./gradlew :opensearch-sql-plugin:checkstyleTest || echo "* Checkstyle failed for plugin/test" >> report.log + # Add checkstyle for `integ-test` when fixed + # Unit tests + ./gradlew :opensearch:test || echo "* Unit tests failed for opensearch" >> report.log + ./gradlew :ppl:test || echo "* Unit tests failed for sql" >> report.log + ./gradlew :sql:test || echo "* Unit tests failed for ppl" >> report.log + ./gradlew :core:test || echo "* Unit tests failed for core" >> report.log + ./gradlew :protocol:test || echo "* Unit tests failed for protocol" >> report.log + ./gradlew :opensearch-sql-plugin:test || echo "* Unit tests failed for plugin" >> report.log + ./gradlew :legacy:test || echo "* Unit tests failed for legacy" >> report.log + # jacoco + ./gradlew :opensearch:jacocoTestCoverageVerification || echo "* Jacoco failed for opensearch" >> report.log + ./gradlew :ppl:jacocoTestCoverageVerification || echo "* Jacoco failed for sql" >> report.log + ./gradlew :sql:jacocoTestCoverageVerification || echo "* Jacoco failed for ppl" >> report.log + ./gradlew :core:jacocoTestCoverageVerification || echo "* Jacoco failed for core" >> report.log + ./gradlew :protocol:jacocoTestCoverageVerification || echo "* Jacoco failed for protocol" >> report.log + ./gradlew :opensearch-sql-plugin:jacocoTestCoverageVerification || echo "* Jacoco failed for plugin" >> report.log + # Misc tests + ./gradlew :integ-test:integTest || echo "* Integration test failed" >> report.log + ./gradlew :doctest:doctest || echo "* Doctest failed" >> report.log + ./scripts/bwctest.sh || echo "* Backward compatibility test failed" >> report.log + + - name: Verify test results + run: | + if [[ -e failures.log ]] + then + echo "## FAILED TESTS :facepalm::warning::bangbang:" >> $GITHUB_STEP_SUMMARY + cat failures.log >> $GITHUB_STEP_SUMMARY + exit 1 + fi + + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-reports + path: | + sql/build/reports/** + ppl/build/reports/** + core/build/reports/** + common/build/reports/** + opensearch/build/reports/** + integ-test/build/reports/** + protocol/build/reports/** + legacy/build/reports/** + plugin/build/reports/** From 489f2adb6673a20722fcea5b93e87729a02125d2 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Tue, 27 Sep 2022 11:38:09 -0700 Subject: [PATCH 3/4] Typo fix. Signed-off-by: Yury-Fridlyand --- .github/workflows/link-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 5e42a68947..5d49d8aee2 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -10,7 +10,7 @@ on: - '[1-9]+.[0-9x]+.[0-9x]+' paths: - '**/*.pdf' - - '**/*.pnj' + - '**/*.png' - '**/*.jpg' - '**/*.json' - '**/*.md' From 63c51377fbe6d3bbc0922242985b08f15801adc0 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Tue, 27 Sep 2022 13:52:35 -0700 Subject: [PATCH 4/4] Address PR feedback. Signed-off-by: Yury-Fridlyand --- .github/workflows/backport.yml | 2 +- .github/workflows/bi-connectors.yml | 2 +- .github/workflows/codeql-analysis.yml | 3 +-- .github/workflows/dco.yml | 2 +- .github/workflows/delete_backport_branch.yml | 2 +- .../workflows/draft-release-notes-workflow.yml | 3 +-- .github/workflows/link-checker.yml | 11 +---------- .../sql-cli-test-and-build-workflow.yml | 5 ++--- .../sql-jdbc-test-and-build-workflow.yml | 2 +- .../workflows/sql-test-and-build-workflow.yml | 4 ++-- .github/workflows/sql-test-workflow.yml | 18 +----------------- .../sql-workbench-test-and-build-workflow.yml | 12 +----------- 12 files changed, 14 insertions(+), 52 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 7cb0856a86..e47d8d88c0 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -7,7 +7,7 @@ on: jobs: backport: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest permissions: contents: write pull-requests: write diff --git a/.github/workflows/bi-connectors.yml b/.github/workflows/bi-connectors.yml index 245c568fa9..45c76fd8e6 100644 --- a/.github/workflows/bi-connectors.yml +++ b/.github/workflows/bi-connectors.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Pack Tableau JDBC connector diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e043581de9..92ab3ddcf3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -5,7 +5,6 @@ on: branches: - 'main' - '[1-9]+.[0-9x]+' - - '[1-9]+.[0-9x]+.[0-9x]+' types: [opened, reopened] push: branches-ignore: @@ -17,7 +16,7 @@ on: jobs: analyze: name: CodeQL-Scan - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest permissions: security-events: write actions: read diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml index fc206f5ae1..cf30ea89dc 100644 --- a/.github/workflows/dco.yml +++ b/.github/workflows/dco.yml @@ -4,7 +4,7 @@ on: [pull_request] jobs: check: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Get PR Commits diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml index ec69dcaa06..387a124b8c 100644 --- a/.github/workflows/delete_backport_branch.yml +++ b/.github/workflows/delete_backport_branch.yml @@ -6,7 +6,7 @@ on: jobs: delete-branch: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: startsWith(github.event.pull_request.head.ref,'backport/') steps: - name: Delete merged branch diff --git a/.github/workflows/draft-release-notes-workflow.yml b/.github/workflows/draft-release-notes-workflow.yml index c0a157ee40..559bc39c3b 100644 --- a/.github/workflows/draft-release-notes-workflow.yml +++ b/.github/workflows/draft-release-notes-workflow.yml @@ -7,12 +7,11 @@ on: branches: - 'main' - '[1-9]+.[0-9x]+' - - '[1-9]+.[0-9x]+.[0-9x]+' jobs: update_release_draft: name: Update draft release notes - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "develop" - name: Update draft release notes diff --git a/.github/workflows/link-checker.yml b/.github/workflows/link-checker.yml index 5d49d8aee2..97b228fe72 100644 --- a/.github/workflows/link-checker.yml +++ b/.github/workflows/link-checker.yml @@ -7,20 +7,11 @@ on: branches: - 'main' - '[1-9]+.[0-9x]+' - - '[1-9]+.[0-9x]+.[0-9x]+' - paths: - - '**/*.pdf' - - '**/*.png' - - '**/*.jpg' - - '**/*.json' - - '**/*.md' - - '**/*.txt' - - '**/*.rst' jobs: linkchecker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/sql-cli-test-and-build-workflow.yml b/.github/workflows/sql-cli-test-and-build-workflow.yml index 114813b9e2..608b65a5ab 100644 --- a/.github/workflows/sql-cli-test-and-build-workflow.yml +++ b/.github/workflows/sql-cli-test-and-build-workflow.yml @@ -12,15 +12,14 @@ on: jobs: build: - - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: working-directory: sql-cli strategy: matrix: python-version: [3.8] - opensearch-version: [ 2.2.1, latest ] + opensearch-version: [ latest ] steps: - name: Checkout SQL CLI diff --git a/.github/workflows/sql-jdbc-test-and-build-workflow.yml b/.github/workflows/sql-jdbc-test-and-build-workflow.yml index 2342e00cd6..b7d9564fc5 100644 --- a/.github/workflows/sql-jdbc-test-and-build-workflow.yml +++ b/.github/workflows/sql-jdbc-test-and-build-workflow.yml @@ -17,7 +17,7 @@ jobs: java: - 11 - 17 - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest defaults: run: working-directory: sql-jdbc diff --git a/.github/workflows/sql-test-and-build-workflow.yml b/.github/workflows/sql-test-and-build-workflow.yml index bd9e496728..9d9758f5a1 100644 --- a/.github/workflows/sql-test-and-build-workflow.yml +++ b/.github/workflows/sql-test-and-build-workflow.yml @@ -25,7 +25,7 @@ jobs: java: - 11 - 17 - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -37,7 +37,7 @@ jobs: java-version: ${{ matrix.java }} - name: Build with Gradle - run: ./gradlew build assemble + run: ./gradlew --continue build assemble - name: Run backward compatibility tests run: ./scripts/bwctest.sh diff --git a/.github/workflows/sql-test-workflow.yml b/.github/workflows/sql-test-workflow.yml index 5ff8bbfc3b..9a20f53b87 100644 --- a/.github/workflows/sql-test-workflow.yml +++ b/.github/workflows/sql-test-workflow.yml @@ -2,22 +2,6 @@ name: SQL Plugin Tests on: workflow_dispatch: - push: - branches: - - 'dev-*' - paths: - - '**/*.java' - - '**/*.g4' - - '!sql-jdbc/**' - - '**gradle*' - - '**lombok*' - - '**checkstyle*' - - 'integ-test/**' - - 'docs/**' - - 'doctest/**' - - '**/*.jar' - - '**/*.pom' - - '.github/workflows/sql-test-workflow.yml' jobs: build: @@ -26,7 +10,7 @@ jobs: java: - 11 - 17 - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/sql-workbench-test-and-build-workflow.yml b/.github/workflows/sql-workbench-test-and-build-workflow.yml index 588c2ee3d7..ff42eb3e8c 100644 --- a/.github/workflows/sql-workbench-test-and-build-workflow.yml +++ b/.github/workflows/sql-workbench-test-and-build-workflow.yml @@ -7,13 +7,6 @@ on: branches-ignore: - 'dependabot/**' paths: - - '**/*.java' - - '**/*.g4' - - '!sql-jdbc/**' - - '**gradle*' - - '**lombok*' - - '**/*.jar' - - '**/*.pom' - 'workbench/**' - '.github/workflows/sql-workbench-test-and-build-workflow.yml' @@ -23,11 +16,8 @@ env: OPENSEARCH_PLUGIN_VERSION: 2.4.0.0 jobs: - build: - - runs-on: ubuntu-20.04 - + runs-on: ubuntu-latest steps: - name: Checkout Plugin uses: actions/checkout@v3