From 9d2257d349fc24112125cba2c3cdf99bb1941fd2 Mon Sep 17 00:00:00 2001 From: Tyler Graff Date: Thu, 28 Mar 2024 09:53:25 -0400 Subject: [PATCH 1/3] Provide mechanism to skip cloud provider tests by setting repo NO_PROVIDER_CREDENTIALS variable --- .github/workflows/test-provider.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-provider.yaml b/.github/workflows/test-provider.yaml index 717a332482..1b8a5c767c 100644 --- a/.github/workflows/test-provider.yaml +++ b/.github/workflows/test-provider.yaml @@ -32,8 +32,12 @@ on: jobs: test-render-providers: - # avoid running on PRs coming from a fork - if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request' + # Mechanism to prevent this test from running + # - on forks whose maintainers specify that provider credentials are absent (by setting a github variable NO_PROVIDER_CREDENTIALS) + # - on PRs coming from a fork (in which case github does not make the destination fork's credentials available) + if: | + vars.NO_PROVIDER_CREDENTIALS == '' && + (github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request') name: "Test Nebari Provider" runs-on: ubuntu-latest permissions: @@ -55,6 +59,9 @@ jobs: - gitlab-ci fail-fast: false steps: + - name: "Debug Print NO_PROVIDER_CREDENTIALS" + run: echo ${{ vars.NO_PROVIDER_CREDENTIALS }} + - name: "Checkout Infrastructure" uses: actions/checkout@v4 @@ -63,6 +70,7 @@ jobs: run: hub pr checkout ${{ inputs.pr_number }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + #NO_PROVIDER_CREDENTIALS: ${{ vars.NO_PROVIDER_CREDENTIALS }} - name: Set up Python uses: actions/setup-python@v5 From a38520792a22bce0e72ee51479eada1c574b4a28 Mon Sep 17 00:00:00 2001 From: Tyler Graff Date: Thu, 28 Mar 2024 09:56:03 -0400 Subject: [PATCH 2/3] remove debug code --- .github/workflows/test-provider.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test-provider.yaml b/.github/workflows/test-provider.yaml index 1b8a5c767c..5e0f37a814 100644 --- a/.github/workflows/test-provider.yaml +++ b/.github/workflows/test-provider.yaml @@ -59,9 +59,6 @@ jobs: - gitlab-ci fail-fast: false steps: - - name: "Debug Print NO_PROVIDER_CREDENTIALS" - run: echo ${{ vars.NO_PROVIDER_CREDENTIALS }} - - name: "Checkout Infrastructure" uses: actions/checkout@v4 @@ -70,7 +67,6 @@ jobs: run: hub pr checkout ${{ inputs.pr_number }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - #NO_PROVIDER_CREDENTIALS: ${{ vars.NO_PROVIDER_CREDENTIALS }} - name: Set up Python uses: actions/setup-python@v5 From ece881b9aa3b98967909bac3312231e42e3863a3 Mon Sep 17 00:00:00 2001 From: Tyler Graff <34993299+tylergraff@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:58:03 -0400 Subject: [PATCH 3/3] incorporate code comment feedback Co-authored-by: Vinicius D. Cerutti <51954708+viniciusdc@users.noreply.github.com> --- .github/workflows/test-provider.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-provider.yaml b/.github/workflows/test-provider.yaml index 5e0f37a814..339b6a0b58 100644 --- a/.github/workflows/test-provider.yaml +++ b/.github/workflows/test-provider.yaml @@ -32,9 +32,10 @@ on: jobs: test-render-providers: - # Mechanism to prevent this test from running - # - on forks whose maintainers specify that provider credentials are absent (by setting a github variable NO_PROVIDER_CREDENTIALS) - # - on PRs coming from a fork (in which case github does not make the destination fork's credentials available) + # Prevents the execution of this test under the following conditions: + # 1. When the 'NO_PROVIDER_CREDENTIALS' GitHub variable is set, indicating the absence of provider credentials. + # 2. For pull requests (PRs) originating from a fork, since GitHub does not provide the fork's credentials to the destination repository. + # ref. https://github.com/nebari-dev/nebari/issues/2379 if: | vars.NO_PROVIDER_CREDENTIALS == '' && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request')