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

Data Source functions should be declared as nondeterministic. #5158

Open
blkt opened this issue Dec 6, 2024 · 0 comments
Open

Data Source functions should be declared as nondeterministic. #5158

blkt opened this issue Dec 6, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@blkt
Copy link
Contributor

blkt commented Dec 6, 2024

REGO functions can be declared as Nondeterministic which allows REGO runtime to behave correctly in some cases.
Here's an excerpt of the documentation (golang specific here).

Since this built-in could have non-deterministic results, depending on network conditions, the declaration also sets rego.Function#Nondeterministic to true. This provides basic safety information to the runtime, so that the function isn’t accidentally run during bundle builds or partial evaluation. If your builtin can have non-deterministic results, you should mark it appropriately to avoid surprises.

Given we don't really know the nature of the functions being defined by the users, it could be a good idea to mark them as Nondeterministic here.

@blkt blkt added good first issue Good for newcomers enhancement New feature or request labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant