diff --git a/0019-bugzilla-change-the-default-bugzilla-group.patch b/0001-Change-the-default-Bugzilla-group.patch similarity index 77% rename from 0019-bugzilla-change-the-default-bugzilla-group.patch rename to 0001-Change-the-default-Bugzilla-group.patch index be71252ecf8b3acf8e52bb50de6c62785eb3e63a..8f263d6a05f53dcf4faa3b23f69855424c3c34e2 100644 --- a/0019-bugzilla-change-the-default-bugzilla-group.patch +++ b/0001-Change-the-default-Bugzilla-group.patch @@ -1,24 +1,19 @@ -From 1aa9e3a987439fd4435b40b9c7f56d063097f980 Mon Sep 17 00:00:00 2001 -From: Martin Kutlak -Date: Thu, 3 Jan 2019 16:32:00 +0100 -Subject: [PATCH] bugzilla: change the default bugzilla group +From 3389fbeb5cf00fd515049a6a9db3c5cc4ca383a0 Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Thu, 26 Aug 2021 19:20:52 +0200 +Subject: [PATCH] Change the default Bugzilla group -Changes the default bugzilla group to redhat and also makes the -reported bugs private by default. - -Related to rhbz#1660449 - -Signed-off-by: Martin Kutlak +Signed-off-by: Michal Srb --- configure.ac | 6 +++--- src/plugins/bugzilla.conf | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac -index feafc28e..ce453895 100644 +index fa97fa78..aa383083 100644 --- a/configure.ac +++ b/configure.ac -@@ -92,14 +92,14 @@ AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no]) +@@ -98,14 +98,14 @@ AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no]) AC_ARG_WITH([redhatbugzillacreateprivate], AS_HELP_STRING([--with-redhatbugzillacreateprivate="yes/no"], [Whether the Red Hat Bugzilla plugin should open @@ -49,5 +44,5 @@ index a7727392..dbbbd05c 100644 +# CreatePrivate = yes +# PrivateGroups = redhat -- -2.21.0 +2.31.1 diff --git a/0001-ureport-use-python3-to-get-consumerCertDir.patch b/0001-ureport-use-python3-to-get-consumerCertDir.patch deleted file mode 100644 index 1bf85ecff76d4935b742fc1b09a3c6cc7f3aa36e..0000000000000000000000000000000000000000 --- a/0001-ureport-use-python3-to-get-consumerCertDir.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8c00a86dddaf240d4a836a5e278190bcc51b0b66 Mon Sep 17 00:00:00 2001 -From: Matej Habrnal -Date: Mon, 18 Jun 2018 14:51:23 +0200 -Subject: [PATCH] ureport: use python3 to get consumerCertDir - -Related to #1592073 - -Signed-off-by: Matej Habrnal ---- - src/lib/ureport.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/lib/ureport.c b/src/lib/ureport.c -index c32c948a..d2045f0f 100644 ---- a/src/lib/ureport.c -+++ b/src/lib/ureport.c -@@ -81,9 +81,9 @@ rhsm_config_get_consumer_cert_dir(void) - return xstrdup(result); - - result = run_in_shell_and_save_output(0, -- "python -c \"from rhsm.config import initConfig; print(initConfig().get('rhsm', 'consumerCertDir'))\"", -+ "python3 -c \"from rhsm.config import initConfig; print(initConfig().get('rhsm', 'consumerCertDir'))\"", - NULL, NULL); - - /* run_in_shell_and_save_output always returns non-NULL */ - if (result[0] != '/') - goto error; --- -2.17.0 - diff --git a/0002-Remove-option-to-screencast-problems.patch b/0002-Remove-option-to-screencast-problems.patch deleted file mode 100644 index e1a7be4153ad769d52116b5f04dcecadc2de355d..0000000000000000000000000000000000000000 --- a/0002-Remove-option-to-screencast-problems.patch +++ /dev/null @@ -1,177 +0,0 @@ -From 602124e481d700e334de20418b94b2fdf015c834 Mon Sep 17 00:00:00 2001 -From: Martin Kutlak -Date: Mon, 9 Jul 2018 10:45:37 +0200 -Subject: [PATCH] Remove option to screencast problems - -The fros package is broken and hasn't been maintained for quite some time. - -closes #104 - -Signed-off-by: Martin Kutlak ---- - libreport.spec.in | 1 - - src/gui-wizard-gtk/wizard.c | 75 --------------------------------- - src/gui-wizard-gtk/wizard.glade | 40 ------------------ - 3 files changed, 116 deletions(-) - -diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c -index b02bc7de..ea49a2ea 100644 ---- a/src/gui-wizard-gtk/wizard.c -+++ b/src/gui-wizard-gtk/wizard.c -@@ -127,7 +127,6 @@ static gboolean g_warning_issued; - static GtkSpinner *g_spinner_event_log; - static GtkImage *g_img_process_fail; - --static GtkButton *g_btn_startcast; - static GtkExpander *g_exp_report_log; - - static GtkWidget *g_top_most_window; -@@ -3487,7 +3486,6 @@ static void add_pages(void) - g_exp_search = GTK_EXPANDER( gtk_builder_get_object(g_builder, "expander_search")); - g_spinner_event_log = GTK_SPINNER( gtk_builder_get_object(g_builder, "spinner_event_log")); - g_img_process_fail = GTK_IMAGE( gtk_builder_get_object(g_builder, "img_process_fail")); -- g_btn_startcast = GTK_BUTTON( gtk_builder_get_object(g_builder, "btn_startcast")); - g_exp_report_log = GTK_EXPANDER( gtk_builder_get_object(g_builder, "expand_report")); - g_vb_simple_details = GTK_BOX( gtk_builder_get_object(g_builder, "vb_simple_details")); - g_cmb_reproducible = GTK_COMBO_BOX_TEXT(gtk_builder_get_object(g_builder, "cmb_reproducible")); -@@ -3618,59 +3616,6 @@ static void assistant_quit_cb(void *obj, void *data) - g_wnd_assistant = (void *)0xdeadbeaf; - } - --static void on_btn_startcast(GtkWidget *btn, gpointer user_data) --{ -- const char *args[15]; -- args[0] = (char *) "fros"; -- args[1] = NULL; -- -- pid_t castapp = 0; -- castapp = fork_execv_on_steroids( -- EXECFLG_QUIET, -- (char **)args, -- NULL, -- /*env_vec:*/ NULL, -- g_dump_dir_name, -- /*uid (ignored):*/ 0 -- ); -- gtk_widget_hide(GTK_WIDGET(g_wnd_assistant)); -- /*flush all gui events before we start waitpid -- * otherwise the main window wouldn't hide -- */ -- while (gtk_events_pending()) -- gtk_main_iteration_do(false); -- -- int status; -- safe_waitpid(castapp, &status, 0); -- problem_data_reload_from_dump_dir(); -- update_gui_state_from_problem_data(0 /* don't update the selected event */); -- gtk_widget_show(GTK_WIDGET(g_wnd_assistant)); --} -- --static bool is_screencast_available() --{ -- const char *args[3]; -- args[0] = (char *) "fros"; -- args[1] = "--is-available"; -- args[2] = NULL; -- -- pid_t castapp = 0; -- castapp = fork_execv_on_steroids( -- EXECFLG_QUIET, -- (char **)args, -- NULL, -- /*env_vec:*/ NULL, -- g_dump_dir_name, -- /*uid (ignored):*/ 0 -- ); -- -- int status; -- safe_waitpid(castapp, &status, 0); -- -- /* 0 means that it's available */ -- return status == 0; --} -- - void create_assistant(GtkApplication *app, bool expert_mode) - { - g_loaded_texts = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); -@@ -3805,26 +3750,6 @@ void create_assistant(GtkApplication *app, bool expert_mode) - g_signal_connect(g_btn_add_file, "clicked", G_CALLBACK(on_btn_add_file), NULL); - g_signal_connect(g_btn_detail, "clicked", G_CALLBACK(on_btn_detail), NULL); - -- if (is_screencast_available()) { -- /* we need to override the activate-link handler, because we use -- * the link button instead of normal button and if we wouldn't override it -- * gtk would try to run it's defualt action and open the associated URI -- * but since the URI is empty it would complain about it... -- */ -- g_signal_connect(g_btn_startcast, "activate-link", G_CALLBACK(on_btn_startcast), NULL); -- } -- else { -- gtk_widget_set_sensitive(GTK_WIDGET(g_btn_startcast), false); -- gtk_widget_set_tooltip_markup(GTK_WIDGET(g_btn_startcast), -- _("In order to enable the built-in screencasting " -- "functionality the package fros-recordmydesktop has to be installed. " -- "Please run the following command if you want to install it." -- "\n\n" -- "su -c \"dnf install fros-recordmydesktop\"" -- )); -- } -- -- - g_signal_connect(g_search_entry_bt, "changed", G_CALLBACK(search_timeout), NULL); - - g_signal_connect (g_tv_event_log, "key-press-event", G_CALLBACK (key_press_event), NULL); -diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade -index 47713370..f0bd2a77 100644 ---- a/src/gui-wizard-gtk/wizard.glade -+++ b/src/gui-wizard-gtk/wizard.glade -@@ -506,46 +506,6 @@ - 4 - - -- -- -- True -- False -- -- -- True -- False -- end -- If you don't know how to describe it, you can -- -- -- False -- False -- 0 -- -- -- -- -- add a screencast -- True -- True -- True -- True -- start -- none -- -- -- False -- True -- 1 -- -- -- -- -- False -- True -- 5 -- -- - - - --- -2.17.1 - diff --git a/0002-rhbz-Be-a-little-bit-more-defensive-when-working-wit.patch b/0002-rhbz-Be-a-little-bit-more-defensive-when-working-wit.patch new file mode 100644 index 0000000000000000000000000000000000000000..a218eaa3a9b2b49f905ace6636d36b4e5e5ced25 --- /dev/null +++ b/0002-rhbz-Be-a-little-bit-more-defensive-when-working-wit.patch @@ -0,0 +1,48 @@ +From 50fdc7f23f35744ffff1763fe2d804b18c1c5340 Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Tue, 7 Sep 2021 14:40:21 +0200 +Subject: [PATCH] [rhbz] Be a little bit more defensive when working with + subcomponents + +Components in RHEL can have "subcomponents" in Bugzilla. Some of them +have, some of them don't. Better be careful. + +See: rhbz#1998435 + +Signed-off-by: Michal Srb +--- + src/plugins/rhbz.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c +index c2855a70..0dae1e93 100644 +--- a/src/plugins/rhbz.c ++++ b/src/plugins/rhbz.c +@@ -1036,13 +1036,17 @@ char *rhbz_get_default_sub_component(const char *component, xmlrpc_value *sub_co + } + else + { +- xmlrpc_array_read_item(&env, sub_components, sc_array_size - 1, &sc_struct); +- xmlrpc_struct_find_value(&env, sc_struct, "name", &sc_name); +- xmlrpc_read_string(&env, sc_name, &sc_str_name); +- if (sc_struct) +- xmlrpc_DECREF(sc_struct); +- if (sc_name) +- xmlrpc_DECREF(sc_name); ++ if (sc_array_size) { ++ xmlrpc_array_read_item(&env, sub_components, sc_array_size - 1, &sc_struct); ++ if (xmlrpc_struct_has_key(&env, sc_struct, "name")) { ++ xmlrpc_struct_find_value(&env, sc_struct, "name", &sc_name); ++ xmlrpc_read_string(&env, sc_name, &sc_str_name); ++ } ++ if (sc_struct) ++ xmlrpc_DECREF(sc_struct); ++ if (sc_name) ++ xmlrpc_DECREF(sc_name); ++ } + } + + return (char *)sc_str_name; +-- +2.31.1 + diff --git a/0003-offer-reporting-to-Bugzilla-only-for-pre-GA-Anaconda.patch b/0003-offer-reporting-to-Bugzilla-only-for-pre-GA-Anaconda.patch deleted file mode 100644 index 45575d47c6e4195fc0b491481ae68171e364f59c..0000000000000000000000000000000000000000 --- a/0003-offer-reporting-to-Bugzilla-only-for-pre-GA-Anaconda.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 1fa88becd8b9a3f1aece0d009171c31ee6d379c6 Mon Sep 17 00:00:00 2001 -From: Jakub Filak -Date: Wed, 12 Feb 2014 11:22:33 +0100 -Subject: [PATCH] offer reporting to Bugzilla only for pre-GA Anaconda - exceptions - -Closes rhbz#1593734 - -Signed-off-by: Jakub Filak ---- - src/workflows/anaconda_event.conf | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/workflows/anaconda_event.conf b/src/workflows/anaconda_event.conf -index f9ade8e2..e894a53f 100644 ---- a/src/workflows/anaconda_event.conf -+++ b/src/workflows/anaconda_event.conf -@@ -1,4 +1,4 @@ - EVENT=workflow_AnacondaFedora component=anaconda - EVENT=workflow_AnacondaRHEL component=anaconda --EVENT=workflow_AnacondaRHELBugzilla component=anaconda -+EVENT=workflow_AnacondaRHELBugzilla component=anaconda release_type=pre-release - EVENT=workflow_AnacondaUpload component=anaconda --- -2.17.1 - diff --git a/0003-rhbz-Retry-XML-RPC-calls-when-uploading-attachments.patch b/0003-rhbz-Retry-XML-RPC-calls-when-uploading-attachments.patch new file mode 100644 index 0000000000000000000000000000000000000000..5539c036e043fb8484db553b3abf9e5ff928eee0 --- /dev/null +++ b/0003-rhbz-Retry-XML-RPC-calls-when-uploading-attachments.patch @@ -0,0 +1,113 @@ +From 28a6267c056d43cdbf8cd3e10e69d8ab113e74f8 Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Tue, 7 Sep 2021 21:31:21 +0200 +Subject: [PATCH] [rhbz] Retry XML-RPC calls when uploading attachments + +If there is a bot that automatically modifies newly opened bugs, then +it can lead to "query serialization error" from Bugzilla. Retry should +help us here. + +Signed-off-by: Michal Srb +--- + src/lib/abrt_xmlrpc.c | 34 ++++++++++++++++++++++++++++++++++ + src/lib/abrt_xmlrpc.h | 5 +++++ + src/lib/libreport-web.sym | 1 + + src/plugins/rhbz.c | 4 +++- + 4 files changed, 43 insertions(+), 1 deletion(-) + +diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c +index 7cac9253..4c3b469a 100644 +--- a/src/lib/abrt_xmlrpc.c ++++ b/src/lib/abrt_xmlrpc.c +@@ -16,6 +16,7 @@ + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ ++#include + #include "internal_libreport.h" + #include "abrt_xmlrpc.h" + #include "proxies.h" +@@ -301,3 +302,36 @@ xmlrpc_value *abrt_xmlrpc_call(struct abrt_xmlrpc *ax, + + return result; + } ++ ++/* die eventually or return expected results; retry up to 5 times if the error is known */ ++xmlrpc_value *abrt_xmlrpc_call_with_retry(const char *fault_substring, ++ struct abrt_xmlrpc *ax, ++ const char *method, ++ const char *format, ...) ++{ ++ int retry_counter = 0; ++ xmlrpc_env env; ++ ++ va_list args; ++ ++ do { ++ // sleep, if this is not the first try; ++ // sleep() can be interrupted, but that's not a big deal here ++ if (retry_counter) ++ sleep(retry_counter); ++ ++ va_start(args, format); ++ xmlrpc_value *result = abrt_xmlrpc_call_full_va(&env, ax, method, format, args); ++ va_end(args); ++ ++ if (!env.fault_occurred) ++ return result; // success! ++ ++ if (env.fault_string && !strstr(env.fault_string, fault_substring)) { ++ // unknown error, don't bother retrying... ++ abrt_xmlrpc_die(&env); ++ } ++ } while (++retry_counter <= 5); ++ ++ abrt_xmlrpc_die(&env); ++} +diff --git a/src/lib/abrt_xmlrpc.h b/src/lib/abrt_xmlrpc.h +index 31768ffc..8ddcfc54 100644 +--- a/src/lib/abrt_xmlrpc.h ++++ b/src/lib/abrt_xmlrpc.h +@@ -63,6 +63,11 @@ xmlrpc_value *abrt_xmlrpc_call_params(xmlrpc_env *env, struct abrt_xmlrpc *ax, + xmlrpc_value *abrt_xmlrpc_call_full(xmlrpc_env *enf, struct abrt_xmlrpc *ax, + const char *method, const char *format, ...); + ++xmlrpc_value *abrt_xmlrpc_call_with_retry(const char *fault_substring, ++ struct abrt_xmlrpc *ax, ++ const char *method, ++ const char *format, ...); ++ + #ifdef __cplusplus + } + #endif +diff --git a/src/lib/libreport-web.sym b/src/lib/libreport-web.sym +index 44f5244d..9ab88d3e 100644 +--- a/src/lib/libreport-web.sym ++++ b/src/lib/libreport-web.sym +@@ -51,6 +51,7 @@ global: + abrt_xmlrpc_call; + abrt_xmlrpc_call_params; + abrt_xmlrpc_call_full; ++ abrt_xmlrpc_call_with_retry; + + /* internal_libreport.h - these symbols are only to be used by libreport developers */ + libreport_trim_all_whitespace; +diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c +index 0dae1e93..f252f914 100644 +--- a/src/plugins/rhbz.c ++++ b/src/plugins/rhbz.c +@@ -643,8 +643,10 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *bug_id, + * i -> integer, single argument (int value) + * 6 -> base64, two arguments (char* plain data which will be encoded by xmlrpc-c to base64, + * size_t number of bytes to encode) ++ * ++ * Retry if another user/bot attempted to change the same data. + */ +- result = abrt_xmlrpc_call(ax, "Bug.add_attachment", "{s:(s),s:s,s:s,s:s,s:6,s:i}", ++ result = abrt_xmlrpc_call_with_retry("query serialization error", ax, "Bug.add_attachment", "{s:(s),s:s,s:s,s:s,s:6,s:i}", + "ids", bug_id, + "summary", fn, + "file_name", filename, +-- +2.31.1 + diff --git a/0004-replace-all-Fedora-URLs-by-corresponding-values-for-.patch b/0004-replace-all-Fedora-URLs-by-corresponding-values-for-.patch deleted file mode 100644 index 1cccb95dc2f23504d26af639293eb2dae42fb2f6..0000000000000000000000000000000000000000 --- a/0004-replace-all-Fedora-URLs-by-corresponding-values-for-.patch +++ /dev/null @@ -1,66 +0,0 @@ -From dfc340b695d047018d38090e24a501f7b0c0dad1 Mon Sep 17 00:00:00 2001 -From: Matej Habrnal -Date: Tue, 28 Aug 2018 15:42:33 +0200 -Subject: [PATCH] replace all Fedora URLs by corresponding values for RHEL - -Signed-off-by: Matej Habrnal ---- - src/plugins/report_EmergencyAnalysis.xml.in | 2 +- - src/plugins/report_uReport.xml.in | 2 +- - src/plugins/reporter-ureport.c | 2 +- - src/plugins/ureport.conf | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/plugins/report_EmergencyAnalysis.xml.in b/src/plugins/report_EmergencyAnalysis.xml.in -index 3fb2bd23..c00a734f 100644 ---- a/src/plugins/report_EmergencyAnalysis.xml.in -+++ b/src/plugins/report_EmergencyAnalysis.xml.in -@@ -15,7 +15,7 @@ - - - - - -- -