forked from aerleon/aerleon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When we process the same name in multiple filters in the same policy,…
… the current code fails as it sets the shortened name in the first filter processing, but sees the same name in subsequent filters as conflicting with the previous declaration. In the first term processing, we define values in self.address_book as deduped and shortened values to the length of _TABLE_NAME_MAX_LENGTH. On further term processing, we repeat the same process, but this time there is a preceding, shortened value set in self.address_book that causes the code to raise DuplicateShortenedTableName. Instead, we will keep a record of short names and their long names equivalent, and we will only fail if there is a conflict in which a short name refers to two different long name objects. We also remove the need to have an extra deduplication logic for self.address_book since self.address_book will never contain duplicate names in a regular run when processing a term, and on further term processing, it will just either add or define to itself, so duplicates should not happen naturally. In addition, add some new test cases to cover edge cases and to prove that this codechange fixes this bug (test case testTableSameLongNameDiffFilter). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=126325475
- Loading branch information
cmas
authored and
Carlos Mas
committed
Jun 30, 2016
1 parent
942e6ea
commit 213626a
Showing
2 changed files
with
182 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters