Update patch

i8
Arkady L. Shane 1 year ago
parent 37a72508aa
commit 23b5f24503
Signed by: tigro
GPG Key ID: 1EC08A25C9DB2503

@ -1,18 +1,50 @@
From 202caba7132aeb5b6b088623818582e7065717be Mon Sep 17 00:00:00 2001
From 0f482bb018c1d272185b65791e85cde356a8bdc6 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Wed, 20 Dec 2023 20:06:20 +0300
Subject: [PATCH] MSVSphere plugin initial implementation
---
doc/Makefile.am | 5 ++++-
po/POTFILES.in | 10 ++++++++++
src/plugins/Makefile.am | 12 ++++++++----
src/plugins/mantisbt.c | 4 ++--
src/plugins/reporter-mantisbt.c | 4 ++--
src/plugins/reporter-ureport.c | 2 +-
src/plugins/ureport.conf | 2 +-
src/workflows/Makefile.am | 25 ++++++++++++++++++++++---
8 files changed, 50 insertions(+), 14 deletions(-)
doc/Makefile.am | 5 +-
doc/msvsphere_report_event.conf.5 | 1 +
doc/report_MSVSphereBugTracker.conf.txt | 45 +++++++++++++
doc/report_msvsphere.conf.txt | 41 ++++++++++++
po/POTFILES.in | 10 +++
src/plugins/Makefile.am | 12 ++--
src/plugins/mantisbt.c | 4 +-
src/plugins/msvsphere_report_event.conf | 38 +++++++++++
src/plugins/report_MSVSphereBugTracker.conf | 4 ++
src/plugins/report_MSVSphereBugTracker.xml.in | 66 +++++++++++++++++++
src/plugins/reporter-mantisbt.c | 4 +-
src/plugins/reporter-ureport.c | 2 +-
src/plugins/ureport.conf | 2 +-
src/workflows/Makefile.am | 25 ++++++-
src/workflows/report_msvsphere.conf | 31 +++++++++
src/workflows/workflow_MSVSphereCCpp.xml.in | 12 ++++
src/workflows/workflow_MSVSphereJava.xml.in | 11 ++++
.../workflow_MSVSphereJavaScript.xml.in | 11 ++++
.../workflow_MSVSphereKerneloops.xml.in | 11 ++++
.../workflow_MSVSphereLibreport.xml.in | 9 +++
src/workflows/workflow_MSVSpherePython.xml.in | 11 ++++
.../workflow_MSVSpherePython3.xml.in | 11 ++++
src/workflows/workflow_MSVSphereVmcore.xml.in | 12 ++++
src/workflows/workflow_MSVSphereXorg.xml.in | 9 +++
24 files changed, 373 insertions(+), 14 deletions(-)
create mode 100644 doc/msvsphere_report_event.conf.5
create mode 100644 doc/report_MSVSphereBugTracker.conf.txt
create mode 100644 doc/report_msvsphere.conf.txt
create mode 100644 src/plugins/msvsphere_report_event.conf
create mode 100644 src/plugins/report_MSVSphereBugTracker.conf
create mode 100644 src/plugins/report_MSVSphereBugTracker.xml.in
create mode 100644 src/workflows/report_msvsphere.conf
create mode 100644 src/workflows/workflow_MSVSphereCCpp.xml.in
create mode 100644 src/workflows/workflow_MSVSphereJava.xml.in
create mode 100644 src/workflows/workflow_MSVSphereJavaScript.xml.in
create mode 100644 src/workflows/workflow_MSVSphereKerneloops.xml.in
create mode 100644 src/workflows/workflow_MSVSphereLibreport.xml.in
create mode 100644 src/workflows/workflow_MSVSpherePython.xml.in
create mode 100644 src/workflows/workflow_MSVSpherePython3.xml.in
create mode 100644 src/workflows/workflow_MSVSphereVmcore.xml.in
create mode 100644 src/workflows/workflow_MSVSphereXorg.xml.in
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 837036b..6fb4b7a 100644
@ -44,6 +76,111 @@ index 837036b..6fb4b7a 100644
# Manual pages are generated from .txt via Docbook
man1_MANS = ${MAN1_TXT:%.txt=%.1}
diff --git a/doc/msvsphere_report_event.conf.5 b/doc/msvsphere_report_event.conf.5
new file mode 100644
index 0000000..71c3fcb
--- /dev/null
+++ b/doc/msvsphere_report_event.conf.5
@@ -0,0 +1 @@
+.so man5/report_event.conf.5
diff --git a/doc/report_MSVSphereBugTracker.conf.txt b/doc/report_MSVSphereBugTracker.conf.txt
new file mode 100644
index 0000000..ddd5bc4
--- /dev/null
+++ b/doc/report_MSVSphereBugTracker.conf.txt
@@ -0,0 +1,45 @@
+report_MSVSphereBugTracker.conf(5)
+==================================
+
+NAME
+----
+report_MSVSphereBugTracker.conf - libreport's configuration file for 'report_MSVSphereBugTracker' events.
+
+DESCRIPTION
+-----------
+This configuration file contains values for options defined in
+/usr/share/libreport/events/report_MSVSphereBugTracker.xml
+
+Configuration file lines should have 'PARAM = VALUE' format. The parameters are:
+
+'Mantisbt_Login'::
+ Login to MantisBT account.
+
+'Mantisbt_Password'::
+ Password to MantisBT account.
+
+'Mantisbt_MantisbtURL'::
+ MantisBT HTTP(S) address. (default: https://bugs.msvsphere-os.ru)
+
+'Mantisbt_SSLVerify'::
+ Use yes/true/on/1 to verify server's SSL certificate. (default: yes)
+
+'Mantisbt_Project'::
+ Project issue field value. Useful if you needed different project than specified in /etc/os-release
+
+'Mantisbt_ProjectVersion'::
+ Version issue field value. Useful if you needed different project version than specified in /etc/os-release
+
+'http_proxy'::
+ the proxy server to use for HTTP
+
+'HTTPS_PROXY'::
+ the proxy server to use for HTTPS
+
+SEE ALSO
+--------
+report_event.conf(5), reporter-mantisbt(1)
+
+AUTHOR
+------
+* MSVSphere Packaging Team
diff --git a/doc/report_msvsphere.conf.txt b/doc/report_msvsphere.conf.txt
new file mode 100644
index 0000000..90259d4
--- /dev/null
+++ b/doc/report_msvsphere.conf.txt
@@ -0,0 +1,41 @@
+report_msvsphere.conf(5)
+========================
+
+NAME
+----
+report_msvsphere.conf - configuration file for libreport.
+
+DESCRIPTION
+-----------
+This configuration file specifies which of the reporting work flow definitions
+are applicable for all problems types on MSVSphere.
+
+All applicable work flows are presented to users in User Interface as
+possibilities for processing of any problems. A particular work flow becomes
+applicable if its conditions are satisfied.
+
+This configuration file consists from one condition per line.
+
+Each condition line must start with EVENT=workflow_NAME where "workflow_" is
+constant prefix and "workflow_NAME" is base name of path to reporting work flow
+configuration file.
+
+The rest of condition line has form VAR=VAL, VAR!=VAL or VAL~=REGEX, where VAR
+is a name of problem directory element to be checked (for example,
+"executable", "package", hostname" etc). The condition may consists
+from as many element checks as it is necessary.
+
+EXAMPLES
+--------
+Condition line::
+ EVENT=workflow_MSVSphereCCpp analyzer=CCpp
+
+The condition line above expects existence of /usr/share/libreport/workflows/workflow_MSVSphereCCpp.xml
+
+SEE ALSO
+--------
+report-gtk(1)
+
+AUTHOR
+------
+* MSVSphere Packaging Team
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fc740ff..70fc837 100644
--- a/po/POTFILES.in
@ -132,6 +269,132 @@ index 1750dc5..92804d4 100644
soap_request_add_method_parameter(req, "page_number", SOAP_INTEGER, "1");
soap_request_add_method_parameter(req, "per_page", SOAP_INTEGER, /* -1 means get all issues */ "-1");
diff --git a/src/plugins/msvsphere_report_event.conf b/src/plugins/msvsphere_report_event.conf
new file mode 100644
index 0000000..da36775
--- /dev/null
+++ b/src/plugins/msvsphere_report_event.conf
@@ -0,0 +1,38 @@
+EVENT=report_MSVSphereBugTracker type=xorg
+ reporter-mantisbt
+
+EVENT=report_MSVSphereBugTracker type=Kerneloops
+ reporter-mantisbt
+
+EVENT=report_MSVSphereBugTracker type=vmcore
+ reporter-mantisbt
+
+EVENT=report_MSVSphereBugTracker type=Python component!=anaconda
+ test -f component || abrt-action-save-package-data
+ reporter-mantisbt \
+ -F /etc/libreport/plugins/mantisbt_format.conf \
+ -A /etc/libreport/plugins/mantisbt_formatdup.conf
+
+EVENT=report_MSVSphereBugTracker type=Python3 component!=anaconda
+ test -f component || abrt-action-save-package-data
+ reporter-mantisbt \
+ -F /etc/libreport/plugins/mantisbt_format.conf \
+ -A /etc/libreport/plugins/mantisbt_formatdup.conf
+
+EVENT=report_MSVSphereBugTracker type=CCpp duphash!=
+ test -f component || abrt-action-save-package-data
+ component="`cat component`"
+ format="mantisbt_format.conf"
+ test -f "/etc/libreport/plugins/mantisbt_format_$component.conf" \
+ && format="mantisbt_format_$component.conf"
+ formatdup="mantisbt_formatdup.conf"
+ test -f "/etc/libreport/plugins/mantisbt_formatdup_$component.conf" \
+ && formatdup="mantisbt_formatdup_$component.conf"
+ reporter-mantisbt \
+ -F "/etc/libreport/plugins/$format" \
+ -A "/etc/libreport/plugins/$formatdup"
+
+EVENT=report_MSVSphereBugTracker analyzer=libreport
+ reporter-mantisbt \
+ -F /etc/libreport/plugins/mantisbt_format_analyzer_libreport.conf \
+ -A /etc/libreport/plugins/mantisbt_formatdup_analyzer_libreport.conf
diff --git a/src/plugins/report_MSVSphereBugTracker.conf b/src/plugins/report_MSVSphereBugTracker.conf
new file mode 100644
index 0000000..25391d1
--- /dev/null
+++ b/src/plugins/report_MSVSphereBugTracker.conf
@@ -0,0 +1,4 @@
+Mantisbt_MantisbtURL = https://bugs.msvsphere-os.ru
+Mantisbt_Login =
+Mantisbt_Password =
+Mantisbt_SSLVerify = yes
diff --git a/src/plugins/report_MSVSphereBugTracker.xml.in b/src/plugins/report_MSVSphereBugTracker.xml.in
new file mode 100644
index 0000000..71706fd
--- /dev/null
+++ b/src/plugins/report_MSVSphereBugTracker.xml.in
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<event>
+ <_name>MSVSphere Bug Tracker</_name>
+ <_description>Report to MSVSphere Bug Tracker</_description>
+
+ <requires-items>component,duphash,os_release</requires-items>
+ <exclude-items-by-default>coredump,count,event_log,reported_to,vmcore</exclude-items-by-default>
+ <exclude-items-always></exclude-items-always>
+ <exclude-binary-items>no</exclude-binary-items>
+ <include-items-by-default></include-items-by-default>
+ <minimal-rating>3</minimal-rating>
+ <gui-review-elements>yes</gui-review-elements>
+ <support-restricted-access optionname="Mantisbt_CreatePrivate">yes</support-restricted-access>
+
+ <options>
+ <option type="text" name="Mantisbt_Login">
+ <_label>User name</_label>
+ <allow-empty>no</allow-empty>
+ <_description>MSVSphere Bug Tracker account user name</_description>
+ <_note-html>You can create bugs.msvsphere-os.ru account &lt;a href="https://bugs.msvsphere-os.ru/signup_page.php"&gt;here&lt;/a&gt;</_note-html>
+ </option>
+ <option type="password" name="Mantisbt_Password">
+ <_label>Password</_label>
+ <allow-empty>no</allow-empty>
+ <_description>MSVSphere Bug Tracker account password</_description>
+ </option>
+ <option type="bool" name="Mantisbt_CreatePrivate">
+ <_label>Restrict access</_label>
+ <_note-html>The issue will be accessible only to users with access to 'Private Issues'</_note-html>
+ <default-value>no</default-value>
+ </option>
+ <advanced-options>
+ <option type="text" name="Mantisbt_MantisbtURL">
+ <_label>MSVSphere Bug Tracker URL</_label>
+ <allow-empty>no</allow-empty>
+ <_note-html>Address of MSVSphere Bug Tracker server</_note-html>
+ <default-value>https://bugs.msvsphere-os.ru</default-value>
+ </option>
+ <option type="bool" name="Mantisbt_SSLVerify">
+ <_label>Verify SSL</_label>
+ <_note-html>Check SSL key validity</_note-html>
+ <default-value>yes</default-value>
+ </option>
+ <option type="text" name="Mantisbt_Project">
+ <_label>MSVSphere Bug Tracker project</_label>
+ <allow-empty>yes</allow-empty>
+ <_note-html>Specify this only if you needed different project than specified in /etc/os-release</_note-html>
+ </option>
+ <option type="text" name="Mantisbt_ProjectVersion">
+ <_label>MSVSphere Bug Tracker project version</_label>
+ <allow-empty>yes</allow-empty>
+ <_note-html>Specify this only if you needed different project version than specified in /etc/os-release</_note-html>
+ </option>
+ <option type="text" name="http_proxy">
+ <_label>HTTP Proxy</_label>
+ <allow-empty>yes</allow-empty>
+ <_note-html>Sets the proxy server to use for HTTP</_note-html>
+ </option>
+ <option type="text" name="HTTPS_PROXY">
+ <_label>HTTPS Proxy</_label>
+ <allow-empty>yes</allow-empty>
+ <_note-html>Sets the proxy server to use for HTTPS</_note-html>
+ </option>
+ </advanced-options>
+ </options>
+</event>
diff --git a/src/plugins/reporter-mantisbt.c b/src/plugins/reporter-mantisbt.c
index 67597d5..16f94b9 100644
--- a/src/plugins/reporter-mantisbt.c
@ -222,6 +485,194 @@ index e4d7b26..26a19d3 100644
+ workflow_MSVSphereJava.xml.in \
+ workflow_MSVSphereJavaScript.xml.in
endif
diff --git a/src/workflows/report_msvsphere.conf b/src/workflows/report_msvsphere.conf
new file mode 100644
index 0000000..136e22a
--- /dev/null
+++ b/src/workflows/report_msvsphere.conf
@@ -0,0 +1,31 @@
+EVENT=workflow_MSVSphereLibreport analyzer=libreport
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_MSVSphereCCpp type=CCpp
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_MSVSpherePython type=Python component!=anaconda
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_MSVSpherePython3 type=Python3 component!=anaconda
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_MSVSphereKerneloops type=Kerneloops
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_MSVSphereVmcore type=vmcore
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_MSVSphereXorg type=xorg
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
+
+EVENT=workflow_MSVSphereJava type=Java
+# this is just a meta event which consists of other events
+# the list is defined in the xml file
diff --git a/src/workflows/workflow_MSVSphereCCpp.xml.in b/src/workflows/workflow_MSVSphereCCpp.xml.in
new file mode 100644
index 0000000..863da8c
--- /dev/null
+++ b/src/workflows/workflow_MSVSphereCCpp.xml.in
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the C/C++ crash using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>analyze_CCpp</event>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSphereJava.xml.in b/src/workflows/workflow_MSVSphereJava.xml.in
new file mode 100644
index 0000000..ab1cb02
--- /dev/null
+++ b/src/workflows/workflow_MSVSphereJava.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the Java exception using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSphereJavaScript.xml.in b/src/workflows/workflow_MSVSphereJavaScript.xml.in
new file mode 100644
index 0000000..1b4bf13
--- /dev/null
+++ b/src/workflows/workflow_MSVSphereJavaScript.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the JavaScript exception using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSphereKerneloops.xml.in b/src/workflows/workflow_MSVSphereKerneloops.xml.in
new file mode 100644
index 0000000..1f92d6e
--- /dev/null
+++ b/src/workflows/workflow_MSVSphereKerneloops.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the kerneloops using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSphereLibreport.xml.in b/src/workflows/workflow_MSVSphereLibreport.xml.in
new file mode 100644
index 0000000..e5a4750
--- /dev/null
+++ b/src/workflows/workflow_MSVSphereLibreport.xml.in
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the problem using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSpherePython.xml.in b/src/workflows/workflow_MSVSpherePython.xml.in
new file mode 100644
index 0000000..b0c856b
--- /dev/null
+++ b/src/workflows/workflow_MSVSpherePython.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the python exception using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSpherePython3.xml.in b/src/workflows/workflow_MSVSpherePython3.xml.in
new file mode 100644
index 0000000..27f7272
--- /dev/null
+++ b/src/workflows/workflow_MSVSpherePython3.xml.in
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the python 3 exception using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSphereVmcore.xml.in b/src/workflows/workflow_MSVSphereVmcore.xml.in
new file mode 100644
index 0000000..0eaf33b
--- /dev/null
+++ b/src/workflows/workflow_MSVSphereVmcore.xml.in
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the kernel crash using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>analyze_VMcore</event>
+ <event>report_uReport</event>
+ <event>collect_*</event>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
diff --git a/src/workflows/workflow_MSVSphereXorg.xml.in b/src/workflows/workflow_MSVSphereXorg.xml.in
new file mode 100644
index 0000000..aeb9d7f
--- /dev/null
+++ b/src/workflows/workflow_MSVSphereXorg.xml.in
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<workflow>
+ <_name>Report to MSVSphere Bug Tracker</_name>
+ <_description>Process the X Server problem using the MSVSphere infrastructure</_description>
+
+ <events>
+ <event>report_MSVSphereBugTracker</event>
+ </events>
+</workflow>
--
2.43.0

Loading…
Cancel
Save