Skip to content

Commit

Permalink
[FC] notify failure endpoint script on Maestro failures (stripe#6519)
Browse files Browse the repository at this point in the history
* [skip ci] Start PR

* Pass entire failure url to job.

* Update Maestro tests to report to RUN_BANKCON_MOBILE.

* Revert finicity change.

* Just run if build fails.

* Updates bitrise file.

* Test pipeline (revert)

* Updates bitrise file.

* Fix pipeline

* Fix pipeline

* Test - Make maestro tests fail.

* Removes duplicated deploy to bitrise.

* Revert test changes.

* Revert deploy to bitrise.
  • Loading branch information
carlosmuvi-stripe authored Apr 12, 2023
1 parent acab49d commit 33631af
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/end_to_end_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
./scripts/notify_failure_endpoint.rb \
${{ secrets.SDK_FAILURE_NOTIFICATION_ENDPOINT }} \
${{ secrets.SDK_FAILURE_NOTIFICATION_ENDPOINT_HMAC_KEY }} \
${{ github.run_id }} \
"https://github.com/stripe/stripe-android/actions/runs/${{ github.run_id }}" \
RUN_MOBILESDK
4 changes: 2 additions & 2 deletions .github/workflows/instrumentation_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
./scripts/notify_failure_endpoint.rb \
${{ secrets.SDK_FAILURE_NOTIFICATION_ENDPOINT }} \
${{ secrets.SDK_FAILURE_NOTIFICATION_ENDPOINT_HMAC_KEY }} \
${{ github.run_id }} \
"https://github.com/stripe/stripe-android/actions/runs/${{ github.run_id }}" \
RUN_MOBILESDK
screenshot-regression-tests:
Expand Down Expand Up @@ -66,5 +66,5 @@ jobs:
# ./scripts/notify_failure_endpoint.rb \
# ${{ secrets.SDK_FAILURE_NOTIFICATION_ENDPOINT }} \
# ${{ secrets.SDK_FAILURE_NOTIFICATION_ENDPOINT_HMAC_KEY }} \
# ${{ github.run_id }} \
# "https://github.com/stripe/stripe-android/actions/runs/${{ github.run_id }}" \
# RUN_MOBILESDK
16 changes: 16 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,22 @@ workflows:
inputs:
- webhook_url: $WEBHOOK_SLACK_CARLOSMUVI_MAESTRO
- webhook_url_on_error: $WEBHOOK_SLACK_CARLOSMUVI_MAESTRO
- script@1:
title: Notify failure endpoint
inputs:
- content: |
#!/usr/bin/env bash
set -e
set -o pipefail
set -x
ruby ./scripts/notify_failure_endpoint.rb \
$SDK_FAILURE_NOTIFICATION_ENDPOINT \
$SDK_FAILURE_NOTIFICATION_ENDPOINT_HMAC_KEY \
$BITRISE_BUILD_URL \
RUN_BANKCON_MOBILE
is_always_run: true
run_if: ".IsBuildFailed"
- custom-test-results-export@0:
inputs:
- search_pattern: '*/maestroReport.xml'
Expand Down
13 changes: 7 additions & 6 deletions scripts/notify_failure_endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@

env_sdk_failure_notif_endpoint = ARGV[0]
env_sdk_failure_notif_endpoint_hmac_key = ARGV[1]
github_run_id = ARGV[2]
jira_project = ARGV[3]


if !env_sdk_failure_notif_endpoint || !env_sdk_failure_notif_endpoint_hmac_key
puts "SDK_FAILURE_NOTIFICATION_ENDPOINT` or `SDK_FAILURE_NOTIFICATION_ENDPOINT_HMAC_KEY` not found"
exit 102
end

if !github_run_id
puts "github_run_id not found"
failing_run_url = ARGV[2]

if !failing_run_url
puts "failing_run_url not found"
exit 102
end

jira_project = ARGV[3]

if !jira_project
puts "jira_project not found"
exit 102
Expand All @@ -39,7 +40,7 @@
}

params[:summary] = "stripe-android E2E test failed"
params[:description] = "Please ACK this ticket and investigate the failure. See https://github.com/stripe/stripe-android/actions/runs/#{github_run_id}"
params[:description] = "Please ACK this ticket and investigate the failure. See %s" % failing_run_url
params[:components] = %w[Android]

req.body = params.to_json
Expand Down

0 comments on commit 33631af

Please sign in to comment.