Hello community,

here is the log from the commit of package openSUSE-release-tools for 
openSUSE:Factory checked in at 2017-11-07 09:57:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openSUSE-release-tools (Old)
 and      /work/SRC/openSUSE:Factory/.openSUSE-release-tools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openSUSE-release-tools"

Tue Nov  7 09:57:53 2017 rev:17 rq:538860 version:20171103.593c900

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/openSUSE-release-tools/openSUSE-release-tools.changes
    2017-11-03 16:27:32.662327227 +0100
+++ 
/work/SRC/openSUSE:Factory/.openSUSE-release-tools.new/openSUSE-release-tools.changes
       2017-11-07 09:58:04.642129947 +0100
@@ -1,0 +2,16 @@
+Fri Nov 03 23:19:04 UTC 2017 - [email protected]
+
+- Update to version 20171103.593c900:
+  * dist: provide metrics service and timer.
+  * dist: install exported dashboards in grafana dashboard directory.
+  * dist: include metrics.py in bindir.
+  * dist: move package_name variable to Makefile.common.
+
+-------------------------------------------------------------------
+Fri Nov 03 08:48:15 UTC 2017 - [email protected]
+
+- Update to version 20171103.f5bc6b6:
+  * vdelreq: add to the package
+  * osc vdelreq: new command lists pending virtually accepted delete request 
status
+
+-------------------------------------------------------------------

Old:
----
  openSUSE-release-tools-20171102.0a45aba.obscpio

New:
----
  openSUSE-release-tools-20171103.593c900.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openSUSE-release-tools.spec ++++++
--- /var/tmp/diff_new_pack.vZ9dze/_old  2017-11-07 09:58:06.954046074 +0100
+++ /var/tmp/diff_new_pack.vZ9dze/_new  2017-11-07 09:58:06.958045929 +0100
@@ -20,7 +20,7 @@
 %define source_dir osc-plugin-factory
 %define announcer_filename factory-package-news
 Name:           openSUSE-release-tools
-Version:        20171102.0a45aba
+Version:        20171103.593c900
 Release:        0
 Summary:        Tools to aid in staging and release work for openSUSE/SUSE
 License:        GPL-2.0+ and MIT
@@ -148,7 +148,12 @@
 BuildArch:      noarch
 # TODO Update requirements.
 Requires:       osclib = %{version}
-# TODO Requires: python-influxdb, but package does not exist.
+Requires(pre):  shadow
+# TODO Requires: python-influxdb, but package does not exist in Factory, but
+# present in Cloud:OpenStack:Master/python-influxdb.
+Recommends:     python-influxdb
+Suggests:       grafana
+Suggests:       influxdb
 
 %description metrics
 Ingest relevant OBS and annotation data to generate insightful metrics.
@@ -243,6 +248,15 @@
 %description -n osc-plugin-staging
 OSC plugin for the staging workflow, see `osc staging --help`.
 
+%package -n osc-plugin-vdelreq
+Summary:        OSC plugin to check for virtually accepted request
+Group:          Development/Tools/Other
+BuildArch:      noarch
+Requires:       osc >= 0.159.0
+
+%description -n osc-plugin-vdelreq
+OSC plugin to check for virtually accepted request, see `osc vdelreq --help`.
+
 %prep
 %setup -q
 
@@ -257,6 +271,7 @@
 
 %install
 %make_install \
+  grafana_dashboards_dir="%{_localstatedir}/lib/grafana/dashboards/%{name}" \
   oscplugindir="%{osc_plugin_dir}" \
   VERSION="%{version}"
 
@@ -328,7 +343,17 @@
 %postun maintenance
 %service_del_postun osrt-maintenance-incidents.service
 
-# TODO Provide metrics service once #1006 is resolved.
+%pre metrics
+getent passwd osrt-metrics > /dev/null || \
+  useradd -r -m -s /sbin/nologin -c "user for openSUSE-release-tools-metrics" 
osrt-metrics
+exit 0
+
+%postun metrics
+%systemd_postun
+# If grafana-server.service is enabled then restart it to load new dashboards.
+if [ -x /usr/bin/systemctl ] && systemctl is-enabled grafana-server ; then
+  /usr/bin/systemctl try-restart --no-block grafana-server
+fi
 
 %pre repo-checker
 %service_add_pre osrt-repo-checker.service
@@ -421,6 +446,7 @@
 %exclude %{_datadir}/%{source_dir}/osc-check_dups.py
 %exclude %{_datadir}/%{source_dir}/osc-cycle.py
 %exclude %{_datadir}/%{source_dir}/osc-staging.py
+%exclude %{_datadir}/%{source_dir}/osc-vdelreq.py
 %exclude %{_datadir}/%{source_dir}/update_crawler.py
 %dir %{_sysconfdir}/openSUSE-release-tools
 
@@ -479,8 +505,15 @@
 
 %files metrics
 %defattr(-,root,root,-)
+%{_bindir}/osrt-metrics
 %{_datadir}/%{source_dir}/metrics
 %{_datadir}/%{source_dir}/metrics.py
+# To avoid adding grafana as BuildRequires since it does not live in same repo.
+%dir %{_localstatedir}/lib/grafana
+%dir %{_localstatedir}/lib/grafana/dashboards
+%{_localstatedir}/lib/grafana/dashboards/%{name}
+%{_unitdir}/[email protected]
+%{_unitdir}/[email protected]
 
 %files repo-checker
 %defattr(-,root,root,-)
@@ -544,4 +577,9 @@
 %{_datadir}/%{source_dir}/osc-staging.py
 %{osc_plugin_dir}/osc-staging.py
 
+%files -n osc-plugin-vdelreq
+%defattr(-,root,root,-)
+%{_datadir}/%{source_dir}/osc-vdelreq.py
+%{osc_plugin_dir}/osc-vdelreq.py
+
 %changelog

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.vZ9dze/_old  2017-11-07 09:58:07.026043462 +0100
+++ /var/tmp/diff_new_pack.vZ9dze/_new  2017-11-07 09:58:07.030043317 +0100
@@ -1,6 +1,6 @@
 <servicedata>
   <service name="tar_scm">
     <param 
name="url">https://github.com/openSUSE/osc-plugin-factory.git</param>
-    <param 
name="changesrevision">0a45aba664a73e919c08490b0a8b0e187b0a6a5f</param>
+    <param 
name="changesrevision">a0c7dc362cd2670372c25b795ba25a0dede47bfe</param>
   </service>
 </servicedata>

++++++ openSUSE-release-tools-20171102.0a45aba.obscpio -> 
openSUSE-release-tools-20171103.593c900.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/openSUSE-release-tools-20171102.0a45aba/Makefile 
new/openSUSE-release-tools-20171103.593c900/Makefile
--- old/openSUSE-release-tools-20171102.0a45aba/Makefile        2017-11-02 
07:57:41.000000000 +0100
+++ new/openSUSE-release-tools-20171103.593c900/Makefile        2017-11-04 
00:13:10.000000000 +0100
@@ -8,6 +8,7 @@
        devel-project.py \
        leaper.py \
        manager_42.py \
+       metrics.py \
        pkglistgen.sh \
        repo_checker.py \
        suppkg_rebuild.py \
@@ -16,13 +17,12 @@
 pkgdata_SCRIPTS=$(wildcard *.py *.pl *.sh)
 pkgdata_SCRIPTS+=bs_mirrorfull findfileconflicts
 pkgdata_DATA+=bs_copy metrics osclib $(wildcard *.pm *.testcase)
-package_name = openSUSE-release-tools
 VERSION = "build-$(shell date +%F)"
 
 all:
 
 install:
-       install -d -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) 
$(DESTDIR)$(unitdir) $(DESTDIR)$(oscplugindir) 
$(DESTDIR)$(sysconfdir)/$(package_name)
+       install -d -m 755 $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) 
$(DESTDIR)$(unitdir) $(DESTDIR)$(oscplugindir) 
$(DESTDIR)$(sysconfdir)/$(package_name) $(DESTDIR)$(grafana_dashboards_dir)
        for i in $(pkgdata_SCRIPTS); do install -m 755 $$i 
$(DESTDIR)$(pkgdatadir); done
        chmod 644 $(DESTDIR)$(pkgdatadir)/osc-*.py
        for i in $(pkgdata_DATA); do cp -a $$i $(DESTDIR)$(pkgdatadir); done
