Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package openSUSE-release-tools for 
openSUSE:Factory checked in at 2022-02-14 22:36:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openSUSE-release-tools (Old)
 and      /work/SRC/openSUSE:Factory/.openSUSE-release-tools.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openSUSE-release-tools"

Mon Feb 14 22:36:20 2022 rev:374 rq:954316 version:20220214.bf7c5e16

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/openSUSE-release-tools/openSUSE-release-tools.changes
    2022-02-11 23:09:29.822961162 +0100
+++ 
/work/SRC/openSUSE:Factory/.openSUSE-release-tools.new.1956/openSUSE-release-tools.changes
  2022-02-14 22:37:20.665597136 +0100
@@ -1,0 +2,6 @@
+Mon Feb 14 13:32:19 UTC 2022 - opensuse-releaset...@opensuse.org
+
+- Update to version 20220214.bf7c5e16:
+  * Introduce --remove-exclusion for staging select
+
+-------------------------------------------------------------------

Old:
----
  openSUSE-release-tools-20220210.5effbf8b.obscpio

New:
----
  openSUSE-release-tools-20220214.bf7c5e16.obscpio

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

Other differences:
------------------
++++++ openSUSE-release-tools.spec ++++++
--- /var/tmp/diff_new_pack.WUg8HP/_old  2022-02-14 22:37:21.313598825 +0100
+++ /var/tmp/diff_new_pack.WUg8HP/_new  2022-02-14 22:37:21.321598846 +0100
@@ -20,7 +20,7 @@
 %define source_dir openSUSE-release-tools
 %define announcer_filename factory-package-news
 Name:           openSUSE-release-tools
-Version:        20220210.5effbf8b
+Version:        20220214.bf7c5e16
 Release:        0
 Summary:        Tools to aid in staging and release work for openSUSE/SUSE
 License:        GPL-2.0-or-later AND MIT

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.WUg8HP/_old  2022-02-14 22:37:21.365598960 +0100
+++ /var/tmp/diff_new_pack.WUg8HP/_new  2022-02-14 22:37:21.369598971 +0100
@@ -1,7 +1,7 @@
 <servicedata>
   <service name="tar_scm">
     <param 
name="url">https://github.com/openSUSE/openSUSE-release-tools.git</param>
-    <param 
name="changesrevision">7e97d732afe998639ac84f731cc81b3d9482c8c0</param>
+    <param 
name="changesrevision">bf7c5e16825c7118f4e74a71b43c22071c7dc531</param>
   </service>
 </servicedata>
 

++++++ openSUSE-release-tools-20220210.5effbf8b.obscpio -> 
openSUSE-release-tools-20220214.bf7c5e16.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20220210.5effbf8b/osc-staging.py 
new/openSUSE-release-tools-20220214.bf7c5e16/osc-staging.py
--- old/openSUSE-release-tools-20220210.5effbf8b/osc-staging.py 2022-02-10 
11:44:02.000000000 +0100
+++ new/openSUSE-release-tools-20220214.bf7c5e16/osc-staging.py 2022-02-14 
14:30:45.000000000 +0100
@@ -118,6 +118,7 @@
 @cmdln.option('--try-strategies', action='store_true', default=False, 
help='apply strategies and keep any with desireable outcome')
 @cmdln.option('--strategy', help='apply a specific strategy')
 @cmdln.option('--no-color', action='store_true', help='strip colors from 
output (or add staging.color = 0 to the .oscrc general section')
+@cmdln.option('--remove-exclusion', action='store_true', help='unignore 
selected requests automatically', default=False)
 @cmdln.option('--save', action='store_true', help='save the result to the 
pseudometa package')
 def do_staging(self, subcmd, opts, *args):
     """${cmd_name}: Commands to work with staging projects
@@ -266,6 +267,9 @@
 
         select --move --filter-from A B $(< package.list)
 
+        select --remove-exclusion will unignore the requests selected (ignored 
requests
+        are called excluded in the OBS API)
+
     "unselect" will remove from the project - pushing them back to the backlog
         If a message is included the requests will be ignored first.
 
@@ -304,7 +308,7 @@
         osc staging unignore [--cleanup] [REQUEST...|all]
         osc staging list [--supersede]
         osc staging lock [-m MESSAGE]
-        osc staging select [--no-freeze] [--move [--filter-from STAGING]]
+        osc staging select [--no-freeze] [--remove-exclusion] [--move 
[--filter-from STAGING]]
             STAGING REQUEST...
         osc staging select [--no-freeze] [--interactive|--non-interactive]
             [--filter-by...] [--group-by...]
@@ -559,13 +563,13 @@
                     #    
api.set_splitter_info_in_prj_pseudometa(target_project, info['group'], 
info['strategy'])
 
                     SelectCommand(api, target_project) \
-                        .perform(request_ids, no_freeze=opts.no_freeze)
+                        .perform(request_ids, no_freeze=opts.no_freeze, 
remove_exclusion=opts.remove_exclusion)
             else:
                 target_project = api.prj_from_short(stagings[0])
                 filter_from = api.prj_from_short(opts.filter_from) if 
opts.filter_from else None
                 SelectCommand(api, target_project) \
                     .perform(requests, opts.move,
-                             filter_from, opts.no_freeze)
+                             filter_from, no_freeze=opts.no_freeze, 
remove_exclusion=opts.remove_exclusion)
         elif cmd == 'cleanup_rings':
             CleanupRings(api).perform()
         elif cmd == 'ignore':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20220210.5effbf8b/osclib/select_command.py 
new/openSUSE-release-tools-20220214.bf7c5e16/osclib/select_command.py
--- old/openSUSE-release-tools-20220210.5effbf8b/osclib/select_command.py       
2022-02-10 11:44:02.000000000 +0100
+++ new/openSUSE-release-tools-20220214.bf7c5e16/osclib/select_command.py       
2022-02-14 14:30:45.000000000 +0100
@@ -55,7 +55,7 @@
 
         return candidates[0] if candidates else None
 
-    def select_request(self, request, move, filter_from):
+    def select_request(self, request, move, filter_from, 
remove_exclusion=False):
         supersede = False
 
         staged_requests = {
@@ -68,7 +68,7 @@
             # Normal 'select' command
             print('Adding request "{}" to project "{}"'.format(request, 
self.target_project))
 
-            return self.api.rq_to_prj(request, self.target_project)
+            return self.api.rq_to_prj(request, self.target_project, 
remove_exclusion)
         elif request in staged_requests and (move or supersede):
             # 'select' command becomes a 'move'
             # supersede = (new_rq, package, project)
@@ -106,7 +106,7 @@
             raise oscerr.WrongArgs('Arguments for select are not correct.')
 
     def perform(self, requests, move=False,
-                filter_from=None, no_freeze=False):
+                filter_from=None, no_freeze=False, remove_exclusion=False):
         """
         Select package and move it accordingly by arguments
         :param target_project: project we want to target
@@ -132,7 +132,7 @@
         requests_count = len(requests)
         for index, request in enumerate(requests, start=1):
             print('({}/{}) '.format(index, requests_count), end='')
-            if not self.select_request(request, move, filter_from):
+            if not self.select_request(request, move, filter_from, 
remove_exclusion=remove_exclusion):
                 return False
 
         # Notify everybody about the changes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20220210.5effbf8b/osclib/stagingapi.py 
new/openSUSE-release-tools-20220214.bf7c5e16/osclib/stagingapi.py
--- old/openSUSE-release-tools-20220210.5effbf8b/osclib/stagingapi.py   
2022-02-10 11:44:02.000000000 +0100
+++ new/openSUSE-release-tools-20220214.bf7c5e16/osclib/stagingapi.py   
2022-02-14 14:30:45.000000000 +0100
@@ -895,7 +895,7 @@
                 return (time.time() - float(entry.get('mtime'))) / 3600 / 24
         return 100000  # quite some!
 
-    def rq_to_prj(self, request_id, project):
+    def rq_to_prj(self, request_id, project, remove_exclusion=False):
         """
         Links request to project - delete or submit
         :param request_id: request to link
@@ -923,7 +923,10 @@
             raise oscerr.WrongArgs(msg)
 
         requestxml = f"<requests><request id='{request_id}'/></requests>"
-        u = makeurl(self.apiurl, ['staging', self.project, 'staging_projects', 
project, 'staged_requests'])
+        opts = {}
+        if remove_exclusion:
+            opts['remove_exclusion'] = 1
+        u = makeurl(self.apiurl, ['staging', self.project, 'staging_projects', 
project, 'staged_requests'], opts)
         f = http_POST(u, data=requestxml)
 
         if act_type == 'delete':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/openSUSE-release-tools-20220210.5effbf8b/tests/select_tests.py 
new/openSUSE-release-tools-20220214.bf7c5e16/tests/select_tests.py
--- old/openSUSE-release-tools-20220210.5effbf8b/tests/select_tests.py  
2022-02-10 11:44:02.000000000 +0100
+++ new/openSUSE-release-tools-20220214.bf7c5e16/tests/select_tests.py  
2022-02-14 14:30:45.000000000 +0100
@@ -1,22 +1,13 @@
-import unittest
-import os.path
 from osc import oscerr
-import osc.conf
-from osc.core import http_GET, http_POST, makeurl
-from lxml import etree as ET
-from osclib.cache import Cache
-from osclib.cache_manager import CacheManager
-from osclib.comments import CommentAPI
 from osclib.conf import Config
 from osclib.core import package_list
 from osclib.select_command import SelectCommand
 from osclib.unselect_command import UnselectCommand
 from osclib.supersede_command import SupersedeCommand
-from osclib.stagingapi import StagingAPI
-from osclib.memoize import memoize_session_reset
+from osclib.ignore_command import IgnoreCommand
 from osclib.core import source_file_load
-import logging
-
+from urllib.error import HTTPError
+from lxml import etree as ET
 from mock import MagicMock
 from . import OBSLocal
 
@@ -136,3 +127,27 @@
         # TODO: record which URLs were called so we can verify them
         # but we wont' be able to test the actual wipe unless we really build 
something
         # which is too expensive
+
+    def test_select_excluded_package(self):
+        self.wf.setup_rings()
+        staging = self.wf.create_staging('A', freeze=True, with_repo=True)
+
+        self.wf.create_submit_request('devel:wine', 'wine')
+        IgnoreCommand(self.wf.api).perform(['wine'])
+
+        with self.assertRaises(HTTPError) as context:
+            SelectCommand(self.wf.api, staging.name).perform(['wine'])
+
+        root = ET.fromstring(context.exception.fp.read())
+        self.assertRegex(root.find('summary').text, r'Use --remove-exclusion')
+
+    def test_excluded_package(self):
+        self.wf.setup_rings()
+        staging = self.wf.create_staging('A', freeze=True, with_repo=True)
+
+        self.wf.create_submit_request('devel:wine', 'wine')
+        IgnoreCommand(self.wf.api).perform(['wine'])
+
+        ret = SelectCommand(self.wf.api, staging.name).perform(['wine'], 
remove_exclusion=True)
+        self.assertEqual(True, ret)
+        self.assertEqual(0, len(self.wf.api.get_ignored_requests()))

++++++ openSUSE-release-tools.obsinfo ++++++
--- /var/tmp/diff_new_pack.WUg8HP/_old  2022-02-14 22:37:22.109600899 +0100
+++ /var/tmp/diff_new_pack.WUg8HP/_new  2022-02-14 22:37:22.113600909 +0100
@@ -1,5 +1,5 @@
 name: openSUSE-release-tools
-version: 20220210.5effbf8b
-mtime: 1644489842
-commit: 5effbf8be3fcd639f0963ae126722230e6e96c01
+version: 20220214.bf7c5e16
+mtime: 1644845445
+commit: bf7c5e16825c7118f4e74a71b43c22071c7dc531
 

Reply via email to