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

Collect wildcards in statements before splitting #8

Merged
merged 1 commit into from May 20, 2022

Conversation

kstrauser
Copy link
Contributor

In Statement.split, the list of actions wasn't being deduplicated, going through wildcard matching, etc. before being split. The end result was that some of the intermediate statements were by themselves too big to be packed into a single policy. It went something like this:

  1. Calculate the length of the (properly cleaned up) statements.
  2. Use that to figure out how many split up statements to yield.
  3. Now divide the un-cleaned-up statements into that many statements.

Oops! Since the un-cleaned-up list is typically a lot bigger than the canonicalized output, some of those child statements may be a lot larger than expected.

This fixes that and refactors just a little bit. All of the test changes are renames due to adjust for the refactoring, plus running a newer version of Black.

@kstrauser kstrauser merged commit f42c011 into dev May 20, 2022
@kstrauser kstrauser deleted the fix-splitting-bug branch May 20, 2022 20:53
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