Subject: Re: [TOOLS-DEVELOPMENT] Fyi example repo using xml2rfc cgi

From: Lou Berger <[email-masked]>
Date: Wed, 2 Aug 2017 10:49:24 -0400

here's something basic, it just reports failures/success via standard
travis email

    https://github.com/louberger/teas-gmpls-scsi

the next step (when I have some time) will to have travis publish back
artifacts (.txt and .html) as well as dynamically updated/generated xml
to the source repo.

Lou

PS i'm not sure if this intentional - and looking at the code it seems
not - but idnits is not generating an error exit code when it sees errors. 

On 7/31/2017 1:52 PM, HANSEN, TONY L wrote:
> It’ll be interesting seeing what you come up with for CI. I’m particularly interested on having an eye on it towards reuse.
>
> 	Tony
>
> On 7/31/17, 1:03 PM, "Lou Berger" <[email-masked]> wrote:
>
>     This is great! Thank you.
>     
>     Now I'll have to automate checks as part of ci...
>     
>     Lou
>     
>     
>     On July 31, 2017 12:09:57 PM "HANSEN, TONY L" <[email-masked]> wrote:
>     
>     > :)
>     >
>     > For those copying the URLs below, instead of this:
>     >
>     > https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_idnits-3Furl-3Dhttps-3A__xml2rfc.tools.ietf.org_cgi-2Dbin_xml2rfc-2Ddev.cgi-3Furl-3Dhttps-3A__raw.githubusercontent.com_ietf-2Drtg-2Darea-2Dyang-2Darch-2Ddt_meta-2Dmodel_master_logical-2Dnetwork-2Delement_draft-2Dietf-2Drtgwg-2Dlne-2Dmodel.xml-26modeAsFormat-3Dascii&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=Kz8VdgPVctDNSNPJ6PsBaw&m=hOxZsFWl-FxWFgkUsBHVdrMwb5VYk7o662f_Gi0u3cc&s=1VxgfkpC57NdUoZdM488jKmeUmQTJKS9IwCZVtNuzb4&e= 
>     >
>     > you should use this:
>     >
>     > https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_idnits-3Furl-3Dhttps-3A__xml2rfc.tools.ietf.org_cgi-2Dbin_xml2rfc.cgi-3Furl-3Dhttps-3A__raw.githubusercontent.com_ietf-2Drtg-2Darea-2Dyang-2Darch-2Ddt_meta-2Dmodel_master_logical-2Dnetwork-2Delement_draft-2Dietf-2Drtgwg-2Dlne-2Dmodel.xml-26modeAsFormat-3Dascii&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=Kz8VdgPVctDNSNPJ6PsBaw&m=hOxZsFWl-FxWFgkUsBHVdrMwb5VYk7o662f_Gi0u3cc&s=nPdoOL7br7spMxa1G27CadbyOVkxofQBxdaMbp4tI5s&e= 
>     >
>     > (note the “-dev” was deleted)
>     >
>     > 	Tony
>     >
>     > On 7/31/17, 12:02 PM, "Henrik Levkowetz" <[email-masked]> wrote:
>     >
>     >     Nice! :-)
>     >
>     >     	Henrik
>     >
>     >     On 2017-07-31 17:58, HANSEN, TONY L wrote:
>     >     > Thank you, Henrik.
>     >     >
>     >     > I successfully tested the new idnits with the dev version of xml2rfc.cgi. 
>     >     So I pushed the necessary changes out to the xml2rfc.cgi as well.
>     >     >
>     >     > So this works now:
>     >     >
>     >     > 
>     >     https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_idnits-3Furl-3Dhttps-3A__xml2rfc.tools.ietf.org_cgi-2Dbin_xml2rfc-2Ddev.cgi-3Furl-3Dhttps-3A__raw.githubusercontent.com_ietf-2Drtg-2Darea-2Dyang-2Darch-2Ddt_meta-2Dmodel_master_logical-2Dnetwork-2Delement_draft-2Dietf-2Drtgwg-2Dlne-2Dmodel.xml-26modeAsFormat-3Dascii&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=Kz8VdgPVctDNSNPJ6PsBaw&m=hOxZsFWl-FxWFgkUsBHVdrMwb5VYk7o662f_Gi0u3cc&s=1VxgfkpC57NdUoZdM488jKmeUmQTJKS9IwCZVtNuzb4&e= 
>     >     >
>     >     > As does this shorter call:
>     >     >
>     >     > 
>     >     https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_idnits-3Furl-3Dhttps-3A__xml2rfc.tools.ietf.org_cgi-2Dbin_github2text_ietf-2Drtg-2Darea-2Dyang-2Darch-2Ddt_meta-2Dmodel_master_logical-2Dnetwork-2Delement_draft-2Dietf-2Drtgwg-2Dlne-2Dmodel.xml&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=Kz8VdgPVctDNSNPJ6PsBaw&m=hOxZsFWl-FxWFgkUsBHVdrMwb5VYk7o662f_Gi0u3cc&s=d7QFknn1jl4tGSJcp7Wmouzm0-eiQ3N9rzKu1qxKZmE&e= 
>     >     >
>     >     > 	Tony
>     >     >
>     >     > On 7/31/17, 10:42 AM, "Henrik Levkowetz" <[email-masked]> wrote:
>     >     >
>     >     >     Hi Tony,
>     >     >
>     >     >     Lou just poked me on this; sorry for loosing track of it.
>     >     >
>     >     >     Inline:
>     >     >
>     >     >     On 2017-07-21 15:58, HANSEN, TONY L wrote:
>     >     >     > On 7/21/17, 3:50 AM, "Lou Berger" <[email-masked]> wrote:
>     >     >     >
>     >     >     >     Hi Tony,
>     >     >     >     	I did think of one thing that would be good to improve related 
>     >     to this:
>     >     >     >     the ability to pass the results of web xml2rfc to idnits
>     >     >     >
>     >     >     >     for example, the following doesn't work:
>     >     >     >
>     >     >     >     
>     >     https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_idnits-3Furl-3Dhttps-3A__xml2rfc.tools.ietf.org_cgi-2Dbin_xml2rfc.cgi-3Furl-3Dhttps-3A__raw.githubusercontent.com_ietf-2Drtg-2Darea-2Dyang-2Darch-2Ddt_meta-2Dmodel_master_logical-2Dnetwork-2Delement_draft-2Dietf-2Drtgwg-2Dlne-2Dmodel.xml-26modeAsFormat-3Dascii&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=Kz8VdgPVctDNSNPJ6PsBaw&m=hOxZsFWl-FxWFgkUsBHVdrMwb5VYk7o662f_Gi0u3cc&s=nPdoOL7br7spMxa1G27CadbyOVkxofQBxdaMbp4tI5s&e= 
>     >     >     >
>     >     >     >     Lou
>     >     >     >
>     >     >     >
>     >     >     > This is an integration problem between web xml2rfc and idnits. 
>     >     Idnits returns the following error:
>     >     >     >
>     >     >     >        Unexpected file name
>     >     >     >
>     >     >     >        The uploaded file didn't have the expected .txt extenstion.
>     >     >     >
>     >     >     >
>     >     >     > Henrik, these are the headers that are returned from xml2rfc:
>     >     >     >
>     >     >     > 	HTTP/1.1 200 OK
>     >     >     > 	Date: Fri, 21 Jul 2017 13:22:03 GMT
>     >     >     > 	Server: Apache/2.2.22 (Debian)
>     >     >     > 	Vary: Accept-Encoding
>     >     >     > 	Transfer-Encoding: chunked
>     >     >     > 	Content-Type: text/plain; charset=ISO-8859-1
>     >     >     >
>     >     >     > I then modified xml2rfc-dev.cgi to generate this additional header:
>     >     >     >
>     >     >     > 	Content-Disposition: inline; filename="url.txt"
>     >     >     >
>     >     >     > But it made no difference.
>     >     >
>     >     >     I've added support for a filename being provided with the 
>     >     Content-Disposition
>     >     >     header field; this should work now.
>     >     >
>     >     >     > What in particular is idnits looking for?
>     >     >
>     >     >     Simply the extension to which the uploaded file was saved, which was 
>     >     taken
>     >     >     from the upload form name, or the url directly, earlier.
>     >     >
>     >     >
>     >     >     Best regards,
>     >     >
>     >     >     	Henrik
>     >     >
>     >     >
>     >     >     > 	Tony
>     >     >     >
>     >     >     > _______________________________________________
>     >     >     > TOOLS-DEVELOPMENT mailing list
>     >     >     > [email-masked]
>     >     >     > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_tools-2Ddevelopment&d=DwIDaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=Kz8VdgPVctDNSNPJ6PsBaw&m=hOxZsFWl-FxWFgkUsBHVdrMwb5VYk7o662f_Gi0u3cc&s=ulDT5puwELnP0Ha9sKrP3MFwXpqZRSwH8NL519otzek&e= 
>     >     >     >
>     >     >
>     >     >
>     >     >
>     >
>     >
>     >
>     
>     
>     
>

