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

Policy nested rule fix #1092

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

TristonianJones
Copy link
Collaborator

More robust handling for optional / non-optional policy outputs.

Closes #1087

Better support for fall-through on optional.none() cases from parent rules
as the notion of a `none` value should signify that no branch condition is
satisfied, and thus other branches should be able to assess the rule.

In some cases the `orValue` usage is a little unusual, in that it can
wrap a ternary containing an optional return value, but such cases only
occur when the rule always returns an output and they behave correctly.
@TristonianJones TristonianJones marked this pull request as ready for review December 9, 2024 20:31
seirl
seirl previously approved these changes Dec 10, 2024
Copy link
Collaborator

@seirl seirl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the quick fix!

policy/composer.go Outdated Show resolved Hide resolved
policy/composer.go Outdated Show resolved Hide resolved
policy/composer.go Outdated Show resolved Hide resolved
policy/composer.go Outdated Show resolved Hide resolved
policy/testdata/nested_rule5/policy.yaml Show resolved Hide resolved
l46kok
l46kok previously approved these changes Dec 11, 2024
@TristonianJones TristonianJones merged commit 8b07a00 into google:master Dec 12, 2024
2 checks passed
@TristonianJones TristonianJones deleted the policy-nested-rule-fix branch December 12, 2024 16:13
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.

Policy Compiler composition fails for doubly-nested non-optional match rules.
3 participants