Skip to content

Commit

Permalink
fix(api): hoof ref name limit (#4477)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux committed Jul 22, 2019
1 parent ead86cb commit 7437ccc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engine/api/workflow/hook.go
Expand Up @@ -96,7 +96,11 @@ func hookRegistration(ctx context.Context, db gorp.SqlExecutor, store cache.Stor
for i := range wf.WorkflowData.Node.Hooks {
h := &wf.WorkflowData.Node.Hooks[i]
if h.UUID == "" && h.Ref == "" {
h.Ref = fmt.Sprintf("%s.%d", wf.WorkflowData.Node.Name, i)
nodeName := wf.WorkflowData.Node.Name
if len(nodeName) > 45 {
nodeName = nodeName[:45]
}
h.Ref = fmt.Sprintf("%s.%d", nodeName, i)
} else if h.UUID == "" && h.Ref != "" && oldHooksByRef != nil {
// search previous hook configuration by ref
previousHook, has := oldHooksByRef[h.Ref]
Expand Down

0 comments on commit 7437ccc

Please sign in to comment.