-
Notifications
You must be signed in to change notification settings - Fork 218
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
Create an extension library for working with strings #316
Conversation
@wlynch FYI |
please add a |
@bitsofinfo I'm happy to report |
solid! awesome, so for Tekton to utilize it I assume they as well will have to cut a new release updating the dependency to whatever version this will be in. |
2d0f17d
to
6c5a3f1
Compare
PTAL |
ext/strings.go
Outdated
// Replace | ||
// | ||
// Produces a new string based on the target, which replaces the occurrences of a search string | ||
// with a replacement string if present. Accepts an optional argument specifying a limit on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify that a negative argument means unlimited replacements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL
ext/strings.go
Outdated
// Replace | ||
// | ||
// Produces a new string based on the target, which replaces the occurrences of a search string | ||
// with a replacement string if present. Accepts an optional argument specifying a limit on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
PTAL |
Would it be possible to get a doc page with the list of functions / examples? |
Do you mean for the string extensions or for all functions?
Here's the godoc for the string extensions:
https://godoc.org/github.com/google/cel-go/ext#Strings
…On Mon, Mar 9, 2020, 11:24 PM Kevin McDermott ***@***.***> wrote:
Would it be possible to get a doc page with the list of functions /
examples?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#316?email_source=notifications&email_token=AADV7ZBIJKX6KCIWS7N366LRGXMKJA5CNFSM4LAEJBTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOKFQ4Q#issuecomment-596924530>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADV7ZHRISWFJIXLOL7JF6LRGXMKJANCNFSM4LAEJBTA>
.
|
@TristonianJones I was hoping for something I could link to from tektoncd/triggers to help people who want to use the functions, they're not necessarily Go developers. |
The functions look great, and I'm happy to open a PR with a markdown with a list of functions examples in cel-go rather than in tektoncd/triggers which might help more folks. |
@bigkevmcd Sure, are you just looking for a markdown file for the strings, or would you like all the CEL functions documented that way. In the fullness of time, I'm sure both are desired, but if you need one sooner than the other, that helps me prioritize. |
@TristonianJones Right now, the new string functions would help a lot, as soon as there's a release of cel-go with them, I have a PR ready to go. |
@bigkevmcd I'll work with @JimLarson to fix a minor issue I found in the library and copy in a markdown file. To use the new functions you'll have to use I let @wlynch and @bobcatfish know offline that I think the |
@TristonianJones and @bigkevmcd thanks for brining this together, will be super handy in tekton |
This code is based on FR #306 which requested support for built-in substrings. While substrings are not part of the core CEL spec, such functions are a common ask and the following is an implementation of such functions as extensions which can be layered onto the core CEL spec.
Closes #306