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

Fix repeated predefined rule on repeated field #150

Merged

Conversation

jchadwick-buf
Copy link
Member

@jchadwick-buf jchadwick-buf commented Oct 1, 2024

Copy link

github-actions bot commented Oct 1, 2024

The latest Buf updates on your PR. Results from workflow Buf / validate-protos (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedOct 4, 2024, 8:30 PM

celext.ProtoFieldToCELType(desc, true, forItems),
celext.ProtoFieldToCELValue(desc, rule, forItems),
celext.ProtoFieldToCELType(desc, true, false),
celext.ProtoFieldToCELValue(desc, rule, false),
Copy link
Member Author

Choose a reason for hiding this comment

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

Explanation for this just to make it extra clear: We don't want to propagate the forItems value here because it reflects if we're operating on a repeated element of the this field, not of the rule field. Instead, the only time forItems should be true for these specific calls should be when they recurse to get the inner element type/value. Otherwise, a repeated field with a predefined constraint applied will attempt to get the element type of the rule field itself, which does not make any sense.

@jchadwick-buf jchadwick-buf merged commit 0861600 into main Oct 4, 2024
9 checks passed
@jchadwick-buf jchadwick-buf deleted the jchadwick/fix-repeated-predefined-rule-on-repeated branch October 4, 2024 20:33
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.

3 participants