-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ast: Disallowing partial object rules to have other partial object rule within their immediate extent #5864
ast: Disallowing partial object rules to have other partial object rule within their immediate extent #5864
Conversation
…le within their immediate extent The compiler should disallow single-value rules to have other rules within their extent. Previously, the compiler would erroneously allow such overlaps, where the immediate "child" rule of a partial object rule in the rule tree was also a partial object rule. This condition is not expected during evaluation, which will result in a broken object merge. Fixes: open-policy-agent#5855 Signed-off-by: Johan Fylling <[email protected]>
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
singleValueConflicts = append(singleValueConflicts, childRule.Ref()) | ||
} | ||
} | ||
} | ||
if len(c.Children) > 0 { | ||
singleValueConflicts = node.flattenChildren() |
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.
Just from looking at the code, it looks like singleValueConflicts
could be set in line 912, and end up being overwritten here. But I guess the two branches are mutually exclusive?
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 think they are 🤔 .
But you have a good point. I'll make this an append
to be on the safe side. Don't think its worthwhile looking for duplicates, though.
…onflict is found Signed-off-by: Johan Fylling <[email protected]>
2c19c24
to
01210a1
Compare
…le within their immediate extent (open-policy-agent#5864) The compiler should disallow single-value rules to have other rules within their extent. Previously, the compiler would erroneously allow such overlaps, where the immediate "child" rule of a partial object rule in the rule tree was also a partial object rule. This condition is not expected during evaluation, which will result in a broken object merge. Fixes: open-policy-agent#5855 Signed-off-by: Johan Fylling <[email protected]>
The compiler should disallow single-value rules to have other rules within their extent. Previously, the compiler would erroneously allow such overlaps, where the immediate "child" rule of a partial object rule in the rule tree was also a partial object rule. This condition is not expected during evaluation, which will result in a broken object merge.
Fixes: #5855