Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

foreach + subtask breaks the templating engine #66

Closed
1 of 2 tasks
rbeuque74 opened this issue Jan 13, 2020 · 0 comments · Fixed by #67
Closed
1 of 2 tasks

foreach + subtask breaks the templating engine #66

rbeuque74 opened this issue Jan 13, 2020 · 0 comments · Fixed by #67
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@rbeuque74
Copy link
Member

Note: for support questions, erase this form. Otherwise use approriate areas..

  • I'm submitting a ...

    • bug report
    • feature request
  • What is the current behavior?
    https://github.com/ovh/utask/blob/master/pkg/plugins/builtin/subtask/subtask.go#L43
    The subtask plugin uses an internal context object to exchange data between the main controller goroutine and itself.
    In foreach + subtask breaks the templating engine #54, we fixed a problem regarding the usage of hiphens inside the template (for the stepName). Now that we fixed it, a new bug has been introduced as the context is being json.Marshal, then, the double-quotes get escaped, which breaks the templating with error:
    failed to template context: Templating error: template: tmpl:1: unexpected "\\" in operand
    Faulty context example:
    {"task_id":"{{ if (index .step \"subTask-1\" \"output\") }}{{ index .step \"subTask-1\" \"output\" \"id\" }}{{ end }}","requester_username":"{{.task.requester_username}}"}

  • Which version of uTask are you using?
    v1.2.0

  • Internal reference
    CORDEV-138

@rbeuque74 rbeuque74 added bug Something isn't working help wanted Extra attention is needed labels Jan 13, 2020
@rbeuque74 rbeuque74 self-assigned this Jan 14, 2020
rbeuque74 added a commit that referenced this issue Jan 14, 2020
…66)

Fixes #66

Signed-off-by: Romain Beuque <romain.beuque@corp.ovh.com>
rbeuque74 added a commit that referenced this issue Jan 15, 2020
…66) (#67)

Fixes #66

Signed-off-by: Romain Beuque <romain.beuque@corp.ovh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant