diff mbox

[kteam-tools] swm: remove block-proposed tags when all is ready

Message ID 20170327143416.17514-1-cascardo@canonical.com
State New
Headers show

Commit Message

Thadeu Lima de Souza Cascardo March 27, 2017, 2:34 p.m. UTC
britney only checks for the tags, not the tasks, and block-proposed will
block it. So, block-proposed tags need to be removed whenever we are
ready to promote the packages.

We have the kernel-block tag as a tool to stop the promotions.

Remove the tags whenever we set any of the release, security or updates
promotion to Confirmed or further.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 stable/wfl/wft/promote_to_release.py  |  8 ++++----
 stable/wfl/wft/promote_to_security.py |  8 ++++----
 stable/wfl/wft/promote_to_updates.py  |  8 ++++----
 stable/wfl/wft/promoter.py            | 17 +++++++++++++++++
 4 files changed, 29 insertions(+), 12 deletions(-)

Comments

Brad Figg March 29, 2017, 11:39 p.m. UTC | #1

Stefan Bader March 30, 2017, 2:32 p.m. UTC | #2

Thadeu Lima de Souza Cascardo March 30, 2017, 7:18 p.m. UTC | #3
Applied to kteam-tools.

Thanks.
Cascardo.
diff mbox

Patch

diff --git a/stable/wfl/wft/promote_to_release.py b/stable/wfl/wft/promote_to_release.py
index b064acd..03856ee 100644
--- a/stable/wfl/wft/promote_to_release.py
+++ b/stable/wfl/wft/promote_to_release.py
@@ -36,10 +36,6 @@  class PromoteToRelease(Promoter):
             if not s._testing_completed():
                 break
 
-            if s._block_proposed():
-                cinfo('            A block-proposed tag exists on this tracking bug', 'yellow')
-                break
-
             if s._kernel_block():
                 cinfo('            A kernel-block tag exists on this tracking bug', 'yellow')
                 break
@@ -61,6 +57,10 @@  class PromoteToRelease(Promoter):
 
         while True:
 
+            if s._block_proposed():
+                s._remove_block_proposed()
+                cinfo('            Removing block-proposed tag on this tracking bug', 'yellow')
+
             # Check if packages were copied to the right pocket->component
             #
             if not s.bug.packages_released:
diff --git a/stable/wfl/wft/promote_to_security.py b/stable/wfl/wft/promote_to_security.py
index 5490e1d..d26f622 100644
--- a/stable/wfl/wft/promote_to_security.py
+++ b/stable/wfl/wft/promote_to_security.py
@@ -58,10 +58,6 @@  class PromoteToSecurity(Promoter):
             if not s._testing_completed():
                 break
 
-            if s._block_proposed():
-                cinfo('            A block-proposed tag exists on this tracking bug', 'yellow')
-                break
-
             if s._kernel_block():
                 cinfo('            A kernel-block tag exists on this tracking bug', 'yellow')
                 break
@@ -81,6 +77,10 @@  class PromoteToSecurity(Promoter):
 
         while True:
 
+            if s._block_proposed():
+                s._remove_block_proposed()
+                cinfo('            Removing block-proposed tag on this tracking bug', 'yellow')
+
             # Check if packages were copied to the right pocket->component
             #
             if not s.bug.packages_released_to_security:
diff --git a/stable/wfl/wft/promote_to_updates.py b/stable/wfl/wft/promote_to_updates.py
index 90ac35d..4471f43 100644
--- a/stable/wfl/wft/promote_to_updates.py
+++ b/stable/wfl/wft/promote_to_updates.py
@@ -50,10 +50,6 @@  class PromoteToUpdates(Promoter):
             if not s._testing_completed():
                 break
 
-            if s._block_proposed():
-                cinfo('            A block-proposed tag exists on this tracking bug', 'yellow')
-                break
-
             if s._kernel_block():
                 cinfo('            A kernel-block tag exists on this tracking bug', 'yellow')
                 break
@@ -75,6 +71,10 @@  class PromoteToUpdates(Promoter):
 
             # Check if packages were copied to the right pocket->component
             #
+            if s._block_proposed():
+                s._remove_block_proposed()
+                cinfo('            Removing block-proposed tag on this tracking bug', 'yellow')
+
             if not s.bug.packages_released:
                 cinfo('            packages have not been released', 'yellow')
                 break
diff --git a/stable/wfl/wft/promoter.py b/stable/wfl/wft/promoter.py
index 646e413..ab84c07 100644
--- a/stable/wfl/wft/promoter.py
+++ b/stable/wfl/wft/promoter.py
@@ -36,6 +36,23 @@  class Promoter(TaskHandler):
         cleave(s.__class__.__name__ + '.block_proposed (%s)' % retval)
         return retval
 
+    def _remove_block_proposed(s):
+        '''
+        Remove 'block-proposed' tags in order to signal britney.
+        '''
+        center(s.__class__.__name__ + '.remove_block_proposed')
+
+        try:
+            series_tag = 'block-proposed-%s' % s.bug.series
+            if series_tag in s.bug.lpbug.tags:
+                s.bug.lpbug.tags.remove(series_tag)
+            if 'block-proposed' in s.bug.lpbug.tags:
+                s.bug.lpbug.tags.remove('block-proposed')
+        except:
+            pass
+
+        cleave(s.__class__.__name__ + '.remove_block_proposed')
+
     def _security_signoff_verified(s):
         '''
         Check if the security-signoff task has been set to 'Fix Released'. Development