[libreport/f19] fixed reporting from anaconda rhbz#926916

Jiří Moskovčák jmoskovc at fedoraproject.org
Thu Apr 4 17:16:04 UTC 2013


commit f5f1a7821527c062d637fb43799fac048474f785
Author: Jiri Moskovcak <jmoskovc at redhat.com>
Date:   Thu Apr 4 19:01:03 2013 +0200

    fixed reporting from anaconda rhbz#926916
    
    Resolves: #926916
    
    Signed-off-by: Jiri Moskovcak <jmoskovc at redhat.com>

 ...tsupport-fix-hint-query-to-use-correct-UR.patch |   67 ++++++++++++++++++++
 ...-helper-upload-data-with-application-octe.patch |   30 +++++++++
 ...-gtk-show-Next-Step-btn-at-workflow-start.patch |   34 ++++++++++
 ...fixed-reporting-from-bugzilla-rhbz-926916.patch |   61 ++++++++++++++++++
 libreport.spec                                     |   14 ++++-
 5 files changed, 205 insertions(+), 1 deletions(-)
---
diff --git a/0001-reporter-rhtsupport-fix-hint-query-to-use-correct-UR.patch b/0001-reporter-rhtsupport-fix-hint-query-to-use-correct-UR.patch
new file mode 100644
index 0000000..894d78b
--- /dev/null
+++ b/0001-reporter-rhtsupport-fix-hint-query-to-use-correct-UR.patch
@@ -0,0 +1,67 @@
+From 6a5a335f82ed0f2f5a4a0a6905e45cb7bcb84350 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <dvlasenk at redhat.com>
+Date: Tue, 26 Mar 2013 11:32:59 +0100
+Subject: [LIBREPORT PATCH 1/5] reporter-rhtsupport: fix hint query to use
+ correct URL
+
+We should use rs/problems, not rs/cases/NNNNNNNN/problems.
+
+To make similar bugs easier to spot in the future,
+I added error message if we did get an error.
+
+Signed-off-by: Denys Vlasenko <dvlasenk at redhat.com>
+Signed-off-by: Martin Milata <mmilata at redhat.com>
+---
+ src/plugins/reporter-rhtsupport.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
+index fe13423..2eb41b4 100644
+--- a/src/plugins/reporter-rhtsupport.c
++++ b/src/plugins/reporter-rhtsupport.c
+@@ -261,6 +261,8 @@ int main(int argc, char **argv)
+     );
+     free_map_string(settings);
+ 
++    char *base_api_url = xstrdup(url);
++
+     if (opts & OPT_t)
+     {
+         if (!case_no)
+@@ -386,7 +388,7 @@ int main(int argc, char **argv)
+     {
+         /* Check for hints and show them if we have something */
+         log(_("Checking for hints"));
+-        result = get_rhts_hints(url,
++        result = get_rhts_hints(base_api_url,
+                 login,
+                 password,
+                 ssl_verify,
+@@ -409,6 +411,16 @@ int main(int argc, char **argv)
+         "</problems>"
+         );
+ #endif
++        if (result->error)
++        {
++            /* We don't use result->msg here because it looks like this:
++             *  Error in file upload at 'URL', HTTP code: 404,
++             *  server says: '<?xml...?><error...><code>404</code><message>...</message></error>'
++             * TODO: make server send bare textual msgs, not XML.
++             */
++            error_msg("Error in file upload at '%s', HTTP code: %d",
++                    base_api_url, result->http_resp_code);
++        }
+         if (result->error == 0 && result->body)
+         {
+             /* The message might contain URLs to known solutions and such */
+@@ -559,6 +571,7 @@ int main(int argc, char **argv)
+     free_rhts_result(result_atch);
+     free_rhts_result(result);
+ 
++    free(base_api_url);
+     free(url);
+     free(login);
+     free(password);
+-- 
+1.8.1.4
+
diff --git a/0002-curl-upload-helper-upload-data-with-application-octe.patch b/0002-curl-upload-helper-upload-data-with-application-octe.patch
new file mode 100644
index 0000000..fd9ecaa
--- /dev/null
+++ b/0002-curl-upload-helper-upload-data-with-application-octe.patch
@@ -0,0 +1,30 @@
+From 959b84a852789064f297bc522a12348e97898f41 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <dvlasenk at redhat.com>
+Date: Fri, 29 Mar 2013 16:00:43 +0100
+Subject: [LIBREPORT PATCH 2/5] curl upload helper: upload data with
+ "application/octet-stream" content type
+
+This fixes a forgotten bit of code where "???" was 'temporarily'
+used instead of correct content type.
+
+Signed-off-by: Denys Vlasenko <dvlasenk at redhat.com>
+---
+ src/lib/curl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/curl.c b/src/lib/curl.c
+index baf6902..d97e4db 100644
+--- a/src/lib/curl.c
++++ b/src/lib/curl.c
+@@ -600,7 +600,7 @@ char *upload_file(const char *url, const char *filename)
+     post_state_t *state = new_post_state(POST_WANT_ERROR_MSG);
+     post(state,
+                 whole_url,
+-                /*content_type:*/ "???",
++                /*content_type:*/ "application/octet-stream",
+                 /*additional_headers:*/ NULL,
+                 /*data:*/ filename,
+                 POST_DATA_FROMFILE_PUT
+-- 
+1.8.1.4
+
diff --git a/0003-report-gtk-show-Next-Step-btn-at-workflow-start.patch b/0003-report-gtk-show-Next-Step-btn-at-workflow-start.patch
new file mode 100644
index 0000000..c22778c
--- /dev/null
+++ b/0003-report-gtk-show-Next-Step-btn-at-workflow-start.patch
@@ -0,0 +1,34 @@
+From cb4369636011ca5824d8285d09fe568451e80761 Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Tue, 2 Apr 2013 11:10:26 +0200
+Subject: [LIBREPORT PATCH 3/5] report-gtk: show Next Step btn at workflow
+ start
+
+Closes rhbz#926916
+
+Signed-off-by: Jakub Filak <jfilak at redhat.com>
+Signed-off-by: Jiri Moskovcak <jmoskovc at redhat.com>
+---
+ src/gui-wizard-gtk/wizard.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
+index 1db97b2..b55b975 100644
+--- a/src/gui-wizard-gtk/wizard.c
++++ b/src/gui-wizard-gtk/wizard.c
+@@ -2509,6 +2509,12 @@ static void set_auto_event_chain(GtkButton *button, gpointer user_data)
+         on_page_prepare(g_assistant, gtk_notebook_get_nth_page(g_assistant, next_page_no), NULL);
+     else
+         gtk_notebook_set_current_page(g_assistant, next_page_no);
++
++    /* Show Next Step button which was hidden on Selector page in non-expert
++     * mode. Next Step button must be hidden because Selector page shows only
++     * workflow buttons in non-expert mode.
++     */
++    show_next_step_button();
+ }
+ 
+ static void add_workflow_buttons(GtkBox *box, GHashTable *workflows, GCallback func)
+-- 
+1.8.1.4
+
diff --git a/0004-fixed-reporting-from-bugzilla-rhbz-926916.patch b/0004-fixed-reporting-from-bugzilla-rhbz-926916.patch
new file mode 100644
index 0000000..079e241
--- /dev/null
+++ b/0004-fixed-reporting-from-bugzilla-rhbz-926916.patch
@@ -0,0 +1,61 @@
+From f9b8f72eb840211b7dd197a8abcc00b9bdf9c0ff Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Thu, 4 Apr 2013 18:48:01 +0200
+Subject: [LIBREPORT PATCH 4/5] fixed reporting from bugzilla rhbz#926916
+
+---
+ src/plugins/Makefile.am                      | 3 ++-
+ src/plugins/bugzilla_anaconda_event.conf     | 3 +++
+ src/workflows/anaconda_event.conf            | 4 ++--
+ src/workflows/workflow_AnacondaFedora.xml.in | 2 --
+ 4 files changed, 7 insertions(+), 5 deletions(-)
+ create mode 100644 src/plugins/bugzilla_anaconda_event.conf
+
+diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
+index 7ffb894..79fe9d2 100644
+--- a/src/plugins/Makefile.am
++++ b/src/plugins/Makefile.am
+@@ -65,7 +65,8 @@ dist_eventsconf_DATA = \
+     bugzilla_event.conf \
+     rhtsupport_event.conf \
+     uploader_event.conf \
+-    emergencyanalysis_event.conf
++    emergencyanalysis_event.conf \
++    bugzilla_anaconda_event.conf
+ 
+ reporters_extra_dist =
+ if BUILD_BUGZILLA
+diff --git a/src/plugins/bugzilla_anaconda_event.conf b/src/plugins/bugzilla_anaconda_event.conf
+new file mode 100644
+index 0000000..6d888e4
+--- /dev/null
++++ b/src/plugins/bugzilla_anaconda_event.conf
+@@ -0,0 +1,3 @@
++EVENT=report_Bugzilla component=anaconda
++	reporter-bugzilla -b \
++		-F /etc/libreport/plugins/bugzilla_format_libreport.conf
+diff --git a/src/workflows/anaconda_event.conf b/src/workflows/anaconda_event.conf
+index f71aebd..f369acd 100644
+--- a/src/workflows/anaconda_event.conf
++++ b/src/workflows/anaconda_event.conf
+@@ -1,2 +1,2 @@
+-EVENT=workflow_AnacondaFedora type=anaconda
+-EVENT=workflow_AnacondaUpload type=anaconda
++EVENT=workflow_AnacondaFedora component=anaconda
++EVENT=workflow_AnacondaUpload component=anaconda
+diff --git a/src/workflows/workflow_AnacondaFedora.xml.in b/src/workflows/workflow_AnacondaFedora.xml.in
+index 5c8c2a7..6322d9a 100644
+--- a/src/workflows/workflow_AnacondaFedora.xml.in
++++ b/src/workflows/workflow_AnacondaFedora.xml.in
+@@ -4,8 +4,6 @@
+     <_description>Process the report using the Fedora infrastructure</_description>
+ 
+     <events>
+-        <event>report_uReport</event>
+         <event>report_Bugzilla</event>
+-        <event>post_report</event>
+     </events>
+ </workflow>
+-- 
+1.8.1.4
+
diff --git a/libreport.spec b/libreport.spec
index 12c4bd9..e77ba3d 100644
--- a/libreport.spec
+++ b/libreport.spec
@@ -5,7 +5,7 @@
 Summary: Generic library for reporting various problems
 Name: libreport
 Version: 2.1.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 Group: System Environment/Libraries
 URL: https://fedorahosted.org/abrt/
@@ -30,6 +30,10 @@ BuildRequires: newt-devel
 BuildRequires: libproxy-devel
 BuildRequires: btparser-devel
 BuildRequires: doxygen
+Patch0: 0001-reporter-rhtsupport-fix-hint-query-to-use-correct-UR.patch
+Patch1: 0002-curl-upload-helper-upload-data-with-application-octe.patch
+Patch2: 0003-report-gtk-show-Next-Step-btn-at-workflow-start.patch
+Patch3: 0004-fixed-reporting-from-bugzilla-rhbz-926916.patch
 Requires: libreport-filesystem
 # required for update from old report library, otherwise we obsolete report-gtk
 # and all it's plugins, but don't provide the python bindings and the sealert
@@ -263,6 +267,10 @@ infrastructure or uploading the gathered data over ftp/scp...
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 autoconf
@@ -471,6 +479,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Thu Apr  4 2013 Jiri Moskovcak <jmoskovc at redhat.com> 2.1.3-2
+- fixed reporting from anaconda
+- Resolves: #926916
+
 * Wed Mar 27 2013 Jakub Filak <jfilak at redhat.com> 2.1.3-1
 - rhbz: get id of duplicate from correct field
 - change the "exited with" message with something less technical closes #143


More information about the scm-commits mailing list