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

planner: if dynamic call fails, or dereferencing data fails, break to undefined #4275

Merged

Conversation

srenatus
Copy link
Contributor

@srenatus srenatus commented Jan 25, 2022

Due to excessive nesting of blocks, the break statement wasn't breaking
out of enough of them: this would this add an element to the result set
when it should have turned into undefined.

This was the case in two conditions:

a. the dynamic lookup not finding a data function to call, and the resulting
static data lookup failing to resolve the ref; or
b. the dynamically called function returns undefined

@srenatus srenatus changed the title planner: if dynamic call fails, and dereferencing data failes, break … planner: if dynamic call fails, and dereferencing data fails, break to undefined Jan 25, 2022
@srenatus srenatus marked this pull request as ready for review January 25, 2022 10:21
@srenatus srenatus changed the title planner: if dynamic call fails, and dereferencing data fails, break to undefined planner: if dynamic call fails, or dereferencing data fails, break to undefined Jan 31, 2022
@srenatus srenatus force-pushed the sr/planner/fix-break-index branch 2 times, most recently from 4c7f326 to 97f4bf4 Compare January 31, 2022 10:19
…fined

Due to excessive nesting of blocks, the break statement wasn't breaking
out of enough of them: this would this add an element to the result set
when it should have turned into undefined.

This was the case in two conditions:

a. the dynamic lookup not finding a data function to call, and the resulting
   static data lookup failing to resolve the ref; or
b. the dynamically called function returns undefined

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Copy link
Member

@tsandall tsandall left a comment

Choose a reason for hiding this comment

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

LGTM

@srenatus srenatus merged commit 2674545 into open-policy-agent:main Feb 1, 2022
@srenatus srenatus deleted the sr/planner/fix-break-index branch February 1, 2022 16:48
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.

None yet

2 participants