Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(EWT-193): Slack notification for failed scheduled acceptance tests #257

Merged
merged 41 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
341e466
ci review
dili91 Dec 21, 2023
032b34b
test ignore
dili91 Dec 21, 2023
5293cae
fix
dili91 Dec 21, 2023
91ddec6
test exclusion
dili91 Dec 21, 2023
4bce127
changed exclusion
dili91 Dec 21, 2023
d08972c
project version fix
dili91 Dec 21, 2023
e1a088b
project version fix
dili91 Dec 21, 2023
af4c531
fix
dili91 Dec 21, 2023
853ebe1
test
dili91 Dec 21, 2023
836f17f
test
dili91 Dec 21, 2023
7a76efd
test
dili91 Dec 21, 2023
02c950e
extracted checkout ref
dili91 Dec 21, 2023
5bced71
intermediate steps
dili91 Dec 21, 2023
437568c
echo cleanup
dili91 Dec 21, 2023
05a7541
removed deprecated set-output
dili91 Dec 21, 2023
e644d02
removed comment
dili91 Dec 21, 2023
99155c5
review comment
dili91 Dec 21, 2023
9e136a5
test
dili91 Dec 21, 2023
dc51fab
cleanup
dili91 Dec 21, 2023
6286f3e
updated refs for pr on forks
dili91 Dec 21, 2023
22f21a0
simplification
dili91 Dec 21, 2023
4cbcd95
worflow name change
dili91 Dec 21, 2023
b89a5d5
test slack alerts
dili91 Dec 21, 2023
15e3ea1
test slack alerts
dili91 Dec 21, 2023
f35331b
fix
dili91 Dec 21, 2023
b6c59ac
dependency
dili91 Dec 21, 2023
4a7179b
webhook url passed as param
dili91 Dec 21, 2023
d0e6de9
todos
dili91 Dec 21, 2023
7d4239d
changed execution condition for slack notifications
dili91 Dec 21, 2023
bc0b848
fix
dili91 Dec 21, 2023
8c86269
fix
dili91 Dec 21, 2023
dd5dfc3
cleanup
dili91 Dec 21, 2023
c672267
tags change
dili91 Dec 21, 2023
831b131
using @here tag
dili91 Dec 21, 2023
2484405
cleanup
dili91 Dec 21, 2023
4bc62dc
tidy up
dili91 Dec 21, 2023
9868783
tidy up
dili91 Dec 21, 2023
789b09a
added badge for scheduled acceptance tests
dili91 Dec 21, 2023
a18a689
conflict resolution
dili91 Dec 21, 2023
b45a39b
Merge branch 'main' into slack-notification-on-acceptance-tests
dili91 Dec 21, 2023
1e3a1ba
Merge branch 'main' into slack-notification-on-acceptance-tests
dili91 Dec 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 55 additions & 1 deletion .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
description: 'The reference to checkout before running the acceptance tests. Used to run the tests on a fork.'
required: true
type: string
notify_slack_on_failure:
description: 'Whether to notify slack or not.'
required: false
default: false
type: boolean
secrets:
tl_client_id:
required: true
Expand All @@ -17,6 +22,8 @@ on:
required: true
tl_signing_private_key:
required: true
slack_webhook_url:
required: false

jobs:
acceptance-tests:
Expand All @@ -39,4 +46,51 @@ jobs:
TL_CLIENT_SECRET: ${{ secrets.tl_client_secret }}
TL_SIGNING_KEY_ID: ${{ secrets.tl_signing_key_id }}
TL_SIGNING_PRIVATE_KEY: ${{ secrets.tl_signing_private_key }}
run: ./gradlew acceptance-tests
run: ./gradlew acceptance-tests
notify-slack:
needs: acceptance-tests
runs-on: ubuntu-latest
if: ${{ always() && contains(needs.*.result, 'failure') && inputs.notify_slack_on_failure == true }}
steps:
- name: Notify slack
uses: slackapi/slack-github-action@v1.24.0
env:
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_url }}
# type is required for custom payloads
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":fire: *Acceptance tests* are failing in *Sandbox* on our *Java* backend library! :java:"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": ":eyes: View on Github"
},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
},
{
"type": "image",
"title": {
"type": "plain_text",
"text": "I don't like that",
"emoji": true
},
"image_url": "https://media.giphy.com/media/4cuyucPeVWbNS/giphy.gif",
"alt_text": "marg"
}
]
}
4 changes: 3 additions & 1 deletion .github/workflows/workflow-scheduled-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ jobs:
uses: ./.github/workflows/acceptance-tests.yml
with:
checkout_ref: /refs/heads/main
notify_slack_on_failure: true
secrets:
tl_client_id: ${{ secrets.ACCEPTANCE_TEST_CLIENT_ID }}
tl_client_secret: ${{ secrets.ACCEPTANCE_TEST_CLIENT_SECRET }}
tl_signing_key_id: ${{ secrets.ACCEPTANCE_TEST_SIGNING_KEY_ID }}
tl_signing_private_key: ${{ secrets.ACCEPTANCE_TEST_SIGNING_PRIVATE_KEY }}
tl_signing_private_key: ${{ secrets.ACCEPTANCE_TEST_SIGNING_PRIVATE_KEY }}
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL}}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.truelayer/truelayer-java/badge.svg?style=flat)](https://search.maven.org/artifact/com.truelayer/truelayer-java)
[![javadoc](https://javadoc.io/badge2/com.truelayer/truelayer-java/javadoc.svg)](https://javadoc.io/doc/com.truelayer/truelayer-java)
[![Coverage Status](https://coveralls.io/repos/github/TrueLayer/truelayer-java/badge.svg?t=gcGKQv)](https://coveralls.io/github/TrueLayer/truelayer-java)
[![Scheduled acceptance tests](https://github.com/TrueLayer/truelayer-java/actions/workflows/scheduled-acceptance-tests.yml/badge.svg)](https://github.com/TrueLayer/truelayer-java/actions/workflows/scheduled-acceptance-tests.yml)
[![License](https://img.shields.io/:license-mit-blue.svg)](https://truelayer.mit-license.org/)

The official [TrueLayer](https://truelayer.com) Java client provides convenient access to TrueLayer APIs from applications built with Java.
Expand Down