-
Notifications
You must be signed in to change notification settings - Fork 420
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
Question : gitlab interceptor / triggerbinding variable interpolation #361
Comments
Same problem! I also tried CEL/Github/WebHook interceptors, the result is even worse:
and the eventlistenersink pod crashed. |
I tried $(body) and it is null. But from gitlab_test.go:
this test confirm payload/body is not null, so I think the problem maybe within sink.go. |
I think this might be related to #357 Does this still happen with the 0.2.1 preview build? https://github.com/tektoncd/triggers/releases/tag/v0.2.1-preview |
/kind bug |
Hello, I just tried with the release v0.2.1 and it works now like a charm. {"level":"info","logger":"eventlistener","caller":"sink/sink.go:147","msg":"params: %+v[{gitrepositoryurl {string git@gitlab.com:danielbfoxg/mycalculator/go/add.git []}} {gitrepositoryname {string add []}} {gitrevision {string refs/heads/master []}}]","knative.dev/controller":"eventlistener","/triggers-eventid":"dlfgs","/trigger":"trigger-gitlab"} Thanks for the great job |
Expected Behavior
Be able to access HTTP JSON body parameters of Gitlab push hook event
Actual Behavior
I try to access the ref parameter from the body of a Gitlab push hook event
But I receive this error message from the event listener pod :
{"level":"error","logger":"eventlistener","caller":"sink/sink.go:144","msg":"failed to ApplyEventValuesToParams: &{%!w(string=failed to replace JSONPath value for param gitrevision: {string $(body.ref) []}: &{%!w(string=ref is not found)})}","knative.dev/controller":"eventlistener","/triggers-eventid":"f7rh6","/trigger":"trigger-gitlab","stacktrace":"github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger\n\t/workspace/go/src/github.com/tektoncd/triggers/pkg/sink/sink.go:144\ngithub.com/tektoncd/triggers/pkg/sink.Sink.HandleEvent.func1\n\t/workspace/go/src/github.com/tektoncd/triggers/pkg/sink/sink.go:93"}
Steps to Reproduce the Problem
Gitlab push hook
Request headers:
Content-Type: application/json
X-Gitlab-Event: Push Hook
X-Gitlab-Token: ...
Request body:
{
"object_kind": "push",
"event_name": "push",
"before": "8d910b6b871c270f63548a84f51c486f67015084",
"after": "b5266fdec6473cb223fd146987c0e238dd5eed86",
"ref": "refs/heads/master",
"checkout_sha": "b5266fdec6473cb223fd146987c0e238dd5eed86",
"message": null,
...
TriggerBinding interceptor
"
apiVersion: tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
name: ci
namespace: staging-mycalculator
spec:
params:
- name: gitrevision
value: $(body.ref)
- name: gitrepositoryurl
value: $(body.repository.git_ssh_url)
- name: gitrepositoryname
value: $(body.repository.name)
apiVersion: tekton.dev/v1alpha1
kind: EventListener
metadata:
name: listener
namespace: staging-mycalculator
spec:
serviceAccountName: staging
triggers:
- name: trigger-gitlab
interceptors:
- gitlab:
eventTypes:
- Push Hook
bindings:
- name: ci
template:
name: ci
"
Additional Info
I installed the latest releases of triggers and pipelines
The text was updated successfully, but these errors were encountered: