From c5a4b7c3c41d404522135999dda1de0e89eccc61 Mon Sep 17 00:00:00 2001 From: Jose Pefaur Date: Fri, 10 Oct 2025 13:35:30 -0500 Subject: [PATCH 1/7] add bash script that creates github issue --- .../create-gh-issue.sh | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh diff --git a/tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh b/tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh new file mode 100755 index 000000000000..1666e92f986c --- /dev/null +++ b/tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# Creates a GitHub issue for CDK connector compatibility test failures. +# If an issue for the connector already exists, appends a new entry to the existing issue +# instead of creating a new issue. +# +# This is intended to be used by the move team since it has specific logic to how the move team manages oncall issues. +# +# Usage: tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh +# Example: tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh destination-dev-null www.myjoburl.com abcdef123456 + +# default values are specific to how the move team manages issues +ISSUES_REPOSITORY="${ISSUES_REPOSITORY:-airbytehq/airbyte-internal-issues}" +PROJECT_NUMBER="${PROJECT_NUMBER:-98}" +STATUS_FIELD_ID="${STATUS_FIELD_ID:-PVTSSF_lADOA4_XW84Am4WkzgetXZM}" +ONCALL_OPTION_ID="${ONCALL_OPTION_ID:-3ecf8bb4}" + +connector_name=$1 +job_url=$2 +commit_sha=$3 + +title="[CDK Connector Compatibility Test] Failures for $connector_name" + +existing_issue_number=$(gh issue list --state open --search "$title in:title" -R $ISSUES_REPOSITORY --json number --jq '.[0].number') + +# Build new entry +timestamp="$(date -u +'%Y-%m-%d %H:%M:%SZ')" +entry=$'#### ❌ '"$timestamp"$'\n'"Run: $job_url"$'\n'"Commit: ${commit_sha}" + +if [ -n "${existing_issue_number:-}" ]; then + # add new entry to existing issue + existing_issue_body="$(gh issue view "$existing_issue_number" -R "$ISSUES_REPOSITORY" --json body --jq .body)" + updated_issue_body="$existing_issue_body"$'\n'"${entry}" + gh issue edit "$existing_issue_number" -R "$ISSUES_REPOSITORY" -b "$updated_issue_body" + echo "Updated issue #${existing_issue_number} with new failure entry." +else + # create new issue + INITIAL_BODY=$'# Test failure history\n\n'"${entry}" + issue_url=$(gh issue create -t "$title" -b "$INITIAL_BODY" -R $ISSUES_REPOSITORY) + echo "Created issue ${issue_url}." + item_id=$(gh project item-add $PROJECT_NUMBER --owner "airbytehq" --url "$issue_url" --format json --jq '.id') + project_id=$(gh project view $PROJECT_NUMBER --owner "airbytehq" --format json --jq '.id') + gh project item-edit \ + --id $item_id \ + --project-id $project_id \ + --field-id $STATUS_FIELD_ID \ + --single-select-option-id "$ONCALL_OPTION_ID" + echo "Created new issue for $connector_name." +fi From 7b0b6001e26235b28749ded4ef33018b88f85dfd Mon Sep 17 00:00:00 2001 From: Jose Pefaur Date: Fri, 10 Oct 2025 13:35:51 -0500 Subject: [PATCH 2/7] update workflow to create gh issue on connector test failure --- .../cdk-connector-compatibility-test.yml | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cdk-connector-compatibility-test.yml b/.github/workflows/cdk-connector-compatibility-test.yml index b6c786b12c55..7ce9db88c014 100644 --- a/.github/workflows/cdk-connector-compatibility-test.yml +++ b/.github/workflows/cdk-connector-compatibility-test.yml @@ -114,12 +114,40 @@ jobs: working-directory: airbyte-integrations/connectors/${{ matrix.connector }} run: poe test-integration-tests + - name: Check if move team should be notified + id: check-move-notify + if: always() + run: | + echo "should-notify=${{ + github.event_name == 'schedule' && + startsWith(matrix.connector, 'destination-') && + (steps.run-unit-tests.outcome == 'failure' || steps.run-integration-tests.outcome == 'failure') + }}" >> $GITHUB_OUTPUT + - name: Slack Notification on Failure - if: github.event_name == 'schedule' && failure() && (steps.run-unit-tests.outcome == 'failure' || steps.run-integration-tests.outcome == 'failure') + if: steps.check-move-notify.outputs.should-notify == 'true' uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 with: token: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }} method: chat.postMessage payload: | - channel: C09H56MT8J2 # jose-alert-test channel. The use of this channel is meant to be temporary while we evaluate the usefulness of these notifications. + channel: C09H56MT8J2 text: "`${{ matrix.connector }}` connector tests failed when using local CDK! " + + - name: Authenticate as GitHub App + if: steps.check-move-notify.outputs.should-notify == 'true' + uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2 + id: app-token + with: + owner: "airbytehq" + repositories: "airbyte-internal-issues" + app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }} + private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }} + + - name: Create Github Issue on Failure + if: steps.check-move-notify.outputs.should-notify == 'true' + run: tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh \ + ${{ matrix.connector }} \ + ${{ github.sha }} \ + "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" + From 1991d710c94232be5e14a6851be9013d3a85eb81 Mon Sep 17 00:00:00 2001 From: Jose Pefaur Date: Fri, 10 Oct 2025 13:40:21 -0500 Subject: [PATCH 3/7] delete extra line --- .github/workflows/cdk-connector-compatibility-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cdk-connector-compatibility-test.yml b/.github/workflows/cdk-connector-compatibility-test.yml index 7ce9db88c014..3939bbb3eac0 100644 --- a/.github/workflows/cdk-connector-compatibility-test.yml +++ b/.github/workflows/cdk-connector-compatibility-test.yml @@ -150,4 +150,3 @@ jobs: ${{ matrix.connector }} \ ${{ github.sha }} \ "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" - From 402079268f727049077cf238eb36464ef675a1b7 Mon Sep 17 00:00:00 2001 From: Jose Pefaur Date: Fri, 10 Oct 2025 15:53:59 -0500 Subject: [PATCH 4/7] run steps even if there are failures --- .github/workflows/cdk-connector-compatibility-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cdk-connector-compatibility-test.yml b/.github/workflows/cdk-connector-compatibility-test.yml index 3939bbb3eac0..6bf9cc241008 100644 --- a/.github/workflows/cdk-connector-compatibility-test.yml +++ b/.github/workflows/cdk-connector-compatibility-test.yml @@ -125,7 +125,7 @@ jobs: }}" >> $GITHUB_OUTPUT - name: Slack Notification on Failure - if: steps.check-move-notify.outputs.should-notify == 'true' + if: always() && steps.check-move-notify.outputs.should-notify == 'true' uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a # v2.1.1 with: token: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }} @@ -135,7 +135,7 @@ jobs: text: "`${{ matrix.connector }}` connector tests failed when using local CDK! " - name: Authenticate as GitHub App - if: steps.check-move-notify.outputs.should-notify == 'true' + if: always() && steps.check-move-notify.outputs.should-notify == 'true' uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2 id: app-token with: @@ -145,7 +145,7 @@ jobs: private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }} - name: Create Github Issue on Failure - if: steps.check-move-notify.outputs.should-notify == 'true' + if: always() && steps.check-move-notify.outputs.should-notify == 'true' run: tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh \ ${{ matrix.connector }} \ ${{ github.sha }} \ From 1f06c0c0ed0cc313b432a363f0c09592b3269b37 Mon Sep 17 00:00:00 2001 From: Jose Pefaur Date: Fri, 10 Oct 2025 15:55:07 -0500 Subject: [PATCH 5/7] use gh token --- .github/workflows/cdk-connector-compatibility-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cdk-connector-compatibility-test.yml b/.github/workflows/cdk-connector-compatibility-test.yml index 6bf9cc241008..2f7ba2d51beb 100644 --- a/.github/workflows/cdk-connector-compatibility-test.yml +++ b/.github/workflows/cdk-connector-compatibility-test.yml @@ -146,6 +146,8 @@ jobs: - name: Create Github Issue on Failure if: always() && steps.check-move-notify.outputs.should-notify == 'true' + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} run: tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh \ ${{ matrix.connector }} \ ${{ github.sha }} \ From 5521d9cc27388a77144970e7175a1cefab7d4270 Mon Sep 17 00:00:00 2001 From: Jose Pefaur Date: Fri, 10 Oct 2025 15:58:24 -0500 Subject: [PATCH 6/7] no need to set repo --- .github/workflows/cdk-connector-compatibility-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cdk-connector-compatibility-test.yml b/.github/workflows/cdk-connector-compatibility-test.yml index 2f7ba2d51beb..56fc2a7e85ef 100644 --- a/.github/workflows/cdk-connector-compatibility-test.yml +++ b/.github/workflows/cdk-connector-compatibility-test.yml @@ -140,7 +140,6 @@ jobs: id: app-token with: owner: "airbytehq" - repositories: "airbyte-internal-issues" app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }} private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }} From 4080874c11d29800b45ad0bfd15cc6893c58ffd8 Mon Sep 17 00:00:00 2001 From: Jose Pefaur Date: Fri, 10 Oct 2025 16:34:54 -0500 Subject: [PATCH 7/7] fix args order --- .github/workflows/cdk-connector-compatibility-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cdk-connector-compatibility-test.yml b/.github/workflows/cdk-connector-compatibility-test.yml index 56fc2a7e85ef..52b96f021f9c 100644 --- a/.github/workflows/cdk-connector-compatibility-test.yml +++ b/.github/workflows/cdk-connector-compatibility-test.yml @@ -149,5 +149,5 @@ jobs: GH_TOKEN: ${{ steps.app-token.outputs.token }} run: tools/bin/bulk-cdk-compatibility-test/create-gh-issue.sh \ ${{ matrix.connector }} \ - ${{ github.sha }} \ - "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" + "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" \ + ${{ github.sha }}