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

Have diffexpr handle the case of adding to a single child expression #2038

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

josephschorr
Copy link
Member

Note that this still doesn't apply for exclusions, and they have a different expression tree format

Note that this still doesn't apply for exclusions, and they have a different expression tree format
@josephschorr josephschorr requested review from ecordell and a team August 23, 2024 19:49
@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Aug 23, 2024
Co-authored-by: Víctor Roldán Betancort <vroldanbet@users.noreply.github.com>
@josephschorr josephschorr enabled auto-merge August 26, 2024 15:21
// If the expression has changed from a union with a single child, then
// treat this as a special case, since there wasn't really an operation
// before.
if existingType != "union" || len(existingOperation.Child) != 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not returning expanded with intersections and exclusions too?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't create intersections/exclusions with a single child. Only union because we needed some operation to place there during compilation

@josephschorr josephschorr added this pull request to the merge queue Aug 30, 2024
Merged via the queue into authzed:main with commit 78047ed Aug 30, 2024
22 checks passed
@josephschorr josephschorr deleted the diffexpr-add-single-child branch August 30, 2024 08:56
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants