Subject: Re: [yang-doctors] automating yang doctor reviews

From: Kent Watsen <[email-masked]>
Date: Mon, 23 Apr 2018 18:40:30 +0000

anyone interested in this draft?  (draft attached in my previous message)

/kw

===== original message =====

Doctors,

Here's a stab at how we might automate the basic parts of a YANG Doctor review, something I've mentioned wanting at the YD-lunch meeting at the last two IETF meetings.

I'll be the first to say that this proposal has issues, but hopefully it's in the ballpark, and we can finish it off together, assuming there is interest in bringing it forward at all...

Note, I assume that this document will be AD-sponsored, just like RFC 7991 was, hence why the draft name is what it is.

Kent

---

From: Mahesh Jethanandani <[email-masked]>
Date: Mon, 23 Apr 2018 11:59:05 -0700

I am interested. Specially, after having gone through yet another early review of a YANG module, where most of the issues could be caught by a tool.

> On Apr 23, 2018, at 11:40 AM, Kent Watsen <[email-masked]> wrote:
> 
> 
> _______________________________________________
> yang-doctors mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/yang-doctors

Mahesh Jethanandani
[email-masked]

---

From: Kent Watsen <[email-masked]>
Date: Mon, 23 Apr 2018 20:22:27 +0000

Great, and I got another +1 off-list

I guess the question is if this draft is a reasonable starting point to get "adopted" by the IAB.  Perhaps folks could review it and provide comments?

Also, I'm hoping to add text-contributing co-authors.  I haven't posted the source to github yet, but will if anyone is interested in banging on it.

K.

> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_yang-2Ddoctors&d=DwIFAg&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=v7E95iMQwjAbOeiuFnSLaOBxX7SKH6anUk4yB3mJPUc&s=rph7N8-XhEoVgyBB6m7B4Xon1SQzJD-VaVV4L-3D9nM&e=

Mahesh Jethanandani
[email-masked]

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Mon, 23 Apr 2018 22:25:11 +0200

Kent,

it seems that many of us manage several artefacts while producing an
I-D (that is the .xml that is then rendered as an I-D).

a) YANG modules
b) derived artefacts such as tree diagrams
c) examples snippets (XML or JSON)
d) source of textual information (growing variety of formats used here)
e) tooling to validate examples and YANG modules
f) tooling to produce .xml out of a)-d)

What you are proposing, if I understand correctly, is to extend the
xml2rfc vocabulary such that we can reverse step f), at least
partially, to extract a) and c) out of the xml2rfc format and perhaps
generate b) automatically from a) and then do e) within the IETF
infrastructure. I am not sure I am excited about turning a document
markup format (xml2rfc) into a general container format and perhaps
also into a (scriptable) data transformation format. (But yes, it
sound much better than what we do today, extracting artefacts out of
rendered and paginated text.)

Perhaps things could be simpler if authors would be able to submit all
pieces that make up an I-D as separate artefacts instead of first
inlining all of the artefacts in some xml2rfc container format and
then extracting them again out of this format to feed tool chains.

The whole idea that a document is a single file using a single format
really feels somewhat odd these days. (Well, it already felt odd when
people were writing MIB modules and the RFC editor used nroff or plain
text to start their editing. The pain isn't new, just coming along in
a different flavor.)

Perhaps all we need is a proper sourcecode include mechanism and a
submission tool that allows to submit multiple artefacts so we do not
need to first inline everything into xml2rfc and then extract things
out of it again.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>

---

From: Benoit Claise <[email-masked]>
Date: Mon, 23 Apr 2018 22:48:52 +0200

> then extracting them again out of this format to feed tool chains.
Exactly.
That way, we could add more example snippets, even after the publication.

Regards, Benoit

---

From: Andy Bierman <[email-masked]>
Date: Mon, 23 Apr 2018 14:03:15 -0700

Hi,

I approve of more automation tools.

The draft is not fully-specified for features like validation of examples.
This might be difficult to automate.

Validation of YANG trees seems like a complex exercise.
Automatic generation of tree diagrams would be a great feature.

Andy

On Mon, Apr 23, 2018 at 11:40 AM, Kent Watsen <[email-masked]> wrote:

> Here's a stab at how we might automate the basic parts of a YANG Doctor
> review, something I've mentioned wanting at the YD-lunch meeting at the
> last two IETF meetings.
>
> I'll be the first to say that this proposal has issues, but hopefully it's
> in the ballpark, and we can finish it off together, assuming there is
> interest in bringing it forward at all...
>
> Note, I assume that this document will be AD-sponsored, just like RFC 7991
> was, hence why the draft name is what it is.
>
> Kent
>
>
>
>

---

From: Kent Watsen <[email-masked]>
Date: Tue, 24 Apr 2018 19:35:38 +0000

Hi Juergen,

Yes, the gist of the draft is to put everything in a single 
XML-based draft-submission document.   The thinking for this
was that it would be easier for the ietf-tools team to act on.

Turning it around and introducing multiple files to be 
submitted as a collection (e.g., a TGZ?) is an interesting 
idea, not for its elimination of the extraction-step (which 
is trivial), but for its ability to include extras (that 
would otherwise not be in the draft itself) including:

 - additional YANG modules needed to validate import statements
   (though the is a danger here that they might be out of date)

 - additional instance documents (xml/json files) needed to when 
   validating examples.  E.g. some tools need to RPC file when
   validating an RPC-reply; also, some tools need to have an
   instance document to resolve leafrefs used in examples.

 - scripts that can be used to perform the validation, rather
   than embedding a command-line into an XML attribute.  As a
   standalone file, the scripts could be arbitrarily complex.
   E.g., for the zerotouch draft, I use scripts to convert the
   RESTCONF-based examples into NETCONF-based examples that get
   validated, since no tool I'm aware of knows how to validate
   RESTCONF-based examples.

So, if I understand your proposal, the idea is:

 1) to enable the submission of:
     - a pile of files
     - a script that can validate each file
     - a script that can build a resulting XML2RFC-based doc, 
       including the generation of any tree-diagrams

 2) this raw submission structure would be available throughout
    the document publication process (I-D --> AUTH48)

 3) the generation of the XML2RFC-based doc would occur
    whenever an update is made, so that all the existing
    web UI would remain intact.

I know that you're not a fan of bloating the XML-doc into an
all-encompassing container, but I don't see it as that big of
a deal, and would even consider adding some new XML2RFC elements
(e.g., <file>, <script>, etc.) to address some of the gaps
identified above so the one file can include everything needed.

Kent

Kent,

a) YANG modules

/js

On Mon, Apr 23, 2018 at 06:40:30PM +0000, Kent Watsen wrote:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_yang-2Ddoctors&d=DwIBAg&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=UrziQP3s4fITo_wUsi2cdmXRqEtk_zMyn2Ut8_jri7E&s=7QA7pbsnofbw_zkgaZMhCEAJ1s4XokxRbhuihtUhibo&e=

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.jacobs-2Duniversity.de_&d=DwIBAg&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=UrziQP3s4fITo_wUsi2cdmXRqEtk_zMyn2Ut8_jri7E&s=GPgpXZD_hh6MbuLEDrj2KHARk2aPtKWbTjJwNls_kvE&e=>

---

From: Kent Watsen <[email-masked]>
Date: Tue, 24 Apr 2018 19:36:07 +0000

Hi Andy,

> This might be difficult to automate.

The draft intends to support the validation of examples (see Section 6.2), which would presumably be encoded inside XML2RFC's  <sourcecode> element.   I agree that the current text is weak, is this what you mean by "not fully-specified"?

> Automatic generation of tree diagrams would be a great feature.

Correct, the draft avoids trying to *validate* tree-diagrams by instead focusing on enabling the tree-diagrams to be generated (see the "gen" attribute defined in Section 6.1)

Kent

---

From: Andy Bierman <[email-masked]>
Date: Tue, 24 Apr 2018 13:30:41 -0700

On Tue, Apr 24, 2018 at 12:36 PM, Kent Watsen <[email-masked]> wrote:

> The draft intends to support the validation of examples (see Section 6.2),
> which would presumably be encoded inside XML2RFC's  <sourcecode> element.
>  I agree that the current text is weak, is this what you mean by "not
> fully-specified"?
>
>
>

yes - you have to define lots of metadata to properly validate examples,
or force the user to write a separate validate-script for every example

Andy

> Correct, the draft avoids trying to *validate* tree-diagrams by instead
> focusing on enabling the tree-diagrams to be generated (see the "gen"
> attribute defined in Section 6.1)
>
>
>

---

From: Andy Bierman <[email-masked]>
Date: Tue, 24 Apr 2018 13:40:51 -0700

Hi,

This seems like an elaborate project, but a valuable goal.

The first assumption is that it is YANG Doctors' responsibility to validate
every example and every tree diagram in a draft.  If this is the case,
then we all agree that tools should do the work, not people.

Since people rely on the tree diagrams and examples (maybe too much)
they have to be correct. This means (1) adding them early and (2) updating
them as
things change.

I suggest getting input from the IETF Tools Team as to how idnits can solve
this problem.
What tools need to be developed. What is the scope of the work (just
NETCONF, RESTCONF, and YANG?).

Andy

On Tue, Apr 24, 2018 at 12:35 PM, Kent Watsen <[email-masked]> wrote:

> > I'll be the first to say that this proposal has issues, but hopefully
> it's in the ballpark, and we can finish it off together, assuming there is
> > Note, I assume that this document will be AD-sponsored, just like RFC
> 7991 was, hence why the draft name is what it is.
> >
> > Kent
> >
> >
> >
> >
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.
> ietf.org_mailman_listinfo_yang-2Ddoctors&d=DwIBAg&c=
> HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=
> 9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=UrziQP3s4fITo_
> wUsi2cdmXRqEtk_zMyn2Ut8_jri7E&s=7QA7pbsnofbw_
> zkgaZMhCEAJ1s4XokxRbhuihtUhibo&e=
>
> --
> Fax:   +49 421 200 3103         <https://urldefense.
> proofpoint.com/v2/url?u=https-3A__www.jacobs-2Duniversity.de_&d=DwIBAg&c=
> HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=
> 9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=UrziQP3s4fITo_
> wUsi2cdmXRqEtk_zMyn2Ut8_jri7E&s=GPgpXZD_hh6MbuLEDrj2KHARk2aPtKWbTjJwNl
> s_kvE&e=>
>
>