Junos: Warn when add/setting community with no non-wildcard members#9355
Junos: Warn when add/setting community with no non-wildcard members#9355dhalperi merged 3 commits intobatfish:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9355 +/- ##
==========================================
- Coverage 73.16% 73.16% -0.01%
==========================================
Files 3321 3321
Lines 169206 169222 +16
Branches 20112 20118 +6
==========================================
+ Hits 123808 123810 +2
- Misses 36292 36300 +8
- Partials 9106 9112 +6
🚀 New features to boost your workflow:
|
SLarkworthy
left a comment
There was a problem hiding this comment.
Reviewed 4 of 5 files at r1, all commit messages.
Reviewable status: 4 of 5 files reviewed, all discussions resolved
SirasornT
left a comment
There was a problem hiding this comment.
Reviewed 1 of 5 files at r1, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @SirasornT)
|
Why is this not using the |
|
Previously, dhalperi (Dan Halperin) wrote…
(throughout) |
dhalperi
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @SirasornT)
projects/batfish/src/test/resources/org/batfish/grammar/juniper/testconfigs/juniper-community line 1 at r1 (raw file):
#
Two nits:
-
Consider renaming this file from
juniper-communityto something likecommunity-literals-warningsfor example that indicates what it's testing. -
Consider adding (just for documentation sake) a
deleteline in the legal section. It's okay to delete from a wildcard, right? :)
dhalperi
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @SirasornT)
projects/batfish/src/test/resources/org/batfish/grammar/juniper/testconfigs/juniper-community line 1 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
Two nits:
Consider renaming this file from
juniper-communityto something likecommunity-literals-warningsfor example that indicates what it's testing.Consider adding (just for documentation sake) a
deleteline in the legal section. It's okay to delete from a wildcard, right? :)
(on 1: the juniper- is redundant given path, tho the existing patterns are obviously mixed)
|
This comment says this can also happen for an undefined reference. is that true? If so, it's wrong to warn here unconditionally. |
SirasornT
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @dhalperi and @SLarkworthy)
projects/batfish/src/main/java/org/batfish/representation/juniper/PsThenCommunityAdd.java line 28 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
This comment says this can also happen for an undefined reference. is that true? If so, it's wrong to warn here unconditionally.
Yes this is true. I have added a condition to prevent exclude undefined reference for this warning
projects/batfish/src/main/java/org/batfish/representation/juniper/PsThenCommunityAdd.java line 29 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
(throughout)
Done.
projects/batfish/src/test/resources/org/batfish/grammar/juniper/testconfigs/juniper-community line 1 at r1 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
(on 1: the
juniper-is redundant given path, tho the existing patterns are obviously mixed)
Done.
dhalperi
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 7 files reviewed, 2 unresolved discussions (waiting on @SirasornT and @SLarkworthy)
projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/Configuration.java line 495 at r2 (raw file):
@JsonIgnore public @Nonnull Set<String> getWildcardCommunitySets() { return _wildcardCommunitySets;
We can't put Junos-specific stuff in the VI (vendor-independent) model. Suggest talking to @SLarkworthy or @progwriter about approach here
SirasornT
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 7 files reviewed, 2 unresolved discussions (waiting on @dhalperi and @SLarkworthy)
projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/Configuration.java line 495 at r2 (raw file):
Previously, dhalperi (Dan Halperin) wrote…
We can't put Junos-specific stuff in the VI (vendor-independent) model. Suggest talking to @SLarkworthy or @progwriter about approach here
Will do
SirasornT
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @dhalperi, @progwriter, and @SLarkworthy)
projects/batfish-common-protocol/src/main/java/org/batfish/datamodel/Configuration.java line 495 at r2 (raw file):
Previously, SirasornT (Sirasornt) wrote…
Will do
Done.
dhalperi
left a comment
There was a problem hiding this comment.
Reviewed 2 of 7 files at r2, 5 of 5 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @SirasornT)
warnIllegalNamedCommunitiesUsedForSetnever puts out a warning becausegetOrCreateNamedCommunitiesUsedForSet()never has a community with no literal member (filtered out in PsThenCommunitySet).This PR adds fatal red flag warning when trying to add or set a community with no literal member.