-
Notifications
You must be signed in to change notification settings - Fork 229
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
Support hierarchical Juniper 'replace:' statement #3688
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3688 +/- ##
============================================
+ Coverage 73.79% 73.8% +<.01%
- Complexity 24822 24838 +16
============================================
Files 2118 2119 +1
Lines 101651 101705 +54
Branches 12006 12013 +7
============================================
+ Hits 75014 75060 +46
- Misses 21279 21280 +1
- Partials 5358 5365 +7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r1.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @arifogel)
projects/batfish/src/main/java/org/batfish/grammar/juniper/JuniperFlattener.java, line 65 at r1 (raw file):
ctx.words.stream().map(ParserRuleContext::getText).collect(Collectors.joining(" ")); if (ctx.REPLACE() != null) { _currentNode.getChildren().remove(nodeKey);
Add comments to this class? At least the new stuff.
it looks like this is saying, "the start of this statement is replace:
, so we need to delete any existing part of the tree that matches here."
projects/batfish/src/main/java/org/batfish/grammar/juniper/JuniperFlattener.java, line 65 at r1 (raw file):
ctx.words.stream().map(ParserRuleContext::getText).collect(Collectors.joining(" ")); if (ctx.REPLACE() != null) { _currentNode.getChildren().remove(nodeKey);
why is it okay to remove children but not recreate the builder containing the set statements?
projects/batfish/src/main/java/org/batfish/grammar/juniper/LineTree.java, line 1 at r1 (raw file):
package org.batfish.grammar.juniper;
missing unit tests for this class
projects/batfish/src/main/java/org/batfish/grammar/juniper/LineTree.java, line 2 at r1 (raw file):
package org.batfish.grammar.juniper;
missing documentation for this class. I can't tell how it's supposed to function supposed to use it. Why are some fields mutable and some fields immutable builders? What are the main use patterns?
projects/batfish/src/test/resources/org/batfish/grammar/juniper/testconfigs/replace_filter, line 18 at r1 (raw file):
} } }
add another filter, which should not be replaced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 10 files reviewed, 3 unresolved discussions (waiting on @dhalperi)
projects/batfish/src/main/java/org/batfish/grammar/juniper/JuniperFlattener.java, line 65 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
why is it okay to remove children but not recreate the builder containing the set statements?
There could be lines at a given subtree, plus children that also have lines.
But we need to delete entire subtree, not just lines at immediate child.
projects/batfish/src/main/java/org/batfish/grammar/juniper/JuniperFlattener.java, line 65 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
Add comments to this class? At least the new stuff.
it looks like this is saying, "the start of this statement is
replace:
, so we need to delete any existing part of the tree that matches here."
See if it is easier to read now.
projects/batfish/src/main/java/org/batfish/grammar/juniper/LineTree.java, line 1 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
missing unit tests for this class
done
projects/batfish/src/main/java/org/batfish/grammar/juniper/LineTree.java, line 2 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
missing documentation for this class. I can't tell how it's supposed to function supposed to use it. Why are some fields mutable and some fields immutable builders? What are the main use patterns?
Still need more?
projects/batfish/src/test/resources/org/batfish/grammar/juniper/testconfigs/replace_filter, line 18 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
add another filter, which should not be replaced.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
No description provided.