From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Greylist: delayed 1156 seconds by postgrey-1.34 at layers.openembedded.org; Fri, 09 Sep 2016 09:58:38 UTC Received: from antelope.tulip.relay.mailchannels.net (antelope.tulip.relay.mailchannels.net [23.83.218.4]) by mail.openembedded.org (Postfix) with ESMTP id 1A92A60851 for ; Fri, 9 Sep 2016 09:58:37 +0000 (UTC) X-Sender-Id: hostpapa|x-authuser|pidge@toganlabs.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C0F481208DF; Fri, 9 Sep 2016 09:39:16 +0000 (UTC) Received: from hp181.hostpapa.com (ip-10-229-2-62.us-west-2.compute.internal [10.229.2.62]) by relay.mailchannels.net (Postfix) with ESMTPA id E3958120E77; Fri, 9 Sep 2016 09:39:15 +0000 (UTC) X-Sender-Id: hostpapa|x-authuser|pidge@toganlabs.com Received: from hp181.hostpapa.com ([TEMPUNAVAIL]. [10.16.27.41]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.7.8); Fri, 09 Sep 2016 09:39:16 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: hostpapa|x-authuser|pidge@toganlabs.com X-MailChannels-Auth-Id: hostpapa X-MC-Loop-Signature: 1473413956296:1662574646 X-MC-Ingress-Time: 1473413956296 Received: from ip-217-103-177-37.ip.prioritytelecom.net ([217.103.177.37]:51728 helo=[10.191.255.204]) by hp181.hostpapa.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1biIGx-003Jmq-M1; Fri, 09 Sep 2016 11:39:09 +0200 Message-ID: <1473413937.2869.13.camel@toganlabs.com> From: Beth 'pidge' Flanagan Reply-To: pidge@toganlabs.com To: Martin Jansa Date: Fri, 09 Sep 2016 11:38:57 +0200 In-Reply-To: <20160909093111.GA2639@jama> References: <20160908092601.7588-1-pidge@toganlabs.com> <20160909093111.GA2639@jama> Organization: toganlabs.com X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 X-OutGoing-Spam-Status: No, score=-1.0 X-AuthUser: pidge@toganlabs.com Cc: openembedded-core@lists.openembedded.org Subject: Re: [RFC][PATCH] report-error.bbclass: Add support for autosending X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 09:58:42 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2016-09-09 at 11:31 +0200, Martin Jansa wrote: > On Thu, Sep 08, 2016 at 11:26:01AM +0200, Elizabeth 'pidge' Flanagan > wrote: > >=20 > > This commit pulls and extends the functionality of .oe-error-report=20 > > into > > local.conf. It maintains the functionality of .oe-error-report. > >=20 > > It also enables report-error to automatically send error reports to > > a=C2=A0 > > specified error report server. This patch enables infrastructure > > ppl to > > set development teams up so that we can gather error metrics > > automatically. > >=20 > > This relies on a new set of variables: > >=20 > > REPORTERROR[autosend]=3D"yes|no|ask" > > REPORTERROR[user]=3Dusername > > REPORTERROR[email]=3Demail > > REPORTERROR[server]=3Derror-report-web instance > >=20 > > For autosend yes and no are pretty self explainatory. ask does not > > pass > > the -y flag to send-error-report, thus enabling the end user to > > review > > the report prior to submission. > The same functionality was sent more than 2 years ago, but it was > rejected, so I'm carrying it in our own fork since then: >=20 > http://lists.openembedded.org/pipermail/openembedded-core/2014-March/ > 091222.html >=20 I'd be happy to defer to that patch if we can pull this functionality in. -b > >=20 > > Signed-off-by: Elizabeth 'pidge' Flanagan > > --- > > =C2=A0meta/classes/report-error.bbclass | 41 > > +++++++++++++++++++++++++++++++++++++-- > > =C2=A01 file changed, 39 insertions(+), 2 deletions(-) > >=20 > > diff --git a/meta/classes/report-error.bbclass > > b/meta/classes/report-error.bbclass > > index 82b5bcd..909adf0 100644 > > --- a/meta/classes/report-error.bbclass > > +++ b/meta/classes/report-error.bbclass > > @@ -85,10 +85,47 @@ python errorreport_handler () { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0bb.utils.unlockfile(lock) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0failures =3D jsondata['failures'] > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0if(len(failures) > 0): > > + > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0filename =3D "error_report_" + > > e.data.getVar("BUILDNAME", True)+".txt" > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0datafile =3D errorreport_savedata(e, jso= ndata, > > filename) > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0bb.note("The errors for this build are stored = in > > %s\nYou can send the errors to a reports server by > > running:\n=C2=A0=C2=A0send-error-report %s [-s server]" % (datafile, > > datafile)) > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0bb.note("The contents of these logs will be po= sted > > in public if you use the above command with the default server. > > Please ensure you remove any identifying or proprietary information > > when prompted before sending.") > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0cmd_s =3D "send-error-report %s" % datafile > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0response_s =3D "The errors for this build are = stored > > in %s\n" % datafile > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0sendit =3D False > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0autosend =3D > > e.data.getVarFlag("REPORTERROR","autosend") > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0user =3D e.data.getVarFlag("REPORTERROR","user= ") > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0email =3D e.data.getVarFlag("REPORTERROR","ema= il") > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0server =3D e.data.getVarFlag("REPORTERROR","se= rver") > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0if user is not None: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cmd_s +=3D " -n %s" % = user > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0if email is not None: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cmd_s +=3D " -e %s" % = email > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0if server is not None: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0cmd_s +=3D " -s %s" % = server > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0if autosend is not None: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if autosend =3D=3D "ye= s": > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= response_s +=3D "The errors for this build > > are set to automatically be sent.\n" > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= cmd_s +=3D " -y" > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= sendit =3D True > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0elif autosend =3D=3D "= ask": > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= response_s +=3D "The errors for this build > > are set to automatically be sent.\n" > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= sendit =3D True > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0elif autosend is None: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= response_s +=3D "You can send the errors to > > a reports server by running:\n=C2=A0=C2=A0%s\n" % cmd_s > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0elif e.data.getVarFlags('REPORTERROR') is None= : > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= response_s +=3D "You can send the errors to > > a reports server by running:\n=C2=A0=C2=A0%s [-s server]\n" % cmd_s > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= response_s +=3D "The contents of these logs > > will be posted in public if you use the above command with the > > default server.\n \ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Please ensure you remove any > > identifying or proprietary information when prompted before > > sending.\n" > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0bb.note(response_s) > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0if sendit =3D=3D True: > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0import shlex, subproce= ss > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0args =3D shlex.split(c= md_s) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0subprocess.call(args) > > =C2=A0} > > =C2=A0 > > =C2=A0addhandler errorreport_handler > > --=C2=A0 > > 2.9.3 > >=20 > > --=C2=A0 > > _______________________________________________ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core