Remove check_dups plugin

This plugin only works if run under an account owning the
target project (as I had it running with my own credentials
back in the day). As we no longer do that, the check_dups approach
is dead - and declining superseded requests from staging-bot
superseded (pun intended) this approach
This commit is contained in:
Stephan Kulow 2019-05-30 18:22:19 +02:00
parent 8434e554f3
commit f1476c6819
7 changed files with 2 additions and 200 deletions

View File

@ -72,6 +72,8 @@ Requires: osclib = %{version}
# no longer deployed as package
Obsoletes: %{name}-totest-manager
# no longer supported
Obsoletes: osc-plugin-check_dups
# Avoid needlessly building on s390x and such in various repos.
# Must include noarch for older systems even though it makes no sense due to
@ -235,8 +237,6 @@ BuildArch: noarch
# devel-project.py
Requires: %{name} = %{version}
Requires: osc-plugin-staging = %{version}
# For supersede service.
Requires: osc-plugin-check_dups = %{version}
Requires(pre): shadow
%description staging-bot
@ -272,16 +272,6 @@ Requires: python3-osc
%description -n osclib
Supplemental osc libraries utilized by release tools.
%package -n osc-plugin-check_dups
Summary: OSC plugin to check for duplicate requests
Group: Development/Tools/Other
BuildArch: noarch
Requires: osc >= 0.165.1
Requires: osclib = %{version}
%description -n osc-plugin-check_dups
OSC plugin to check for duplicate requests, see `osc check_dups --help`.
%package -n osc-plugin-cycle
Summary: OSC plugin for cycle visualization
Group: Development/Tools/Other
@ -464,7 +454,6 @@ exit 0
%exclude %{_datadir}/%{source_dir}/repo_checker.py
%exclude %{_datadir}/%{source_dir}/suppkg_rebuild.py
%exclude %{_datadir}/%{source_dir}/osclib
%exclude %{_datadir}/%{source_dir}/osc-check_dups.py
%exclude %{_datadir}/%{source_dir}/osc-cycle.py
%exclude %{_datadir}/%{source_dir}/osc-origin.py
%exclude %{_datadir}/%{source_dir}/osc-staging.py
@ -600,8 +589,6 @@ exit 0
%{_unitdir}/osrt-staging-bot-regular@.timer
%{_unitdir}/osrt-staging-bot-reminder.service
%{_unitdir}/osrt-staging-bot-reminder.timer
%{_unitdir}/osrt-staging-bot-supersede@.service
%{_unitdir}/osrt-staging-bot-supersede@.timer
%{_unitdir}/osrt-staging-bot-support-rebuild@.service
%{_unitdir}/osrt-staging-bot-support-rebuild@.timer
@ -618,11 +605,6 @@ exit 0
%{_datadir}/%{source_dir}/osclib
%{osc_plugin_dir}/osclib
%files -n osc-plugin-check_dups
%defattr(-,root,root,-)
%{_datadir}/%{source_dir}/osc-check_dups.py
%{osc_plugin_dir}/osc-check_dups.py
%files -n osc-plugin-cycle
%defattr(-,root,root,-)
%{_datadir}/%{source_dir}/osc-cycle.py

View File

@ -1,48 +0,0 @@
CheckDups Plugin Documentation
==============================
:author: openSUSE Team at SUSE
:toc:
Introduction
------------
[id="intro"]
This plugin check for duplicated and superseded requests.
Installation
------------
[id="install"]
Clone this repository:
-------------------------------------------------------------------------------
git clone https://github.com/openSUSE/openSUSE-release-tools.git
-------------------------------------------------------------------------------
Link the plugin and the library in +~/.osc-plugins+ or +/var/lib/osc-plugins+.
-------------------------------------------------------------------------------
cd openSUSE-release-tools
ln -sr ./osc-check_dups.py ./osclib ~/.osc-plugins
-------------------------------------------------------------------------------
Command line
------------
[id="cli"]
The only allowed parameter is the list of projects where to find
duplicated requests.
Checks done
-----------
[id="checks"]
Basically there is only one check in this plugin. For every project
listed in the command line, this plugin will search the list of
request available for it. The plugin will check if there are multiple
requests that refer to the same project and package (but with a
different request ID).