---

From: Henrik Levkowetz <[email-masked]>
Date: Thu, 3 Aug 2017 18:56:27 +0200

Hi Lou,

> not - but idnits is not generating an error exit code when it sees errors. 

Is it the command-line idnits or the web service which you'd like to return
errors?

	Henrik

> https://www.ietf.org/mailman/listinfo/tools-development
>

---

From: Lou Berger <[email-masked]>
Date: Thu, 03 Aug 2017 13:57:48 -0400

Hi Henrick,

On August 3, 2017 12:57:06 PM Henrik Levkowetz <[email-masked]> wrote:

...

> Is it the command-line idnits or the web service

Command line.

> which you'd like to return
> errors?
>

Looking at the script it looks like the exit code should equal the number 
of reported errors, but this isn't the case.

I actually don't need any changes for my use, grep -q gives me the exit 
code I need for testing, it just looked liked the exit code isn't as coded 
so was just letting you know.

Cheers,
Lou

---

From: Henrik Levkowetz <[email-masked]>
Date: Thu, 3 Aug 2017 20:10:20 +0200

Hi Lou,

>> Is it the command-line idnits or the web service

Ok.

> so was just letting you know.

Ack, understood.  I'll have a look.  I have a feeling there's a reason
for the missing error code, could be that awk isn't set up to let you
specify an error value.

	Henrik

---

From: Lou Berger <[email-masked]>
Date: Thu, 3 Aug 2017 15:06:34 -0400

Hi Henrik,

> for the missing error code, could be that awk isn't set up to let you
Okay, you made me look;-)

Awk's exit code is the number of errors and this is returned by the
checknits function, but the calling code isn't using the return value. 
I don't know if this is the design intent or not.  It would be trivial
to modify the code to have the exit code be the number of errors,  if
anyone needed/wanted this.

Lou

PS enjoy your vacation and we can pick this up on your return if you
want to discuss further...