-
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
Incomplete data bindings in traces for local variables #1208
Comments
We deal with rewritten vars when query results are returned by the rego package. It seems like we need to apply the same kind of logic to the trace events to give callers a result that makes sense to them. |
tsandall
added a commit
to tsandall/opa
that referenced
this issue
Nov 25, 2019
For the longest time, topdown traces have included rewritten/mangled variable names. This makes it difficult for people to understand the trace because the variable names they used in their policy do not show up in the trace. Now that we have the rewritten variable map readily available during evaluation we can easily provide the user-supplied variable names. Technically this commit just fixes the presentation problem. The inclusion of the variable mapping was done in d1522c6. This change also updates the trace emitting code to include local metadata for all vars that appear in the AST node instead of just vars that have bindings. This allows us to unmangle all variables in the node (e.g., otherwise it would not be possible unmangle Enter nodes.) Fixes open-policy-agent#1208 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall
added a commit
that referenced
this issue
Nov 26, 2019
For the longest time, topdown traces have included rewritten/mangled variable names. This makes it difficult for people to understand the trace because the variable names they used in their policy do not show up in the trace. Now that we have the rewritten variable map readily available during evaluation we can easily provide the user-supplied variable names. Technically this commit just fixes the presentation problem. The inclusion of the variable mapping was done in d1522c6. This change also updates the trace emitting code to include local metadata for all vars that appear in the AST node instead of just vars that have bindings. This allows us to unmangle all variables in the node (e.g., otherwise it would not be possible unmangle Enter nodes.) Fixes #1208 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trace for the
looks like
But for the
it becomes
i.e. instead of
i
we see__local3__
. Although it might reflect how local variables are handled by OPA it doesn't give information to track__local3__
back toi
The text was updated successfully, but these errors were encountered: