-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Aborting query-eval if the compiler has errors #5949
Aborting query-eval if the compiler has errors #5949
Conversation
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
ec996ca
to
2d0426c
Compare
if q.compiler != nil && len(q.compiler.Errors) > 0 { | ||
return &Error{ | ||
Code: InternalErr, | ||
Message: "compiler has errors", |
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.
Could we aggregate them or something? This error message alone doesn't help much figuring out what's wrong, I think.
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 actually a bit uncertain as to what's the best option here. This error will be returned on the /v1/data
endpoint, and it might be a security risk to forward compilation errors to the querying client .. (or I'm just way to cautious 😅).
The compiler errors are reported for each bundle on the /v1/status
endpoint.
.. but now that I'm thinking about it, that doesn't help you much when you're not running OPA in server mode 🤔.
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.
We can always expose more debug info in the future if we think it's necessary and/or would assist with issue triage.
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.
And since these errors will be exposed via the Status API we still have some insight here.
Fixes: open-policy-agent#5947 Signed-off-by: Johan Fylling <[email protected]>
8a991b6
to
28f75b5
Compare
Fixes: #5947