Skip to content

Commit

Permalink
Update to latest goflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed May 24, 2019
1 parent 165c285 commit c6ad09b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/mattn/go-sqlite3 v1.10.0 // indirect
github.com/nyaruka/ezconf v0.2.1
github.com/nyaruka/gocommon v1.0.0
github.com/nyaruka/goflow v0.39.4
github.com/nyaruka/goflow v0.40.1
github.com/nyaruka/librato v0.0.0-20180827155909-cacc769357b8
github.com/nyaruka/logrus_sentry v0.8.2-0.20190129182604-c2962b80ba7d
github.com/nyaruka/null v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ github.com/nyaruka/gocommon v0.2.0 h1:1Le4Ok0Zp2RYULue0n4/02zL+1MrykN/C79HhirGeR
github.com/nyaruka/gocommon v0.2.0/go.mod h1:ZrhaOKNc+kK1qWNuCuZivskT+ygLyIwu4KZVgcaC1mw=
github.com/nyaruka/gocommon v1.0.0 h1:4gdAMOR4BTMHHZjOy5WhfKYGUZVmJ+3LPh1sj011Qzk=
github.com/nyaruka/gocommon v1.0.0/go.mod h1:QbdU2J9WBsqBmeZRuwndf2f6O7rD7mkC0bGn5UNnwjI=
github.com/nyaruka/goflow v0.39.4 h1:1KizVSGGc8INx8n8JJr7RO0VSNFWAg1I6HgokBdN1iA=
github.com/nyaruka/goflow v0.39.4/go.mod h1:QitrAujTi7Mc75aVIoCpAmFsfO794+ljo9QNGt7qSHY=
github.com/nyaruka/goflow v0.40.1 h1:+8rvAmL5tZAbJ8o3WLCL9zEdyD8lKhcunnQpxABma00=
github.com/nyaruka/goflow v0.40.1/go.mod h1:QitrAujTi7Mc75aVIoCpAmFsfO794+ljo9QNGt7qSHY=
github.com/nyaruka/librato v0.0.0-20180827155909-cacc769357b8 h1:TOvxy0u6LNTWP3gwbdNVCiByXJupr9ATFdzBnBJ2TY8=
github.com/nyaruka/librato v0.0.0-20180827155909-cacc769357b8/go.mod h1:huVocfMEHkttMHD4hSr/wjWNyTx/YMzwwajVzV2bq+0=
github.com/nyaruka/logrus_sentry v0.8.2-0.20190129182604-c2962b80ba7d h1:hyp9u36KIwbTCo2JAJ+TuJcJBc+UZzEig7RI/S5Dvkc=
Expand Down
2 changes: 1 addition & 1 deletion runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ func validateFlow(sa flows.SessionAssets, uuid assets.FlowUUID) error {

// check for missing assets and log
missingDeps := make([]string, 0)
err = flow.InspectRecursively(sa, func(r assets.Reference) {
err = flow.ValidateRecursive(sa, func(r assets.Reference) {
missingDeps = append(missingDeps, r.String())
})

Expand Down
13 changes: 9 additions & 4 deletions web/flow/flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,19 @@ func handleValidate(ctx context.Context, s *web.Server, r *http.Request) (interf
if err != nil {
return nil, http.StatusInternalServerError, errors.Wrapf(err, "unable get session assets")
}

if err := flow.Validate(sa, nil); err != nil {
return nil, http.StatusUnprocessableEntity, err
}
}

// inspect the flow to get dependecies, results etc
if err := flow.Inspect(sa); err != nil {
return nil, http.StatusUnprocessableEntity, err
// this endpoint returns inspection results inside the definition
result, err := flow.MarshalWithInfo()
if err != nil {
return nil, http.StatusInternalServerError, errors.Wrapf(err, "unable to marshal flow")
}

return flow, http.StatusOK, nil
return json.RawMessage(result), http.StatusOK, nil
}

// Clones a flow.
Expand Down

0 comments on commit c6ad09b

Please sign in to comment.