@@ -34,6 +34,7 @@
        for i in $(pkgdata_BINS); do ln -s $(pkgdatadir)/$$i 
$(DESTDIR)$(bindir)/osrt-$${i%.*}; done
        install -m 755 script/* $(DESTDIR)$(bindir)
        cp -R config/* $(DESTDIR)$(sysconfdir)/$(package_name)
+       for i in metrics/grafana/* ; do ln -s $(pkgdatadir)/$$i 
$(DESTDIR)$(grafana_dashboards_dir)/osrt-$$(basename $$i); done
 
 check: test
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20171102.0a45aba/Makefile.common 
new/openSUSE-release-tools-20171103.593c900/Makefile.common
--- old/openSUSE-release-tools-20171102.0a45aba/Makefile.common 2017-11-02 
07:57:41.000000000 +0100
+++ new/openSUSE-release-tools-20171103.593c900/Makefile.common 2017-11-04 
00:13:10.000000000 +0100
@@ -1,9 +1,11 @@
+package_name = openSUSE-release-tools
 prefix=/usr
 bindir=$(prefix)/bin
 datadir=$(prefix)/share
 sysconfdir=/etc
 unitdir=$(prefix)/lib/systemd/system
 pkgdatadir=$(datadir)/osc-plugin-factory
+grafana_dashboards_dir="/var/lib/grafana/dashboards/$(package_name)"
 oscplugindir=$(prefix)/lib/osc-plugins
 apachevhostsdir=$(sysconfdir)/apache2/vhosts.d
 tmpfilesdir=$(prefix)/lib/tmpfiles.d
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20171102.0a45aba/dist/package/openSUSE-release-tools.spec
 
new/openSUSE-release-tools-20171103.593c900/dist/package/openSUSE-release-tools.spec
--- 
old/openSUSE-release-tools-20171102.0a45aba/dist/package/openSUSE-release-tools.spec
        2017-11-02 07:57:41.000000000 +0100
+++ 
new/openSUSE-release-tools-20171103.593c900/dist/package/openSUSE-release-tools.spec
        2017-11-04 00:13:10.000000000 +0100
@@ -148,7 +148,12 @@
 BuildArch:      noarch
 # TODO Update requirements.
 Requires:       osclib = %{version}
-# TODO Requires: python-influxdb, but package does not exist.
+Requires(pre):  shadow
+# TODO Requires: python-influxdb, but package does not exist in Factory, but
+# present in Cloud:OpenStack:Master/python-influxdb.
+Recommends:     python-influxdb
+Suggests:       grafana
+Suggests:       influxdb
 
 %description metrics
 Ingest relevant OBS and annotation data to generate insightful metrics.
@@ -243,6 +248,15 @@
 %description -n osc-plugin-staging
 OSC plugin for the staging workflow, see `osc staging --help`.
 
+%package -n osc-plugin-vdelreq
+Summary:        OSC plugin to check for virtually accepted request
+Group:          Development/Tools/Other
+BuildArch:      noarch
+Requires:       osc >= 0.159.0
+
+%description -n osc-plugin-vdelreq
+OSC plugin to check for virtually accepted request, see `osc vdelreq --help`.
+
 %prep
 %setup -q
 
@@ -257,6 +271,7 @@
 
 %install
 %make_install \
+  grafana_dashboards_dir="%{_localstatedir}/lib/grafana/dashboards/%{name}" \
   oscplugindir="%{osc_plugin_dir}" \
   VERSION="%{version}"
 
@@ -328,7 +343,17 @@
 %postun maintenance
 %service_del_postun osrt-maintenance-incidents.service
 
-# TODO Provide metrics service once #1006 is resolved.
+%pre metrics
+getent passwd osrt-metrics > /dev/null || \
+  useradd -r -m -s /sbin/nologin -c "user for openSUSE-release-tools-metrics" 
osrt-metrics
+exit 0
+
+%postun metrics
+%systemd_postun
+# If grafana-server.service is enabled then restart it to load new dashboards.
+if [ -x /usr/bin/systemctl ] && systemctl is-enabled grafana-server ; then
+  /usr/bin/systemctl try-restart --no-block grafana-server
+fi
 
 %pre repo-checker
 %service_add_pre osrt-repo-checker.service
@@ -421,6 +446,7 @@
 %exclude %{_datadir}/%{source_dir}/osc-check_dups.py
 %exclude %{_datadir}/%{source_dir}/osc-cycle.py
 %exclude %{_datadir}/%{source_dir}/osc-staging.py
+%exclude %{_datadir}/%{source_dir}/osc-vdelreq.py
 %exclude %{_datadir}/%{source_dir}/update_crawler.py
 %dir %{_sysconfdir}/openSUSE-release-tools
 
@@ -479,8 +505,15 @@
 
 %files metrics
 %defattr(-,root,root,-)
+%{_bindir}/osrt-metrics
 %{_datadir}/%{source_dir}/metrics
 %{_datadir}/%{source_dir}/metrics.py
+# To avoid adding grafana as BuildRequires since it does not live in same repo.
+%dir %{_localstatedir}/lib/grafana
+%dir %{_localstatedir}/lib/grafana/dashboards
+%{_localstatedir}/lib/grafana/dashboards/%{name}
+%{_unitdir}/[email protected]
+%{_unitdir}/[email protected]
 
 %files repo-checker
 %defattr(-,root,root,-)
@@ -544,4 +577,9 @@
 %{_datadir}/%{source_dir}/osc-staging.py
 %{osc_plugin_dir}/osc-staging.py
 
+%files -n osc-plugin-vdelreq
+%defattr(-,root,root,-)
+%{_datadir}/%{source_dir}/osc-vdelreq.py
+%{osc_plugin_dir}/osc-vdelreq.py
+
 %changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20171102.0a45aba/docs/metrics.md 
new/openSUSE-release-tools-20171103.593c900/docs/metrics.md
--- old/openSUSE-release-tools-20171102.0a45aba/docs/metrics.md 2017-11-02 
07:57:41.000000000 +0100
+++ new/openSUSE-release-tools-20171103.593c900/docs/metrics.md 2017-11-04 
00:13:10.000000000 +0100
@@ -23,7 +23,8 @@
 
 - InfluxDB instance
 - Grafana instance
-  - import `metrics/grafana` dashboards
+  - `grafana.ini`:
+    - `[dashboards.json].enabled = true` to use the dashboards provided by rpm
   - create data sources for desired projects
     setting name and database to the project name (ex. `openSUSE:Factory`)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20171102.0a45aba/osc-vdelreq.py 
new/openSUSE-release-tools-20171103.593c900/osc-vdelreq.py
--- old/openSUSE-release-tools-20171102.0a45aba/osc-vdelreq.py  1970-01-01 
01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171103.593c900/osc-vdelreq.py  2017-11-04 
00:13:10.000000000 +0100
@@ -0,0 +1,103 @@
+#!/usr/bin/python
+# Copyright (c) 2017 SUSE LLC
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+from __future__ import print_function
+
+import os
+import os.path
+import sys
+
+from xml.etree import cElementTree as ET
+
+import osc.core
+import osc.conf
+
+from osc import cmdln
+from osc import oscerr
+
+def _has_binary(self, project, package):
+    query = {'view': 'binarylist', 'package': package, 'multibuild': '1'}
+    pkg_binarylist = ET.parse(osc.core.http_GET(osc.core.makeurl(self.apiurl, 
['build', project, '_result'], query=query))).getroot()
+    for binary in pkg_binarylist.findall('./result/binarylist/binary'):
+        return 'Yes'
+    return 'No'
+
+
+def list_virtually_accepted_request(self, project, opts):
+    state_cond = 
"state/@name='review'+or+state/@name='revoked'+or+state/@name='revoked'"
+    if opts.all:
+        state_cond += "+or+state/@name='accepted'"
+    query = 
"match=({})+and+(action/target/@project='{}'+and+action/@type='delete')+and+"\
+            
"((review/@state='new'+or+review/@state='accepted')+and+review/@by_group='{}')".format(state_cond,
 project, opts.delreq_review)
+    url = osc.core.makeurl(self.apiurl, ['search', 'request'], query)
+    f = osc.core.http_GET(url)
+    root = ET.parse(f).getroot()
+    rqs = []
+    for rq in root.findall('request'):
+        has_binary = 'No'
+        id = rq.attrib['id']
+        rq_state = rq.find('state').get('name')
+        pkg = rq.find('action/target').get('package')
+        if rq_state != 'accepted':
+            has_binary = self._has_binary(project, pkg)
+        for review in rq.findall('review'):
+            if review.get('by_group') and review.attrib['by_group'] == 
opts.delreq_review:
+                delreq_review_state = review.attrib['state']
+
+        content = {"id": int(id), "package": pkg, "rq_state": rq_state, 
"delreq_review_state": delreq_review_state, "has_binary": has_binary}
+        rqs.append(content)
+
+    rqs.sort(key=lambda d: d['id'])
+    for rq in rqs:
+        print("{} {} state is {} \n {} Virtually accept review is {} ( binary: 
{} )".format(str(rq['id']),
+            rq['package'], rq['rq_state'], "-".rjust(len(str(rq['id']))+1, ' 
'), rq['delreq_review_state'], rq['has_binary']))
+
[email protected]('--delreq-review', dest='delreq_review', metavar='DELREQREVIEW', 
default='factory-maintainers',
+        help='the additional reviews')
[email protected]('--all', action='store_true', default=False, help='shows all 
requests including accepted request')
+def do_vdelreq(self, subcmd, opts, *args):
+    """${cmd_name}: display pending virtual accept delete request
+
+    osc vdelreq [OPT] COMMAND PROJECT
+        Shows pending the virtual accept delete requests and the current state.
+
+    ${cmd_option_list}
+
+    "list" will list virtually accepted delete request.
+
+    Usage:
+        osc vdelreq [--delreq-review DELREQREVIEW] list PROJECT
+    """
+
+    self.apiurl = self.get_api_url()
+
+    if len(args) == 0:
+        raise oscerr.WrongArgs('No command given, see "osc help vdelreq"!')
+    if len(args) < 2:
+        raise oscerr.WrongArgs('No project given, see "osc help vdelreq"!')
+
+    cmd = args[0]
+    if cmd in ('list'):
+        self.list_virtually_accepted_request(args[1], opts)
+    else:
+        raise oscerr.WrongArgs('Unknown command: %s' % cmd)
+
+# vim: sw=4 et
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20171102.0a45aba/systemd/[email protected] 
new/openSUSE-release-tools-20171103.593c900/systemd/[email protected]
--- old/openSUSE-release-tools-20171102.0a45aba/systemd/[email protected]   
1970-01-01 01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171103.593c900/systemd/[email protected]   
2017-11-04 00:13:10.000000000 +0100
@@ -0,0 +1,12 @@
+[Unit]
+Description=openSUSE Release Tools: metrics for %i
+
+[Service]
+Type=oneshot
+User=osrt-metrics
+SyslogIdentifier=osrt-metrics
+ExecStart=/usr/bin/osrt-metrics --debug -p "%i"
+TimeoutStartSec=8 hour
+
+[Install]
+WantedBy=multi-user.target
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20171102.0a45aba/systemd/[email protected] 
new/openSUSE-release-tools-20171103.593c900/systemd/[email protected]
--- old/openSUSE-release-tools-20171102.0a45aba/systemd/[email protected]     
1970-01-01 01:00:00.000000000 +0100
+++ new/openSUSE-release-tools-20171103.593c900/systemd/[email protected]     
2017-11-04 00:13:10.000000000 +0100
@@ -0,0 +1,10 @@
+[Unit]
+Description=openSUSE Release Tools: metrics for %i
+
+[Timer]
+OnBootSec=120
+OnCalendar=daily
+Unit=osrt-metrics@%i.service
+
+[Install]
+WantedBy=timers.target

++++++ openSUSE-release-tools.obsinfo ++++++
--- /var/tmp/diff_new_pack.vZ9dze/_old  2017-11-07 09:58:07.950009942 +0100
+++ /var/tmp/diff_new_pack.vZ9dze/_new  2017-11-07 09:58:07.954009797 +0100
@@ -1,5 +1,5 @@
 name: openSUSE-release-tools
-version: 20171102.0a45aba
-mtime: 1509605861
-commit: 0a45aba664a73e919c08490b0a8b0e187b0a6a5f
+version: 20171103.593c900
+mtime: 1509750790
+commit: 593c90038fdecaec8d4743568c2937bdfa6bd9eb
 


Reply via email to