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

IETF directories not updating #1562

Open
samans opened this issue Jun 13, 2024 · 9 comments
Open

IETF directories not updating #1562

samans opened this issue Jun 13, 2024 · 9 comments

Comments

@samans
Copy link
Contributor

samans commented Jun 13, 2024

https://github.com/YangModels/yang/tree/main/standard/ietf
The RFC directory has not been updated since 23 November 2023
121ac33 is the last commit.

The internet-draft extracted yang modules directory https://github.com/YangModels/yang/tree/main/experimental/ietf-extracted-YANG-modules hasn't been upaded since 20 December 2023 ead6cbf is the last commit.

The modules are available at the https://www.ietf.org/ietf-ftp/yang/, just not in git.

Can someone please look at this and advise?

@xorrkaz
Copy link
Contributor

xorrkaz commented Jul 9, 2024

Yes, this has been broken since the move to the new AWS instance. I'll admit I do not know why as yet. Modules were being checked against that git repo, it's just for some reason the push isn't happening correctly. I should have some time at the IETF 120 meeting to take a deeper look at this. I might have to break out a big hammer to get it working again.

@rwestphal
Copy link

The modules are available at the https://www.ietf.org/ietf-ftp/yang/, just not in git.

Indeed, but apparently not all modules.

draft-ietf-bier-bier-yang-09 was released a few days ago, but I can't find ietf-bier.yang in https://www.ietf.org/ietf-ftp/yang/draftmod/

I realize this is a separate problem though.

@samans
Copy link
Contributor Author

samans commented Aug 27, 2024

Thanks for all the efforts to get the I-D yang models automatically extracted and put in experimental/ietf-extracted-YANG-modules. However, there are still (at least one) that is missing. https://datatracker.ietf.org/doc/draft-ietf-netmod-rfc6991-bis/ was updated and contains two yang modules. But only one of them was extracted and added to experimental/ietf-extracted-YANG-modules. This one was added.. [email protected], the [email protected] was not extracted and added to the repository.

@xorrkaz
Copy link
Contributor

xorrkaz commented Aug 27, 2024

The problem is this line in the ietf-inet-types module:

+ '\[[a-zA-Z0-9!"#$%&'+"'"+'()*+,./:;<=>?@\^_{|}~-]+])';`

That single " quote character there is causing an imbalance in xym's processing of this module, and thus it is not being extracted. If you adding a second " to the character class, it would extract, but then you have something weird in there.

@einarnn Since you maintain xym, I wonder if you could review this approach to solving the problem:

xym.py line 539:

-                if line.count("\"") % 2 == 0:
+                if line.count("\"") % 2 == 0 or re.search(r"'[^']+\"", line):

Essentially, ignore a double-quote if itself is quoted by a single quote on the same line. This feels naive, but does work in this case. The problem with this approach being that it only needs one double-quote to be single-quoted. Another could be outside the quote block, and this would pass.

@xorrkaz
Copy link
Contributor

xorrkaz commented Sep 14, 2024

@einarnn Thoughts on the above? Do you want me to open an issue with xym?

@einarnn
Copy link
Member

einarnn commented Sep 19, 2024 via email

@xorrkaz
Copy link
Contributor

xorrkaz commented Sep 19, 2024

Sure. The most unambiguous place to find this is by opening the XML and looking at line 1622. That is the offending line preventing the module [email protected] from being extracted.

@einarnn
Copy link
Member

einarnn commented Sep 19, 2024

@xorrkaz, I agree that this is not seen to fail. But it leads me to wonder if we can just stop trying to do it this way. If we are extracting from the XML variant of the drafts, can't we depend more explicitly on extracting the `sourcecode element

<sourcecode><![CDATA[
<CODE BEGINS> file "[email protected]"
module ietf-inet-types {

...rest of the yang model text...

<CODE ENDS>
]]></sourcecode>

The current iteration of the tool was implemented to extract text from a text version of the draft, not the XML version. If we instead depend on matching this regex to the contents of sourcecode elements:

r"""<CODE BEGINS> file "(.+)"\n(.+)\n<CODE ENDS>"""

I may not have that completely right, but the intent is that group 1 will contain YANG file name and group 2 will contain the YANG module.

This style of parsing could be triggered with a new option, maybe --xml | -x, leaving the current text file targeted approach as it is.

Thoughts?

@xorrkaz
Copy link
Contributor

xorrkaz commented Sep 19, 2024

I think that's a great idea given I believe XML is now mandatory. And if you throw lxml or maybe xmltodict in here, you could just literally grab the element.

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

No branches or pull requests

4 participants