Skip to contentSkip to conversation

reporter-error sending report

PATCH In review João Henrique Ferreira de Freitas 2 participants 4 messages Nov 12, 2014 – Nov 13, 2014

lore
Share & tools
lore
#0 lore raw

cover reporter-error sending report

When the Error Reporting Tool is enabled and the build fails, then the report-error prints an url that the user needs to get and use the send-error-report tool which will sends the reporter to a public or private reporting server error.

This works very well if the user is sitting in front of the building machine. There are some cases, like jobs running on Jenkins server, that need to send reports automatically when a build fails.

This patch set introduces a glue between reporter-error.bbclass and send-error-reporter tool. So, report erros will be send as soon as an error happens.

Two new variables were added and the user takes the responsible to fill them (conf/site.conf), for example:

INHERIT += "report-error"
ERR_REPORT_SERVER = "127.0.0.1:8000"
ERR_REPORT_USER = "joaohf"
ERR_REPORT_EMAIL = "[email protected]"

João Henrique Ferreira de Freitas (2):
report-error: sending error report to server without user intervention
report-error: send report error with username and email

 meta/classes/report-error.bbclass | 15 +++++++++++++
 scripts/send-error-report         | 45 ++++++++++++++++++++++++---------------
 2 files changed, 43 insertions(+), 17 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 report-error: sending error report to server without user intervention

If ERR_REPORT_SERVER is set to a server which has a running instance of Error Reporting Tool, then that server will be used to send error reports.

---
 meta/classes/report-error.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/classes/report-error.bbclass +11 -0
index 5fe2355..f9e821f 100644
@@ -7,6 +7,7 @@
 # Licensed under the MIT license, see COPYING.MIT for details
 
 ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
+ERR_REPORT_SERVER ?= ""
 
 def errorreport_getdata(e):
     logpath = e.data.getVar('ERR_REPORT_DIR', True)
@@ -24,6 +25,16 @@ def errorreport_savedata(e, newdata, file):
         json.dump(newdata, f, indent=4, sort_keys=True)
     return datafile
 
+def errorreport_senddata(e, datafile):
+    import subprocess
+    server = e.data.getVar('ERR_REPORT_SERVER', True)
+    if server:
+        cmd = 'send-error-report %s %s' % (datafile, server)
+        subprocess.call(cmd, shell=True)
+    else:
+        bb.note("The errors for this build are stored in %s\nYou can send the errors to an upstream server by running:\n  send-error-report %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. If you need to do so, please ensure you remove any identifying or proprietary information before sending.")
+    
 python errorreport_handler () {
         import json
 
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 report-error: send report error with username and email

In reply to João Henrique Ferreira de Freitas

Two variables ERR_REPORT_USER and ERR_REPORT_EMAIL were created to instruct send-report-error to use 'user' and 'email' from command line parameters instead of checking '~/.oe-send-error' file.

Two new positional arguments were added to send-report-error. If 'username' (third argument) is passed, then send-error-report will not check userfile. As 'email' (forth argument) is an optional, it will used only if passed.

---
 meta/classes/report-error.bbclass |  6 +++++-
 scripts/send-error-report         | 45 ++++++++++++++++++++++++---------------
 2 files changed, 33 insertions(+), 18 deletions(-)
meta/classes/report-error.bbclass +5 -1
index f9e821f..253a659 100644
@@ -8,6 +8,8 @@
 
 ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
 ERR_REPORT_SERVER ?= ""
+ERR_REPORT_USER ?= ""
+ERR_REPORT_EMAIL ?= ""
 
 def errorreport_getdata(e):
     logpath = e.data.getVar('ERR_REPORT_DIR', True)
@@ -29,7 +31,9 @@ def errorreport_senddata(e, datafile):
     import subprocess
     server = e.data.getVar('ERR_REPORT_SERVER', True)
     if server:
-        cmd = 'send-error-report %s %s' % (datafile, server)
+        user = e.data.getVar('ERR_REPORT_USER', True)
+        email = e.data.getVar('ERR_REPORT_EMAIL', True)
+        cmd = 'send-error-report %s %s %s %s' % (datafile, server, user, email)
         subprocess.call(cmd, shell=True)
     else:
         bb.note("The errors for this build are stored in %s\nYou can send the errors to an upstream server by running:\n  send-error-report %s [server]" % (datafile, datafile))
scripts/send-error-report +28 -17

63 lines not on this page · raw message

Signature · 1 line
1.9.1
#3 lore raw
In reply to João Henrique Ferreira de Freitas
Quoted 9 lines · João Henrique Ferreira de Freitas

When the Error Reporting Tool is enabled and the build fails, then the report-error prints an url that the user needs to get and use the send-error-report tool which will sends the reporter to a public or private reporting server error.

This works very well if the user is sitting in front of the building machine. There are some cases, like jobs running on Jenkins server, that need to send reports automatically when a build fails.

This patch set introduces a glue between reporter-error.bbclass and send-error-reporter tool.

it's report-error.bbclass and send-error-report (not reporter)

Quoted 9 lines

So, report erros will be send as soon as an error happens.

Two new variables were added and the user takes the responsible to fill them (conf/site.conf), for example:

INHERIT += "report-error"
ERR_REPORT_SERVER = "127.0.0.1:8000"
ERR_REPORT_USER = "joaohf"
ERR_REPORT_EMAIL = "[email protected]"

See
http://lists.openembedded.org/pipermail/openembedded-core/2014-March/090576.html
which does the same, but was rejected because of concerns that someone will unintentionally upload sensitive data to some public report server.

Quoted 18 lines

João Henrique Ferreira de Freitas (2):
report-error: sending error report to server without user intervention
report-error: send report error with username and email

 meta/classes/report-error.bbclass | 15 +++++++++++++
 scripts/send-error-report         | 45 ++++++++++++++++++++++++---------------
 2 files changed, 43 insertions(+), 17 deletions(-)
Signature · 7 lines
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]