Skip to content

Commit

Permalink
Add number of retries to webhook_called events
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Sep 15, 2021
1 parent f4b5064 commit 796b82d
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI
on: [push, pull_request]
env:
go-version: '1.16.x'
go-version: '1.17.x'
jobs:
test:
name: Test
Expand Down
8 changes: 8 additions & 0 deletions flows/actions/testdata/call_resthook.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"request": "POST / HTTP/1.1\r\nHost: temba.io\r\nUser-Agent: goflow-testing\r\nContent-Length: 898\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":\"tel:+12065551212\",\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":{\"attachments\":[{\"content_type\":\"image/jpeg\",\"url\":\"http://http://s3.amazon.com/bucket/test.jpg\"},{\"content_type\":\"audio/mp3\",\"url\":\"http://s3.amazon.com/bucket/test.mp3\"}],\"channel\":null,\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"text\":\"Hi everybody\",\"type\":\"msg\",\"urn\":{\"display\":\"(206) 555-1212\",\"path\":\"+12065551212\",\"scheme\":\"tel\"},\"uuid\":\"aa90ce99-3b4d-44ba-b0ca-79e63d9ed842\"},\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 200 OK\r\nContent-Length: 16\r\n\r\n{ \"ok\": \"true\" }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "new-registration",
"status_code": 200
},
Expand All @@ -113,6 +114,7 @@
"request": "POST / HTTP/1.1\r\nHost: unavailable.com\r\nUser-Agent: goflow-testing\r\nContent-Length: 898\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":\"tel:+12065551212\",\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":{\"attachments\":[{\"content_type\":\"image/jpeg\",\"url\":\"http://http://s3.amazon.com/bucket/test.jpg\"},{\"content_type\":\"audio/mp3\",\"url\":\"http://s3.amazon.com/bucket/test.mp3\"}],\"channel\":null,\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"text\":\"Hi everybody\",\"type\":\"msg\",\"urn\":{\"display\":\"(206) 555-1212\",\"path\":\"+12065551212\",\"scheme\":\"tel\"},\"uuid\":\"aa90ce99-3b4d-44ba-b0ca-79e63d9ed842\"},\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 503 Service Unavailable\r\nContent-Length: 37\r\n\r\n{ \"errors\": [\"service unavailable\"] }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "new-registration",
"status_code": 503
}
Expand Down Expand Up @@ -212,6 +214,7 @@
"request": "POST / HTTP/1.1\r\nHost: temba.io\r\nUser-Agent: goflow-testing\r\nContent-Length: 898\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":\"tel:+12065551212\",\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":{\"attachments\":[{\"content_type\":\"image/jpeg\",\"url\":\"http://http://s3.amazon.com/bucket/test.jpg\"},{\"content_type\":\"audio/mp3\",\"url\":\"http://s3.amazon.com/bucket/test.mp3\"}],\"channel\":null,\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"text\":\"Hi everybody\",\"type\":\"msg\",\"urn\":{\"display\":\"(206) 555-1212\",\"path\":\"+12065551212\",\"scheme\":\"tel\"},\"uuid\":\"aa90ce99-3b4d-44ba-b0ca-79e63d9ed842\"},\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 200 OK\r\nContent-Length: 16\r\n\r\n{ \"ok\": \"true\" }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "new-registration",
"status_code": 200
},
Expand All @@ -224,6 +227,7 @@
"request": "POST / HTTP/1.1\r\nHost: unavailable.com\r\nUser-Agent: goflow-testing\r\nContent-Length: 898\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":\"tel:+12065551212\",\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":{\"attachments\":[{\"content_type\":\"image/jpeg\",\"url\":\"http://http://s3.amazon.com/bucket/test.jpg\"},{\"content_type\":\"audio/mp3\",\"url\":\"http://s3.amazon.com/bucket/test.mp3\"}],\"channel\":null,\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"text\":\"Hi everybody\",\"type\":\"msg\",\"urn\":{\"display\":\"(206) 555-1212\",\"path\":\"+12065551212\",\"scheme\":\"tel\"},\"uuid\":\"aa90ce99-3b4d-44ba-b0ca-79e63d9ed842\"},\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 503 Service Unavailable\r\nContent-Length: 37\r\n\r\n{ \"errors\": [\"service unavailable\"] }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "new-registration",
"status_code": 503
},
Expand Down Expand Up @@ -354,6 +358,7 @@
"request": "POST / HTTP/1.1\r\nHost: temba.io\r\nUser-Agent: goflow-testing\r\nContent-Length: 898\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":\"tel:+12065551212\",\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":{\"attachments\":[{\"content_type\":\"image/jpeg\",\"url\":\"http://http://s3.amazon.com/bucket/test.jpg\"},{\"content_type\":\"audio/mp3\",\"url\":\"http://s3.amazon.com/bucket/test.mp3\"}],\"channel\":null,\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"text\":\"Hi everybody\",\"type\":\"msg\",\"urn\":{\"display\":\"(206) 555-1212\",\"path\":\"+12065551212\",\"scheme\":\"tel\"},\"uuid\":\"aa90ce99-3b4d-44ba-b0ca-79e63d9ed842\"},\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 200 OK\r\nContent-Length: 16\r\n\r\n{ \"ok\": \"true\" }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "registration-complete",
"status_code": 200
},
Expand All @@ -366,6 +371,7 @@
"request": "POST / HTTP/1.1\r\nHost: subscribergone.com\r\nUser-Agent: goflow-testing\r\nContent-Length: 898\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":\"tel:+12065551212\",\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":{\"attachments\":[{\"content_type\":\"image/jpeg\",\"url\":\"http://http://s3.amazon.com/bucket/test.jpg\"},{\"content_type\":\"audio/mp3\",\"url\":\"http://s3.amazon.com/bucket/test.mp3\"}],\"channel\":null,\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"text\":\"Hi everybody\",\"type\":\"msg\",\"urn\":{\"display\":\"(206) 555-1212\",\"path\":\"+12065551212\",\"scheme\":\"tel\"},\"uuid\":\"aa90ce99-3b4d-44ba-b0ca-79e63d9ed842\"},\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 410 Gone\r\nContent-Length: 22\r\n\r\n{ \"errors\": [\"gone\"] }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "registration-complete",
"status_code": 410
},
Expand Down Expand Up @@ -566,6 +572,7 @@
"request": "POST / HTTP/1.1\r\nHost: temba.io\r\nUser-Agent: goflow-testing\r\nContent-Length: 504\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":null,\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":null,\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 200 OK\r\nContent-Length: 16\r\n\r\n{ \"ok\": \"true\" }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "new-registration",
"status_code": 200
},
Expand All @@ -578,6 +585,7 @@
"request": "POST / HTTP/1.1\r\nHost: unavailable.com\r\nUser-Agent: goflow-testing\r\nContent-Length: 504\r\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n{\"channel\":null,\"contact\":{\"language\":\"eng\",\"name\":\"Ryan Lewis\",\"urn\":null,\"uuid\":\"5d76d86b-3bb9-4d5a-b822-c9d86f5d8e4f\"},\"flow\":{\"name\":\"Action Tester\",\"revision\":123,\"uuid\":\"bead76f5-dac4-4c9d-996c-c62b326e8c0a\"},\"input\":null,\"path\":[{\"arrived_on\":\"2018-10-18T14:20:30.000123Z\",\"exit_uuid\":\"\",\"node_uuid\":\"72a1f5df-49f9-45df-94c9-d86f7ea064e5\",\"uuid\":\"59d74b86-3e2f-4a93-aece-b05d2fdcde0c\"}],\"results\":{},\"run\":{\"created_on\":\"2018-10-18T14:20:30.000123Z\",\"uuid\":\"e7187099-7d38-4f60-955c-325957214c42\"}}",
"response": "HTTP/1.0 503 Service Unavailable\r\nContent-Length: 37\r\n\r\n{ \"errors\": [\"service unavailable\"] }",
"elapsed_ms": 0,
"retries": 0,
"resthook": "new-registration",
"status_code": 503
},
Expand Down
Loading

0 comments on commit 796b82d

Please sign in to comment.