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
tester/runner: Fix panic'ing case in utility function. #5497
tester/runner: Fix panic'ing case in utility function. #5497
Conversation
35fd8f2
to
5fb7830
Compare
5fb7830
to
68afa8d
Compare
Thanks for the quick approval, @ashutosh-narkar. I'm rebasing the PR to catch up with |
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'm guessing we're not testing this code path since the old version would panic. It's probably worth adding a rule that triggered the panic here: https://github.com/open-policy-agent/opa/blob/main/tester/runner_test.go#L59.
That should be easy enough to add. One second... |
This commit fixes a panic from a utility function in the `opa test` codepath. After the ref-heads change in open-policy-agent#4660, this particular function could be fed a ref that it didn't know how to work with, such as the innocuous line `a[0] := 1`, and it would then panic. This was fixed by returning a dummy value instead of panic'ing. Fixes: open-policy-agent#5496 Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
a6c37ad
68afa8d
to
a6c37ad
Compare
…gent#5497) This commit fixes a panic from a utility function in the `opa test` codepath. After the ref-heads change in open-policy-agent#4660, this particular function could be fed a ref that it didn't know how to work with, such as from the innocuous line `a[0] := 1`, and it would then panic. This was fixed by returning a dummy value instead of panic'ing. Fixes: open-policy-agent#5496 Signed-off-by: Philip Conrad <philipaconrad@gmail.com> (cherry picked from commit a08934d)
This commit fixes a panic from a utility function in the `opa test` codepath. After the ref-heads change in #4660, this particular function could be fed a ref that it didn't know how to work with, such as from the innocuous line `a[0] := 1`, and it would then panic. This was fixed by returning a dummy value instead of panic'ing. Fixes: #5496 Signed-off-by: Philip Conrad <philipaconrad@gmail.com> (cherry picked from commit a08934d)
This commit fixes a panic from a utility function in the
opa test
codepath. After the ref-heads change in #4660, this particular function could be fed a ref that it didn't know how to work with, such as the innocuous linea[0] := 1
, and it would then panic.This was fixed by returning a dummy value instead of panic'ing.
Fixes: #5496