docs/website: Improve partial evaluation / data filtering documentation#8625
docs/website: Improve partial evaluation / data filtering documentation#8625mmzzuu wants to merge 4 commits into
Conversation
* added a simple data filtering example to the filtering overview page to better showcase its purpose * explained the metadata annotation for unknowns and how it links to the database table and field names * added a tutorial page to provide a quick demo Fixes: open-policy-agent#8316 Signed-off-by: Manuela Züger <manuela.zueger@ipt.ch>
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
references: open-policy-agent#8316 Signed-off-by: Manuela Züger <manuela.zueger@ipt.ch>
|
Hmm looks like the netlify preview is broken here? 😞 Thanks for contributing, I'll have a look in a bit! 🎉 |
| ```rego title="policy.rego" | ||
| package filters | ||
|
|
||
| # METADATA |
There was a problem hiding this comment.
This metadata comment is in a bit of a strange place? Did you mean to use the package scope?
There was a problem hiding this comment.
Thank you for your review @charlieegan3 ! And sorry for my late response!
I changed the metadata comments to use package scope consistently, I agree that this is more suitable / intuitive.
| ::: | ||
|
|
||
| ## What is Partial Evaluation? | ||
| ## What is Partial Evaluation? {#what-is-partial-evaluation} |
There was a problem hiding this comment.
Unsure if this was needed? the generated fragment looks to be the same?
There was a problem hiding this comment.
good catch! During the process I had a link to this section at some point, which I removed again and forgot to also remove this anchor. I removed it now.
|
|
||
| The rule is: Directors may see the salaries of employees in their own department. When Alice (Engineering Director) lists employees, the highlighted rows are what she should see: | ||
|
|
||
| <table> |
There was a problem hiding this comment.
We can use markdown tables too, might be easier to read for future editors.
There was a problem hiding this comment.
Changed it to markdown tables.
| } | ||
| ``` | ||
|
|
||
| ¹ The value of `input.employees.department` is _unknown_ during partial policy evaluation — it refers to a table column in the database. |
There was a problem hiding this comment.
We don't tend to use this format for notes. I think a bullet list is fine, but we can also use [^1], [^2] etc.
There was a problem hiding this comment.
changed to using bullet points.
* remove unnecessary anchor * changed the scope of the example policies to `package` * remove the footnote and use bullet points instead * additionally: renaming the package to `filter` in the tutorial for consistency Signed-off-by: Manuela Züger <manuela.zueger@ipt.ch>
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Manuela Züger <manuela.zueger@ipt.ch>
|
Thanks for your review @charlieegan3 :) I addressed your comments. Let me know if I can change anything else. |
Why the changes in this PR are needed?
The issue #8316 outlines that the Partial Evaluation / Data Filtering documentation could benefit from clearer examples and explanations to better enable users to get started adopting the feature.
What are the changes in this PR?