From 11a728fd743f63a468da6d3d72f978095a515879 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 00:46:45 +0000 Subject: [PATCH 1/5] ci: migrate commit status solution to connector tests workflow Co-Authored-By: Aaron Steers --- .github/workflows/connector-tests.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/connector-tests.yml b/.github/workflows/connector-tests.yml index b4e02fecb..150caecef 100644 --- a/.github/workflows/connector-tests.yml +++ b/.github/workflows/connector-tests.yml @@ -96,6 +96,8 @@ jobs: name: "Check: '${{matrix.connector}}' (skip=${{needs.cdk_changes.outputs['src'] == 'false' || needs.cdk_changes.outputs[matrix.cdk_extra] == 'false'}})" permissions: checks: write + contents: write # Required for creating commit statuses + pull-requests: read steps: - name: Abort if extra not changed (${{matrix.cdk_extra}}) id: no_changes @@ -127,6 +129,22 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.10" + # Create initial pending status for test report + - name: Create Pending Test Report Status + if: steps.no_changes.outputs.status != 'cancelled' + env: + GH_TOKEN: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} + run: | + HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}" + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/statuses/$HEAD_SHA \ + -f state="pending" \ + -f description="Running connector tests..." \ + -f context="${{ matrix.connector }} Test Report" + - name: Test Connector if: steps.no_changes.outputs.status != 'cancelled' timeout-minutes: 90 @@ -173,6 +191,39 @@ jobs: echo "success=${success}" >> $GITHUB_OUTPUT echo "html_report_url=${html_report_url}" >> $GITHUB_OUTPUT + # Update the test report status with results + - name: Update Test Report Status + if: always() && steps.no_changes.outputs.status != 'cancelled' && steps.evaluate_output.outcome == 'success' + env: + GH_TOKEN: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} + run: | + HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}" + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/statuses/$HEAD_SHA \ + -f state="${{ steps.evaluate_output.outputs.success == 'true' && 'success' || 'failure' }}" \ + -f target_url="${{ steps.evaluate_output.outputs.html_report_url }}" \ + -f description="Click Details to view the test report" \ + -f context="${{ matrix.connector }} Test Report" + + # Create failure status if report generation failed + - name: Create Report Generation Failed Status + if: always() && steps.no_changes.outputs.status != 'cancelled' && steps.evaluate_output.outcome != 'success' + env: + GH_TOKEN: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }} + run: | + HEAD_SHA="${{ github.event.pull_request.head.sha || github.sha }}" + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + repos/${{ github.repository }}/statuses/$HEAD_SHA \ + -f state="failure" \ + -f description="Test execution failed to generate a report" \ + -f context="${{ matrix.connector }} Test Report" + # Upload the job output to the artifacts - name: Upload Job Output id: upload_job_output From 693ddbce742ce40eb48a54b9188c221ed8791c5e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 00:47:20 +0000 Subject: [PATCH 2/5] ci: trigger connector tests Co-Authored-By: Aaron Steers --- airbyte_cdk/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/airbyte_cdk/__init__.py b/airbyte_cdk/__init__.py index 262d162cc..63c1e0c2d 100644 --- a/airbyte_cdk/__init__.py +++ b/airbyte_cdk/__init__.py @@ -356,3 +356,4 @@ ).serialize() except: __version__ = "0.0.0+dev" + From 43c0555c4cf77eb57aec844d66acc5e42901d181 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 01:16:52 +0000 Subject: [PATCH 3/5] ci: switch to ubuntu-22.04 runners Co-Authored-By: Aaron Steers --- .github/workflows/connector-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/connector-tests.yml b/.github/workflows/connector-tests.yml index 150caecef..bb46c5533 100644 --- a/.github/workflows/connector-tests.yml +++ b/.github/workflows/connector-tests.yml @@ -25,7 +25,7 @@ concurrency: jobs: cdk_changes: name: Get Changes - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 permissions: statuses: write pull-requests: read @@ -62,7 +62,7 @@ jobs: # Forked PRs are handled by the community_ci.yml workflow # If the condition is not met the job will be skipped (it will not fail) # runs-on: connector-test-large - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 timeout-minutes: 360 # 6 hours strategy: fail-fast: false From e4457848030075e8630ba8c9ef0d6381b2f67264 Mon Sep 17 00:00:00 2001 From: "Aaron (\"AJ\") Steers" Date: Thu, 23 Jan 2025 17:40:43 -0800 Subject: [PATCH 4/5] Apply suggestions from code review --- .github/workflows/connector-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/connector-tests.yml b/.github/workflows/connector-tests.yml index bb46c5533..4f6cedee0 100644 --- a/.github/workflows/connector-tests.yml +++ b/.github/workflows/connector-tests.yml @@ -221,7 +221,7 @@ jobs: -H "X-GitHub-Api-Version: 2022-11-28" \ repos/${{ github.repository }}/statuses/$HEAD_SHA \ -f state="failure" \ - -f description="Test execution failed to generate a report" \ + -f description="Failed to run connector tests." \ -f context="${{ matrix.connector }} Test Report" # Upload the job output to the artifacts From 67d1085c18eb19aab6ff1ffd837481d34ddfd3b1 Mon Sep 17 00:00:00 2001 From: octavia-squidington-iii Date: Fri, 24 Jan 2025 01:42:34 +0000 Subject: [PATCH 5/5] Auto-fix lint and format issues --- airbyte_cdk/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/airbyte_cdk/__init__.py b/airbyte_cdk/__init__.py index 63c1e0c2d..262d162cc 100644 --- a/airbyte_cdk/__init__.py +++ b/airbyte_cdk/__init__.py @@ -356,4 +356,3 @@ ).serialize() except: __version__ = "0.0.0+dev" -