-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat(deps): upgrade expr
from 1.16.0 to 1.16.9 to support concat
function. Fixes #13175
#13194
Conversation
expr
from 1.15.5 to 1.16.1 to support concat
function. Fixes #13175expr
from 1.16.0 to 1.16.1 to support concat
function. Fixes #13175
Signed-off-by: Jiacheng Xu <[email protected]>
expr
from 1.16.0 to 1.16.1 to support concat
function. Fixes #13175expr
from 1.16.0 to 1.16.1 to support concat
function. Fixes #13175
expr
from 1.16.0 to 1.16.1 to support concat
function. Fixes #13175expr
from 1.16.0 to 1.16.9 to support concat
function. Fixes #13175
Signed-off-by: Jiacheng Xu <[email protected]>
Looks like some of the tests are failing (unit and E2E) as the error message format is ever so slightly different. It seems like
|
Yes, right. Debugging the test locally and it seems like the line number, e.g., |
Is it OK if we just update the error message to make it match what |
Yes I think that's fine. This actually might be a bug in |
Will take a look. Is there an example what reproduces the error? |
@antonmedv Thanks for taking a look at this. You can use the following program to reproduce the issue: package main
import (
"log"
"github.com/expr-lang/expr"
)
func main() {
input := ""
env := map[string]interface{}{
"key": "value",
}
_, err := expr.Compile(input, expr.Env(env))
if err != nil {
log.Fatal(err)
}
} I also did some experiments and I narrowed the issue down to
For version >=
|
I took a look on why this error is here. Looks like in this case, as input is empty I can just append this string to the error message What do you think? |
@antonmedv thank you for taking a look at this. Yes, I agree with you that in this case the location info doesn't help that much, I think we can just update our test by removing the location from the expected error message. @agilgur5 Please let me know your thought on this, if you agree, I can update tests this PR. |
I would say yes to both actually 😅 I don't think tests, in general, should rely on exact errors, as error specifics can change (and improving an error message, for instance, is usually not considered a breaking change). Especially if the source code does not rely on that specific error message; if it changes a bit, it's often not impactful. So @jiachengxu I think that change makes sense to do either way. But I also think |
Expr provides errors during compilation from a few sources, some comes with a "snippet" My idea was to make this consistent across all errors. If an error contains a snippet |
Also I was refactoring error location information from line and column for offsets start and end. This way it is possible to select the whole token with error. |
i wonder if this helps with #13061 do u happen to use SSO RBAC @jiachengxu ? |
Signed-off-by: Jiacheng Xu <[email protected]>
No, I am not using SSO RBAC feature for my setup |
I have updated the tests to use |
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.
I have updated the tests to use
Contains
instead ofEqual
: bcbfef5
Yea that's what I usually do with these kinds of error message based tests.
LGTM, thanks for the update!
i wonder if this helps with #13061 do u happen to use SSO RBAC @jiachengxu ?
@tooptoop4 we'll want someone to test with :latest
once this is merged and the image is released. The expr
changelog didn't mention anything that I thought would affect it, but 🤷 It might've been something more innocuous like this change or could be a bug in the Argo portion of the templating logic
Fixes #13175
Verification
Before this PR, creating the following workflow in the original issue:
it logs in the main container:
With this PR, it logs: