Skip to content

Commit 4cf55cb

Browse files
authored
Merge pull request #544 from nyaruka/latest_goflow
Update to latest goflow that changes webhook services
2 parents 8f56399 + 0f0519a commit 4cf55cb

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

core/crons/end_incidents_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func TestEndIncidents(t *testing.T) {
3535
for i := range evts {
3636
req, _ := http.NewRequest("GET", "http://example.com", nil)
3737
trace := &httpx.Trace{Request: req, StartTime: dates.Now(), EndTime: dates.Now().Add(elapsed)}
38-
evts[i] = events.NewWebhookCalled(&flows.WebhookCall{Trace: trace}, flows.CallStatusSuccess, "")
38+
evts[i] = events.NewWebhookCalled(trace, flows.CallStatusSuccess, "")
3939
}
4040
return evts
4141
}

core/handlers/webhook_called_test.go

+8-10
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,14 @@ type failingWebhookService struct {
102102
delay time.Duration
103103
}
104104

105-
func (s *failingWebhookService) Call(request *http.Request) (*flows.WebhookCall, error) {
106-
return &flows.WebhookCall{
107-
Trace: &httpx.Trace{
108-
Request: request,
109-
RequestTrace: []byte(`GET http://rapidpro.io/`),
110-
Response: nil,
111-
ResponseTrace: nil,
112-
StartTime: dates.Now(),
113-
EndTime: dates.Now().Add(s.delay),
114-
},
105+
func (s *failingWebhookService) Call(request *http.Request) (*httpx.Trace, error) {
106+
return &httpx.Trace{
107+
Request: request,
108+
RequestTrace: []byte(`GET http://rapidpro.io/`),
109+
Response: nil,
110+
ResponseTrace: nil,
111+
StartTime: dates.Now(),
112+
EndTime: dates.Now().Add(s.delay),
115113
}, nil
116114
}
117115

core/models/incident_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestWebhookNode(t *testing.T) {
112112
for i := range evts {
113113
req, _ := http.NewRequest("GET", "http://example.com", nil)
114114
trace := &httpx.Trace{Request: req, StartTime: dates.Now(), EndTime: dates.Now().Add(elapsed)}
115-
evts[i] = events.NewWebhookCalled(&flows.WebhookCall{Trace: trace}, flows.CallStatusSuccess, "")
115+
evts[i] = events.NewWebhookCalled(trace, flows.CallStatusSuccess, "")
116116
}
117117
return evts
118118
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/lib/pq v1.10.9
2727
github.com/nyaruka/ezconf v0.3.0
2828
github.com/nyaruka/gocommon v1.61.1
29-
github.com/nyaruka/goflow v0.235.4
29+
github.com/nyaruka/goflow v0.236.0
3030
github.com/nyaruka/null/v3 v3.0.0
3131
github.com/nyaruka/redisx v0.9.0
3232
github.com/nyaruka/rp-indexer/v10 v10.1.1

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ github.com/nyaruka/ezconf v0.3.0 h1:kGvJqVN8AHowb4HdaHAviJ0Z3yI5Pyekp1WqibFEaGk=
210210
github.com/nyaruka/ezconf v0.3.0/go.mod h1:89GUW6EPRNLIxT7lC4LWnjWTgZeQwRoX7lBmc8ralAU=
211211
github.com/nyaruka/gocommon v1.61.1 h1:qulMx0jHDWoDagCJbVs7CMLZA33jfa5kYutlXR66pHM=
212212
github.com/nyaruka/gocommon v1.61.1/go.mod h1:HcwpCzwt8XK7SxmGHYRF1R9viOAvlU7VtXTGuEmJx/8=
213-
github.com/nyaruka/goflow v0.235.4 h1:9LDmUQc47rn3p91At2JbnGbJs6FOngGVMG3o4eT8Qoo=
214-
github.com/nyaruka/goflow v0.235.4/go.mod h1:m0bwl9WfJhBQHeabOGnWoyy6n5GXaoU27iE7X3hDkeg=
213+
github.com/nyaruka/goflow v0.236.0 h1:5B4+sGH5PncG7vc+mxNh2wSu8fklwdJI4i34dqiU+CY=
214+
github.com/nyaruka/goflow v0.236.0/go.mod h1:m0bwl9WfJhBQHeabOGnWoyy6n5GXaoU27iE7X3hDkeg=
215215
github.com/nyaruka/null/v2 v2.0.3 h1:rdmMRQyVzrOF3Jff/gpU/7BDR9mQX0lcLl4yImsA3kw=
216216
github.com/nyaruka/null/v2 v2.0.3/go.mod h1:OCVeCkCXwrg5/qE6RU0c1oUVZBy+ZDrT+xYg1XSaIWA=
217217
github.com/nyaruka/null/v3 v3.0.0 h1:JvOiNuKmRBFHxzZFt4sWii+ewmMkCQ1vO7X0clTNn6E=

0 commit comments

Comments
 (0)