View File

@ -155,27 +155,6 @@ pipelines:
- staging-bot
tasks:
- script: ./staging-report.py --debug -A https://api.suse.de -p SUSE:SLE-15-SP1:GA
SLE.Check.Dups:
group: SLE.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 */10 * ? * *
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Run:
approval:
type: manual
jobs:
Run:
timeout: 0
resources:
- staging-bot
tasks:
- script: /usr/bin/osc -A https://api.suse.de check_dups SUSE:SLE-15-SP1:GA
SLE.Source.Check:
group: SLE.Checkers
lock_behavior: unlockWhenFinished

View File

@ -155,27 +155,6 @@ pipelines:
- staging-bot
tasks:
- script: ./staging-report.py --debug -A https://api.suse.de -p SUSE:SLE-15-SP1:GA
SLE.Check.Dups:
group: SLE.Checkers
lock_behavior: unlockWhenFinished
timer:
spec: 0 */10 * ? * *
materials:
git:
git: https://github.com/openSUSE/openSUSE-release-tools.git
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Run:
approval:
type: manual
jobs:
Run:
timeout: 0
resources:
- staging-bot
tasks:
- script: /usr/bin/osc -A https://api.suse.de check_dups SUSE:SLE-15-SP1:GA
SLE.Source.Check:
group: SLE.Checkers
lock_behavior: unlockWhenFinished

View File

@ -1,69 +0,0 @@
#
# (C) 2013 coolo@suse.de, openSUSE.org
# Distribute under GPLv2 or GPLv3
#
# Copy this script to ~/.osc-plugins/ or /var/lib/osc-plugins .
# Then try to run 'osc checker --help' to see the usage.
from xml.etree import cElementTree as ET
from osc.core import change_request_state
from osc.core import get_dependson
from osc.core import http_GET
from osc.core import makeurl
def _checker_check_dups(self, project, opts):
url = makeurl(opts.apiurl, ['request'], "states=new,review&project=%s&view=collection" % project)
f = http_GET(url)
root = ET.parse(f).getroot()
rqs = {}
for rq in root.findall('request'):
id = rq.attrib['id']
for a in rq.findall('action'):
source = a.find('source')
target = a.find('target')
type = a.attrib['type']
assert target != None
if target.attrib['project'] != project:
continue
# print(id)
# ET.dump(target)
if 'package' not in target.attrib:
continue
package = target.attrib['package']
if type + package in rqs:
[oldid, oldsource] = rqs[type + package]
if oldid > id:
s = oldid
oldid = id
id = s
assert oldid < id
if source != None and oldsource != None:
if (source.attrib['project'] == oldsource.attrib['project'] and
source.attrib['package'] == oldsource.attrib['package']):
change_request_state(opts.apiurl, str(oldid), 'superseded',
'superseded by %s' % id, id)
continue
print("DUPS found:", id, oldid)
rqs[type + package] = [id, source]
def do_check_dups(self, subcmd, opts, *args):
"""${cmd_name}: checker review of submit requests.
Usage:
osc check_dups [OPT] [list] [FILTER|PACKAGE_SRC]
Shows pending review requests and their current state.
${cmd_option_list}
"""
opts.apiurl = self.get_api_url()
for p in args[:]:
self._checker_check_dups(p, opts)
#Local Variables:
#mode: python
#py-indent-offset: 4
#tab-width: 8
#End:

View File

@ -1,11 +0,0 @@
[Unit]
Description=openSUSE Release Tools: supersede duplicate submissions for %i
[Service]
User=osrt-staging-bot
SyslogIdentifier=osrt-staging-bot
ExecStart=/usr/bin/osc check_dups "%i"
RuntimeMaxSec=3 hour
[Install]
WantedBy=multi-user.target

View File

@ -1,10 +0,0 @@
[Unit]
Description=openSUSE Release Tools: supersede duplicate submissions for %i
[Timer]
OnBootSec=120
OnUnitInactiveSec=4 min
Unit=osrt-staging-bot-supersede@%i.service
[Install]
WantedBy=timers.target