public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Beth 'pidge' Flanagan <pidge@toganlabs.com>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [RFC][PATCH] report-error.bbclass: Add support for autosending
Date: Fri, 09 Sep 2016 11:38:57 +0200	[thread overview]
Message-ID: <1473413937.2869.13.camel@toganlabs.com> (raw)
In-Reply-To: <20160909093111.GA2639@jama>

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:
> > 
> > This commit pulls and extends the functionality of .oe-error-report 
> > into
> > local.conf. It maintains the functionality of .oe-error-report.
> > 
> > It also enables report-error to automatically send error reports to
> > a 
> > specified error report server. This patch enables infrastructure
> > ppl to
> > set development teams up so that we can gather error metrics
> > automatically.
> > 
> > This relies on a new set of variables:
> > 
> > REPORTERROR[autosend]="yes|no|ask"
> > REPORTERROR[user]=username
> > REPORTERROR[email]=email
> > REPORTERROR[server]=error-report-web instance
> > 
> > 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:
> 
> http://lists.openembedded.org/pipermail/openembedded-core/2014-March/
> 091222.html
> 

I'd be happy to defer to that patch if we can pull this functionality
in.

-b

> > 
> > Signed-off-by: Elizabeth 'pidge' Flanagan <pidge@toganlabs.com>
> > ---
> >  meta/classes/report-error.bbclass | 41
> > +++++++++++++++++++++++++++++++++++++--
> >  1 file changed, 39 insertions(+), 2 deletions(-)
> > 
> > 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 () {
> >              bb.utils.unlockfile(lock)
> >              failures = jsondata['failures']
> >              if(len(failures) > 0):
> > +
> >                  filename = "error_report_" +
> > e.data.getVar("BUILDNAME", True)+".txt"
> >                  datafile = errorreport_savedata(e, jsondata,
> > filename)
> > -                bb.note("The errors for this build are stored in
> > %s\nYou can send the errors to a reports server by
> > running:\n  send-error-report %s [-s server]" % (datafile,
> > datafile))
> > -                bb.note("The contents of these logs will be posted
> > 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.")
> > +
> > +                cmd_s = "send-error-report %s" % datafile
> > +                response_s = "The errors for this build are stored
> > in %s\n" % datafile
> > +                sendit = False
> > +
> > +                autosend =
> > e.data.getVarFlag("REPORTERROR","autosend")
> > +                user = e.data.getVarFlag("REPORTERROR","user")
> > +                email = e.data.getVarFlag("REPORTERROR","email")
> > +                server = e.data.getVarFlag("REPORTERROR","server")
> > +
> > +                if user is not None:
> > +                    cmd_s += " -n %s" % user
> > +                if email is not None:
> > +                    cmd_s += " -e %s" % email
> > +                if server is not None:
> > +                    cmd_s += " -s %s" % server
> > +
> > +                if autosend is not None:
> > +                    if autosend == "yes":
> > +                        response_s += "The errors for this build
> > are set to automatically be sent.\n"
> > +                        cmd_s += " -y"
> > +                        sendit = True
> > +                    elif autosend == "ask":
> > +                        response_s += "The errors for this build
> > are set to automatically be sent.\n"
> > +                        sendit = True
> > +                elif autosend is None:
> > +                        response_s += "You can send the errors to
> > a reports server by running:\n  %s\n" % cmd_s
> > +                elif e.data.getVarFlags('REPORTERROR') is None:
> > +                        response_s += "You can send the errors to
> > a reports server by running:\n  %s [-s server]\n" % cmd_s
> > +                        response_s += "The contents of these logs
> > will be posted in public if you use the above command with the
> > default server.\n \
> > +                             Please ensure you remove any
> > identifying or proprietary information when prompted before
> > sending.\n"
> > +
> > +                bb.note(response_s)
> > +
> > +                if sendit == True:
> > +                    import shlex, subprocess
> > +                    args = shlex.split(cmd_s)
> > +                    subprocess.call(args)
> >  }
> >  
> >  addhandler errorreport_handler
> > -- 
> > 2.9.3
> > 
> > -- 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core


      reply	other threads:[~2016-09-09  9:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  9:26 [RFC][PATCH] report-error.bbclass: Add support for autosending Elizabeth 'pidge' Flanagan
2016-09-08 18:23 ` Randy Witt
2016-09-08 20:42 ` Paul Eggleton
2016-09-08 22:01   ` Richard Purdie
2016-09-09  9:31 ` Martin Jansa
2016-09-09  9:38   ` Beth 'pidge' Flanagan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1473413937.2869.13.camel@toganlabs.com \
    --to=pidge@toganlabs.com \
    --cc=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox