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

The deprecated attribute missing from many deprecated builtins #5072

Closed
anderseknert opened this issue Aug 31, 2022 · 4 comments · Fixed by #5078
Closed

The deprecated attribute missing from many deprecated builtins #5072

anderseknert opened this issue Aug 31, 2022 · 4 comments · Fixed by #5078

Comments

@anderseknert
Copy link
Member

Currently, only the any and all functions have the deprecated: true attribute set. There are however many more builtins that have been deprecated, and re_match in particular seems to be quite prevalent in policies found in the wild. Properly marking them as deprecated will allow the strict mode checker to fail compilation when encountering these functions, which will help users move away from them.

In addition to adding the attribute to all deprecated functions, make sure to update the docs for strict mode to reflect this.

@srenatus
Copy link
Contributor

When these are properly marked, we can remove this kludge:

case "assign", "cast_array", "cast_boolean", "cast_null", "cast_object", "cast_set", "cast_string",
"eq", "print", "re_match", "set_diff":
// Do nothing.

@srenatus
Copy link
Contributor

Thinking about it, a useful follow-up would be to introduce a new category, "deprecated", and render some docs for those deprecated built-in functions, too. After all, if a user finds a use of re_match somewhere, they have no chance to figure out what it is given our current docs.

@anderseknert
Copy link
Member Author

@srenatus won't that kludge still be needed for assign, eq and print? 🙂

@srenatus
Copy link
Contributor

Yeah. But that's less than before 😄

anderseknert added a commit to anderseknert/opa that referenced this issue Sep 1, 2022
Additionally, propagate deprecated status (if deprecated = true)
to the builtin_metadata.json file.

Fixes open-policy-agent#5072

Signed-off-by: Anders Eknert <[email protected]>
anderseknert added a commit that referenced this issue Sep 1, 2022
Additionally, propagate deprecated status (if deprecated = true)
to the builtin_metadata.json file.

Fixes #5072

Signed-off-by: Anders Eknert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants