From 68a5d1a09d2b166bbb63276e7413ce02ea1a9003 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 17 Nov 2023 18:44:06 +0100 Subject: [PATCH 01/10] Run oss checks --- .github/workflows/budibase_ci.yml | 9 ++++++++- .github/workflows/check-oss-contributor.yml | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-oss-contributor.yml diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 7929da12e7..004a326c15 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -12,6 +12,13 @@ on: - master pull_request: workflow_dispatch: + workflow_call: + inputs: + run_as_oss: + type: boolean + required: false + description: Force running checks as if it was an OSS contributor + default: false env: BRANCH: ${{ github.event.pull_request.head.ref }} @@ -19,7 +26,7 @@ env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} NX_BASE_BRANCH: origin/${{ github.base_ref }} USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' }} - IS_OSS_CONTRIBUTOR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' }} + IS_OSS_CONTRIBUTOR: ${{ inputs.run_as_oss == 'true' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase') }} jobs: lint: diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml new file mode 100644 index 0000000000..afa3ff7af9 --- /dev/null +++ b/.github/workflows/check-oss-contributor.yml @@ -0,0 +1,13 @@ +name: OSS contributor checks +on: + workflow_dispatch: + schedule: + - cron: "0 8,16 * * 1-5" # on weekdays at 8am and 4pm + +jobs: + run: + name: Publish server and worker docker images + uses: ./.github/workflows/budibase_ci.yml + with: + run_as_oss: true + secrets: inherit From 50e22b54fe10892ef0727407728488e6072b09a2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 17 Nov 2023 18:44:39 +0100 Subject: [PATCH 02/10] Run branch for test --- .github/workflows/check-oss-contributor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml index afa3ff7af9..c2ece9254a 100644 --- a/.github/workflows/check-oss-contributor.yml +++ b/.github/workflows/check-oss-contributor.yml @@ -3,6 +3,9 @@ on: workflow_dispatch: schedule: - cron: "0 8,16 * * 1-5" # on weekdays at 8am and 4pm + push: + branches: + - chore/run_oss_checks # TODO: remove jobs: run: From c41e339d9db6841250e5f0466b321410af37999f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 17 Nov 2023 18:49:41 +0100 Subject: [PATCH 03/10] Attempt --- .github/workflows/budibase_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 004a326c15..6e04ca6f67 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -26,7 +26,7 @@ env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} NX_BASE_BRANCH: origin/${{ github.base_ref }} USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' }} - IS_OSS_CONTRIBUTOR: ${{ inputs.run_as_oss == 'true' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase') }} + IS_OSS_CONTRIBUTOR: ${{ inputs.run_as_oss == true || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase') }} jobs: lint: From d4060c0f78c0afeb4a52f8b5bbbd322b7162e872 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 09:52:00 +0100 Subject: [PATCH 04/10] Add alerts --- .github/workflows/check-oss-contributor.yml | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml index c2ece9254a..f9bd54248e 100644 --- a/.github/workflows/check-oss-contributor.yml +++ b/.github/workflows/check-oss-contributor.yml @@ -8,9 +8,29 @@ on: - chore/run_oss_checks # TODO: remove jobs: - run: + run-checks: name: Publish server and worker docker images uses: ./.github/workflows/budibase_ci.yml with: run_as_oss: true secrets: inherit + + notify-error: + needs: ["run-checks"] + if: ${{ failure() }} + name: Notify error + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set commit SHA + id: set_sha + run: echo "::set-output name=sha::$(git rev-parse --short ${{ github.sha }})" + + - name: Notify error + uses: tsickert/discord-webhook@v5.3.0 + with: + webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} + embed-title: "[TEST] OSS checks failed in master" + content: "The OSS build is failing on master. SHA: ${{ steps.set_sha.outputs.sha }}, link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" From c0ae8640c0fae0ed10b357003724501d3e289a1f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 09:52:18 +0100 Subject: [PATCH 05/10] Run always for testing --- .github/workflows/check-oss-contributor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml index f9bd54248e..01cb87656b 100644 --- a/.github/workflows/check-oss-contributor.yml +++ b/.github/workflows/check-oss-contributor.yml @@ -16,8 +16,8 @@ jobs: secrets: inherit notify-error: - needs: ["run-checks"] - if: ${{ failure() }} + # needs: ["run-checks"] + if: ${{ always() }} name: Notify error runs-on: ubuntu-latest steps: From 0f2d95cd2e2d29ee3409e7eaab4d9f594638c6d8 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 09:56:37 +0100 Subject: [PATCH 06/10] Test message --- .github/workflows/check-oss-contributor.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml index 01cb87656b..da5036b530 100644 --- a/.github/workflows/check-oss-contributor.yml +++ b/.github/workflows/check-oss-contributor.yml @@ -33,4 +33,7 @@ jobs: with: webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} embed-title: "[TEST] OSS checks failed in master" - content: "The OSS build is failing on master. SHA: ${{ steps.set_sha.outputs.sha }}, link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + embed-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + embed-description: | + 🚨 The OSS build is failing on master ⚠️ + Git sha: `${{ steps.set_sha.outputs.sha }}` From cf30097710badfeeebb63df48202521b8fbe71ec Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 09:58:09 +0100 Subject: [PATCH 07/10] Title change --- .github/workflows/check-oss-contributor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml index da5036b530..93f6bcadab 100644 --- a/.github/workflows/check-oss-contributor.yml +++ b/.github/workflows/check-oss-contributor.yml @@ -32,8 +32,7 @@ jobs: uses: tsickert/discord-webhook@v5.3.0 with: webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} - embed-title: "[TEST] OSS checks failed in master" + embed-title: 🚨 OSS checks failed in master embed-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" embed-description: | - 🚨 The OSS build is failing on master ⚠️ Git sha: `${{ steps.set_sha.outputs.sha }}` From 370d12965cc75331249cfd618bd925fcb87fe7e4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 09:58:43 +0100 Subject: [PATCH 08/10] Cleanup pipeline --- .github/workflows/check-oss-contributor.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml index 93f6bcadab..ec40cad399 100644 --- a/.github/workflows/check-oss-contributor.yml +++ b/.github/workflows/check-oss-contributor.yml @@ -3,9 +3,6 @@ on: workflow_dispatch: schedule: - cron: "0 8,16 * * 1-5" # on weekdays at 8am and 4pm - push: - branches: - - chore/run_oss_checks # TODO: remove jobs: run-checks: @@ -16,8 +13,8 @@ jobs: secrets: inherit notify-error: - # needs: ["run-checks"] - if: ${{ always() }} + needs: ["run-checks"] + if: ${{ failure() }} name: Notify error runs-on: ubuntu-latest steps: From 5a608b0873f6bf5ce1ef3e4b99b552071816c7b7 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 10:05:25 +0100 Subject: [PATCH 09/10] Change webhook url --- .github/workflows/check-oss-contributor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-oss-contributor.yml b/.github/workflows/check-oss-contributor.yml index ec40cad399..398f07a130 100644 --- a/.github/workflows/check-oss-contributor.yml +++ b/.github/workflows/check-oss-contributor.yml @@ -28,7 +28,7 @@ jobs: - name: Notify error uses: tsickert/discord-webhook@v5.3.0 with: - webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }} + webhook-url: ${{ secrets.OSS_CHECKS_WEBHOOK_URL }} embed-title: 🚨 OSS checks failed in master embed-url: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" embed-description: | From d9ed5fb3d09f73437c997ac64213562a29a26aa0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 20 Nov 2023 10:07:33 +0100 Subject: [PATCH 10/10] Do not release fb for OSS --- .github/workflows/deploy-featurebranch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-featurebranch.yml b/.github/workflows/deploy-featurebranch.yml index f1fb12c087..c70f2fff20 100644 --- a/.github/workflows/deploy-featurebranch.yml +++ b/.github/workflows/deploy-featurebranch.yml @@ -7,6 +7,7 @@ on: jobs: release: + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3