Skip to content

Fix XR7 parse error where ARP EVPN line exists #2092

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

garymccann
Copy link
Contributor

Fixes an IOS-XR version 7 issue, where a line is now included for ARP EVPN

@mjbear
Copy link
Collaborator

mjbear commented Apr 1, 2025

Hi @garymccann
I made a couple of adjustments.

  • Regenerated structured data so the keys are in alphabetical order
  • Replaced literal spaces with regexes
  • Replaced a few singular whitespace regexes with a more flexible whitespace regex (one or more)

Thank you!

@garymccann
Copy link
Contributor Author

hey @mjbear - can you please break these adjustments into their own PR - i do not like touching files unrelated to the feature, increasing the blast radius and while i don't see anything wrong with changing the order, it may confuse folk who are using the raw data, since it does not follow any alphabetical ordering. I will revert these PR changes.

@mjbear
Copy link
Collaborator

mjbear commented Apr 2, 2025

hey @mjbear - can you please break these adjustments into their own PR - i do not like touching files unrelated to the feature, increasing the blast radius and while i don't see anything wrong with changing the order, it may confuse folk who are using the raw data, since it does not follow any alphabetical ordering. I will revert these PR changes.

@garymccann
Sure thing.
I'll start canceling them if you haven't already. You got 'em. 🙂

There might be one or two items left for us to include on this PR, but we'll see as I take a gander now.

@garymccann garymccann force-pushed the u/garymccann-fix-xr7 branch from 57a329c to fb33403 Compare April 4, 2025 16:07
@garymccann garymccann requested a review from mjbear April 4, 2025 16:21
@mjbear mjbear changed the title Fixing XR7 related parse error where ARP EVPN line exists Fix XR7 parse error where ARP EVPN line exists Apr 4, 2025
Comment on lines +38 to 41
^\s+ARP EVPN.*$$
^\s+ICMP redirects.*$$
^\s+ICMP unreachables.*$$
^\s+ICMP mask.*$$
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we please replace literal whitespaces with regex?

(We can leave the other regexes alone on this PR and I can follow up with another PR for other things as mentioned in earlier discussion.)

Suggested change
^\s+ARP EVPN.*$$
^\s+ICMP redirects.*$$
^\s+ICMP unreachables.*$$
^\s+ICMP mask.*$$
^\s+ARP\s+EVPN.*$$
^\s+ICMP\s+redirects.*$$
^\s+ICMP\s+unreachables.*$$
^\s+ICMP\s+mask.*$$

Copy link
Contributor Author

@garymccann garymccann Apr 5, 2025

Choose a reason for hiding this comment

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

These lines are not equivalent. \s+ matches one or more whitespace characters, where the literal whitespace is just one.
I checked performance of literal, \s and \s+ - all 3 take 14 processing steps (regex101.com) so there is no processing gain to be had from any change in implementation.

My personal preference is to keep the literal whitespace, since it reads most similar to the CLI output, however, given there is no performance penalties, i am agnostic.

Please let me know your thoughts, main thing here is to get this merged into a pypy release for my use in production uses.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm looking at this through a future-proofing lens -- balancing the flexibility of the template and its regexes to hopefully reduce the maintenance burden in the long term.

I certainly hope that Cisco doesn't add extra accidental whitespace, but we've seen other vendors make somewhat haphazard changes (ex: spacing, capitalization, spelling).

Note

Since I already have it on my mind to tackle putting the structured data alphabetic ordering in a different PR, this literal whitespace could be something that happens there.

My gut feeling is for me to hold off with the whitespace regex, etc until a later PR (as in not for this PR).
I welcome feedback from the other maintainers if they have thoughts on it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@itdependsnetworks @jmcgill298 @jvanderaa
👋
Thoughts on moving forward with merging this as it is?

@mjbear mjbear added the question label Apr 4, 2025
@mjbear mjbear self-requested a review April 5, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants