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

Allow brackets inside Tekton expressions #375

Closed
wants to merge 1 commit into from

Conversation

dibyom
Copy link
Member

@dibyom dibyom commented Jan 22, 2020

Changes

We were previously using a regex to extract expressions within
TriggerBindings. The regex only extracted between the initial $(
and the first occurrence of the ). This meant that some valid
JSONPath expressions that contained brackets (e.g. filters) were
incorrectly extracted.

This commit fixes the issue by splitting the string on $( and then
extracting until the last occurrence of ).

Fixes #365

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

TriggerBinding expressions now correctly handle embedded brackets.

@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 22, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign dibyom
You can assign the PR to them by writing /assign @dibyom in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 22, 2020
We were previously using a regex to extract expressions within
TriggerBindings. The regex only extracted between the initial `$(`
and the first occurrence of the `)`. This meant that some valid
JSONPath expressions that contained brackets (e.g. filters) were
incorrectly extracted.

This commit fixes the issue by splitting the string on `$(` and then
extracting until the *last* occurrence of `)`.

Fixes tektoncd#365

Co-Authored-By: Andrea Frittoli <andrea.frittoli@gmail.com>
Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 22, 2020
@dibyom dibyom changed the title Issues/365 Allow brackets inside Tekton expressions Jan 22, 2020
@dibyom dibyom marked this pull request as ready for review January 22, 2020 21:50
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 22, 2020
@dibyom dibyom closed this Jan 22, 2020
@dibyom dibyom deleted the issues/365 branch January 22, 2020 21:52
@dibyom dibyom restored the issues/365 branch January 22, 2020 21:52
@tekton-robot
Copy link

@dibyom: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-tekton-triggers-unit-tests 4552db2 link /test tekton-triggers-unit-tests
pull-tekton-triggers-build-tests 4552db2 link /test pull-tekton-triggers-build-tests

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSONPath filter expression is invalid
3 participants