From cb7d0c61fa628e60c3693c5c3129495307bca5a9 Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Mon, 30 Oct 2023 16:08:36 +0300 Subject: [PATCH] Add check_enterprise_merge.sh back --- .github/workflows/build_and_test.yml | 31 ++++++++++++++++++++++++++++ ci/check_all_ci_scripts_are_run.sh | 2 +- ci/check_enterprise_merge.sh | 4 ++-- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6a9fc4a8a..88fbcc69c 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -324,3 +324,34 @@ jobs: cd ./src/test/hammerdb chmod +x run_hammerdb.sh run_hammerdb.sh citusbot_tpcc_benchmark_rg + check_merge_to_enterprise: + name: Check Merge to Enterprise + runs-on: ubuntu-20.04 + needs: params + container: + image: ${{ needs.params.outputs.build_image_name }}:${{ needs.params.outputs.pg13_version }} + options: --user root + if: ${{ !startsWith(github.HEAD_REF, 'release') }} + steps: + - name: Install dependencies + run: |- + # update stretch repositories + sed -i -e 's/deb.debian.org/archive.debian.org/g' -e 's|security.debian.org|archive.debian.org/|g' -e '/stretch-updates/d' /etc/apt/sources.list + apt update || true + apt install git -y + # The action/checkout action uses the GitHub REST API to download the repository, + # and it doesn't include the .git folder required by `check_enterprise_merge.sh`. + # Therefore, we manually check out Citus to obtain the .git folder. + - name: Checkout citus manually to get .git folder + run: |- + git clone https://oauth2:${{ secrets.GITHUB_TOKEN }}@github.com/citusdata/citus.git + - name: Check if its mergable to citus-enterprise + run: |- + cd citus + git checkout ${{ github.HEAD_REF }} + ci/check_enterprise_merge.sh + env: + GIT_TOKEN: ${{ secrets.CITUS_ENTERPRISE_GHA_TOKEN }} + CIRCLE_BRANCH: ${{ github.HEAD_REF }} + shell: + bash diff --git a/ci/check_all_ci_scripts_are_run.sh b/ci/check_all_ci_scripts_are_run.sh index a0b4484ee..12516f793 100755 --- a/ci/check_all_ci_scripts_are_run.sh +++ b/ci/check_all_ci_scripts_are_run.sh @@ -11,7 +11,7 @@ source ci/ci_helpers.sh ci_scripts=$( find ci/ -iname "*.sh" | sed -E 's#^ci/##g' | - grep -v -E '^(ci_helpers.sh|fix_style.sh|check_enterprise_merge.sh)$' + grep -v -E '^(ci_helpers.sh|fix_style.sh)$' ) for script in $ci_scripts; do if ! grep "\\bci/$script\\b" -r .github > /dev/null; then diff --git a/ci/check_enterprise_merge.sh b/ci/check_enterprise_merge.sh index 097e1aed5..0b37c4cf3 100755 --- a/ci/check_enterprise_merge.sh +++ b/ci/check_enterprise_merge.sh @@ -2,7 +2,7 @@ # Testing this script locally requires you to set the following environment # variables: -# CIRCLE_BRANCH, GIT_USERNAME and GIT_TOKEN +# CIRCLE_BRANCH, and GIT_TOKEN # fail if trying to reference a variable that is not set. set -u @@ -12,7 +12,7 @@ set -e set -o pipefail PR_BRANCH="${CIRCLE_BRANCH}" -ENTERPRISE_REMOTE="https://${GIT_USERNAME}:${GIT_TOKEN}@github.com/citusdata/citus-enterprise" +ENTERPRISE_REMOTE="https://oauth2:${GIT_TOKEN}@github.com/citusdata/citus-enterprise" # shellcheck disable=SC1091 source ci/ci_helpers.sh