pipelines-as-code icon indicating copy to clipboard operation
pipelines-as-code copied to clipboard

CEL Expression doesn't seem to work with Bitbucket server

Open Mikkelmedetk opened this issue 2 months ago • 3 comments

Hi,

I've been experimenting a bit with Pipelines as Code together with bitbucket-server.

But it doesn't seem to work with CEL-Expression annotation: ... annotations: pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "master" ...

This is what i observe on the pipeline-as-a-code controller logs {"level":"info","ts":"2024-05-03T08:13:15.037Z","logger":"pipelinesascode","caller":"bitbucketserver/bitbucketserver.go:174","msg":"Using PipelineRun definition from source pull request SHA: e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","provider":"bitbucket-server","event-id":"cc7d5e22-ef40-4575-bd18-d9eb4a10cd70","event-sha":"e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","event-type":"","namespace":"REDACTED"} {"level":"info","ts":"2024-05-03T08:13:15.607Z","logger":"pipelinesascode","caller":"matcher/annotation_matcher.go:133","msg":"matching pipelineruns to event: URL=https://REDACTED/projects/REDACTED/repos/REDACTED.REDACTED, target-branch=refs/heads/master, source-branch=refs/heads/master, target-event=push","provider":"bitbucket-server","event-id":"cc7d5e22-ef40-4575-bd18-d9eb4a10cd70","event-sha":"e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","event-type":"","namespace":"REDACTED"} {"level":"error","ts":"2024-05-03T08:13:15.607Z","logger":"pipelinesascode","caller":"matcher/annotation_matcher.go:172","msg":"there was an error evaluating the CEL expression, skipping: json: cannot unmarshal string into Go value of type map[string]interface {}","provider":"bitbucket-server","event-id":"cc7d5e22-ef40-4575-bd18-d9eb4a10cd70","event-sha":"e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","event-type":"","namespace":"REDACTED","stacktrace":"github.com/openshift-pipelines/pipelines-as-code/pkg/matcher.MatchPipelinerunByAnnotation\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/matcher/annotation_matcher.go:172\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).getPipelineRunsFromRepo\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode/match.go:195\ngithub.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode.(*PacRun).matchRepoPR\n\t/go/src/github.com/openshift-pipelines/pipelines-as-code/pkg/pipelineascode/matc... {"level":"warn","ts":"2024-05-03T08:13:15.607Z","logger":"pipelinesascode","caller":"matcher/annotation_matcher.go:200","msg":"cannot match pipeline from payload to a pipelinerun in .tekton/ dir","provider":"bitbucket-server","event-id":"cc7d5e22-ef40-4575-bd18-d9eb4a10cd70","event-sha":"e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","event-type":"","namespace":"REDACTED"} {"level":"warn","ts":"2024-05-03T08:13:15.607Z","logger":"pipelinesascode","caller":"matcher/annotation_matcher.go:201","msg":"payload target event is with source branch refs/heads/master and target branch master","provider":"bitbucket-server","event-id":"cc7d5e22-ef40-4575-bd18-d9eb4a10cd70","event-sha":"e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","event-type":"","namespace":"REDACTED"} {"level":"warn","ts":"2024-05-03T08:13:15.607Z","logger":"pipelinesascode","caller":"matcher/annotation_matcher.go:202","msg":"available configuration of the PipelineRuns annotations in .tekton/ dir","provider":"bitbucket-server","event-id":"cc7d5e22-ef40-4575-bd18-d9eb4a10cd70","event-sha":"e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","event-type":"","namespace":"REDACTED"} {"level":"warn","ts":"2024-05-03T08:13:15.607Z","logger":"pipelinesascode","caller":"events/emit.go:50","msg":"cannot match pipeline from payload to a pipelinerun in .tekton/ dir, event=, branch=master","provider":"bitbucket-server","event-id":"cc7d5e22-ef40-4575-bd18-d9eb4a10cd70","event-sha":"e516130c8cf654f321c0b0ac7b4011c9ad4b3bd9","event-type":"","namespace":"REDACTED"}

Mikkelmedetk avatar May 03 '24 08:05 Mikkelmedetk