<commit_before>name: Upgrade Downgrade Testing Query Serving
on:
  push:
  pull_request:

concurrency:
  group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Query Serving')
  cancel-in-progress: true

# This test ensures that our end-to-end tests work using Vitess components
# (vtgate, vttablet, etc) built on different versions.

jobs:
  get_upgrade_downgrade_label:
    if: github.repository == 'vitessio/vitess'
    name: Get the Upgrade Downgrade pull request label
    runs-on: ubuntu-latest
    outputs:
      hasLabel: ${{ steps.check_label.outputs.hasLabel }}

    steps:
      - name: Check Label
        uses: Dreamcodeio/pr-has-label-action@master
        id: check_label
        with:
          label: Skip Upgrade Downgrade

  get_latest_release:
    if: always() && (github.event_name != 'pull_request' || needs.get_upgrade_downgrade_label.outputs.hasLabel == 'false')
    name: Get latest release
    runs-on: ubuntu-latest
    needs:
      - get_upgrade_downgrade_label
    outputs:
      latest_release: ${{ steps.set-outpout.outputs.matrix }}

    steps:
      - name: Check out to HEAD
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Get latest major release of Vitess
        run: |
          last_major_releases=$(git show-ref --tags | grep -E 'refs/tags/v[0-9]*.[0-9]*.0$' | sed 's/[a-z0-9]* refs\/tags\/v//' | sort -nr | head -n1)
          echo "latest_releases=$(echo "$last_major_releases" | awk ' BEGIN { ORS = ""; print "["; } { print "\/\@{\\\"project\\\":\\\"v"$0"\\\"}\/\@"; } END { print "]"; }' | sed "s^\/\@\/\@^, ^g;s^\/\@^^g")" >> $GITHUB_ENV

      - name: Set output
        id: set-outpout
        run: |
          echo "::set-output name=matrix::{\"include\":${{ env.latest_releases }} }"

  upgrade_downgrade_test:
    if: always() && (github.event_name != 'pull_request' || needs.get_upgrade_downgrade_label.outputs.hasLabel == 'false')
    name: Run Upgrade Downgrade Test
    runs-on: ubuntu-latest
    needs:
      - get_upgrade_downgrade_label
      - get_latest_release
    strategy:
      fail-fast: false
      matrix: ${{fromJSON(needs.get_latest_release.outputs.latest_release)}}

    steps:
    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.17<commit_msg>feat: change how we check the skip label<commit_after>name: Upgrade Downgrade Testing Query Serving
on:
  push:
  pull_request:

concurrency:
  group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Query Serving')
  cancel-in-progress: true

# This test ensures that our end-to-end tests work using Vitess components
# (vtgate, vttablet, etc) built on different versions.

jobs:
  get_upgrade_downgrade_label:
    if: github.repository == 'vitessio/vitess'
    name: Get the Upgrade Downgrade pull request label
    runs-on: ubuntu-latest
    outputs:
      hasLabel: ${{ steps.check_label.outputs.hasLabel }}

    steps:
      - name: Check Label
        uses: Dreamcodeio/pr-has-label-action@master
        id: check_label
        with:
          label: Skip Upgrade Downgrade

  get_latest_release:
    if: always() && (github.event_name != 'pull_request' || needs.get_upgrade_downgrade_label.outputs.hasLabel != 'true')
    name: Get latest release
    runs-on: ubuntu-latest
    needs:
      - get_upgrade_downgrade_label
    outputs:
      latest_release: ${{ steps.set-outpout.outputs.matrix }}

    steps:
      - name: Check out to HEAD
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Get latest major release of Vitess
        run: |
          last_major_releases=$(git show-ref --tags | grep -E 'refs/tags/v[0-9]*.[0-9]*.0$' | sed 's/[a-z0-9]* refs\/tags\/v//' | sort -nr | head -n1)
          echo "latest_releases=$(echo "$last_major_releases" | awk ' BEGIN { ORS = ""; print "["; } { print "\/\@{\\\"project\\\":\\\"v"$0"\\\"}\/\@"; } END { print "]"; }' | sed "s^\/\@\/\@^, ^g;s^\/\@^^g")" >> $GITHUB_ENV

      - name: Set output
        id: set-outpout
        run: |
          echo "::set-output name=matrix::{\"include\":${{ env.latest_releases }} }"

  upgrade_downgrade_test:
    if: always() && (github.event_name != 'pull_request' || needs.get_upgrade_downgrade_label.outputs.hasLabel != 'false')
    name: Run Upgrade Downgrade Test
    runs-on: ubuntu-latest
    needs:
      - get_upgrade_downgrade_label
      - get_latest_release
    strategy:
      fail-fast: false
      matrix: ${{fromJSON(needs.get_latest_release.outputs.latest_release)}}

    steps:
    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.17
{'fraction_non_alphanumeric': 0.14689387402933562, 'fraction_numerical': 0.007333908541846419, 'mean_word_length': 2.697767145135566, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2011579', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1524, 'n_words': 358}