ci: make cdk connector compatibility test create gh issue (#67611)
## What We have a workflow that once a day checks if the latest CDK version would break any connector. If there are test failures, it sends a slack alert. In addition to sending a slack alert, we would like to get an oncall ticket in our github project. We should only do this for destinations (connectors owned by move) ## How Added a few extra steps to the workflow that calls a script that creates gh issues. It checks if an issue already exists for the connector. If it does it will update the description with information about the new failure. If it doesn't it will create a new ticket ## How did I test this? Tested in this PR https://github.com/airbytehq/airbyte/pull/67617. Confirmed that tickets were created if they didn't exist and that they were updated if they did exist. ## Can this PR be safely reverted and rolled back? <!-- * If unsure, leave it blank. --> - [x] YES 💚 - [ ] NO ❌
This commit is contained in:
@@ -103,12 +103,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: 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 }}
|
||||
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! <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View Test Logs>"
|
||||
|
||||
- name: Authenticate as GitHub App
|
||||
if: always() && steps.check-move-notify.outputs.should-notify == 'true'
|
||||
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2
|
||||
id: app-token
|
||||
with:
|
||||
owner: "airbytehq"
|
||||
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
|
||||
|
||||
- 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 }} \
|
||||
"https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}" \
|
||||
${{ github.sha }}
|
||||
|
||||
Reference in New Issue
Block a user