Skip to content
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

document for all and any aggregate builtins #4097

Closed
wants to merge 1 commit into from

Conversation

tmccombs
Copy link

@tmccombs tmccombs commented Dec 5, 2021

These functions exist but aren't currently mentioned in the documentation. It looks like these lines were at one point in the policy-reference, but were lost in commit bb0d4e2.

I also wonder if it would be worth mentioning using all in the section on Universal Quantification, something like:

no_bitcoin_miners_using_all :=  all([(app.name != "bitcoin-miner") | app := apps[_]])

These functions exist but aren't currently mentioned in the documentation.  It looks like these lines were at one point in the policy-reference, but were lost in commit bb0d4e2.

I also wonder if it would be worth mentioning using `all` in the section on [Universal Quantification](https://www.openpolicyagent.org/docs/v0.27.1/policy-language/#universal-quantification-for-all), something like:

```opa
no_bitcoin_miners_using_all :=  all([(app.name != "bitcoin-miner") | app := apps[_]])
```

Signed-off-by: Thayne McCombs <[email protected]>
@anderseknert
Copy link
Member

They have been removed from the docs since they are both considered deprecated.

any can easily be replaced by just checking for set membership, or using the new in operator.
all can be replaced in a couple of ways, like converting to collection to set and check for {true}, and once the every keyword lands in OPA, we'll have an even more powerful way of checking for all conditions.

@tmccombs
Copy link
Author

tmccombs commented Dec 5, 2021

I see. Why not include them, but say they are deprecated?

@anderseknert
Copy link
Member

@tmccombs yeah I suppose that would be an option, though there's probably a higher chance of people still using them if we did. They are still included if you browse older versions of the docs though.

The PR that had them removed is here btw.

@tmccombs tmccombs closed this Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants