Skip to content

wrong response when using () and operators in filters #620

@avinal

Description

@avinal

Expected Behavior

The command or API call using || in filter should respect the OR operator. For example, on running this command

$ ./tkn-results records list default/results/- --insecure --filter="data_type==TASK_RUN && (data.spec.pipelineSpec.tasks[0].name=='hello'||data.metadata.name=='hell')" 

the response should only show TaskRuns that fulfill one or both other conditions.

Actual Behavior

$ ./tkn-results records list default/results/- --insecure --filter="data_type==TASK_RUN && (data.spec.pipelineSpec.tasks[0].name=='hello'||data.metadata.name=='hell')" 
Name                                                                                               Type                                    Start                                   Update
default/results/c030918c-b7ff-4fd9-bafb-56487c481aed/records/c030918c-b7ff-4fd9-bafb-56487c481aed  tekton.dev/v1beta1.PipelineRun          2023-09-22 19:27:06 +0530 IST           2023-09-22 19:27:31 +0530 IST

It seems the CEL converter is not respecting the () boundary.

Steps to Reproduce the Problem

  1. Needs Tekton Results installation with some data in database
  2. Run a command or send an API request involving brackets and operators.
  3. Observe the response

Additional

Reported by @karthikjeeyar

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions