-
Notifications
You must be signed in to change notification settings - Fork 1.5k
docs: Revise docs index page wording #7805
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
docs: Revise docs index page wording #7805
Conversation
charlieegan3
commented
Jul 30, 2025
- added link to playground
- removed some examples I felt were redundant
- made the constants example relevant to the example domain
- minor wording changes and fixes
| 1. Servers reachable from the Internet must not expose the insecure 'http' protocol. | ||
| 2. Servers are not allowed to expose the 'telnet' protocol. | ||
| ``` | ||
| > 1. Servers reachable from the Internet must not expose the insecure 'http' protocol. |
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.
blockquotes have no hscroll
| All the servers, networks, and ports are provisioned by a script. The script | ||
| receives a JSON representation of the system as input: | ||
| All the servers, networks, and ports are provisioned using infrastructure as | ||
| code. The infrastructure configuration is specified in this JSON representation: |
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.
it's 2025, people don't use scripts any more right? 😉
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.
Haha
| This section covers the building blocks of writing policies in Rego. You can see | ||
| how these concepts come together to solve our network security policy in the | ||
| [Complete Example](#complete-example). | ||
| ::: |
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 felt this was needed since the section here is not 100% on the task of building the final example.
docs/docs/index.md
Outdated
|
|
||
| You can omit the `;` (AND) operator by splitting expressions across multiple | ||
| lines. The following query has the same meaning as the previous one: | ||
| Multiple expressions can be combined using logical AND. For queries to produce |
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 felt this section was too much detail, so I have condensed it.
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.
Will people understand that we're referring to ; as the AND operator here? This is a place where Rego diverges from most other languages people are used to.
Maybe its more clear if we just drop the Multiple expressions can be combined using logical AND part(?).
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| output if { | ||
| input.servers[0].id == "app" | ||
| // highlight-next-line |
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.
this is what needed the style changes, they looked dark to me on lightmode.
|
|
||
| <RunSnippet files="#input.json" command="data.servers.output"/> | ||
|
|
||
| Variables are immutable. OPA reports an error if you try to assign the same |
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 mention they're immutable above now, and felt this was too much detail for the homepage.
| ``` | ||
|
|
||
| <RunSnippet files="#input.json" command="data.servers.output"/> | ||
| `[{"id": "net1", "public": false}, {"id": "net2", "public": false}, ...]` |
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 just included what the data looks like rather than an example that is there with a button just to click to see it.
|
|
||
| <RunSnippet files="#input.json" command="data.servers.http_server"/> | ||
|
|
||
| Providing good names for variables can be hard. If you only refer to the |
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'd prefer the some in style here so have removed, mostly to save reading time.
0f0c247 to
de1c6e1
Compare
| the example above `exists_public_network := true` is the head and `some net in input.networks; net.public` is the body. | ||
|
|
||
| You can query for the value generated by rules just like any other value: | ||
| You can query for the value generated by rules just like any other value (such as `input` or your own variables): |
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 didn't want to repeat too much code in the prose.
| package servers | ||
| pi := 3.14 | ||
| max_allowed_protocols := 5 |
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.
this seemed more relevant than pi. even if pi is the best constant ever.
| Congratulations on making it through the introduction to OPA. If you made it | ||
| this far you have learned the core concepts behind OPA's policy language as well | ||
| as how to get OPA and run it on your own. | ||
| Congratulations on completing the introduction to OPA. You have learned the core |
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.
'making it though' 😆
that is how I felt by this point...
johanfylling
left a comment
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.
LGTM 👍
docs/docs/index.md
Outdated
|
|
||
| You can omit the `;` (AND) operator by splitting expressions across multiple | ||
| lines. The following query has the same meaning as the previous one: | ||
| Multiple expressions can be combined using logical AND. For queries to produce |
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.
Will people understand that we're referring to ; as the AND operator here? This is a place where Rego diverges from most other languages people are used to.
Maybe its more clear if we just drop the Multiple expressions can be combined using logical AND part(?).
srenatus
left a comment
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.
Thank you! It's about time that this page gets some attention and careful edits. 🙌 Nicely done.
docs/docs/index.md
Outdated
| In the example above `public_network contains net.id if` is the rule head and | ||
| `some net in input.networks; net.public` is the rule body. You can query for the entire | ||
| set of values just like any other value. Using the `in` keyword we can use this | ||
| <RunSnippet id="public_network_set.rego" files="#input.json" command="data.example"/> Using the `in` keyword we can use this |
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.
| <RunSnippet id="public_network_set.rego" files="#input.json" command="data.example"/> Using the `in` keyword we can use this | |
| <RunSnippet id="public_network_set.rego" files="#input.json" command="data.example"/> | |
| Using the `in` keyword we can use this |
- added link to playground - removed some examples I felt were redundant - made the constants example relevant to the example domain - minor wording changes and fixes Signed-off-by: Charlie Egan <[email protected]>
Signed-off-by: Charlie Egan <[email protected]>
0b44a66 to
23ecc4d
Compare
|
Thanks both for the review, have patched that up now. |