swm: promote_to_updates.py: check for snap tasks before closing tb

Message ID 20171218113414.11756-1-kleber.souza@canonical.com
State New
Headers show
Series
  • swm: promote_to_updates.py: check for snap tasks before closing tb
Related show

Commit Message

Kleber Sacilotto de Souza Dec. 18, 2017, 11:34 a.m.
Do not close the tracking bug until all the snap-related tasks are
either Invalid or Fix Released.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
---
 stable/wfl/wft/promote_to_updates.py | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Stefan Bader Jan. 23, 2018, 1:38 p.m. | #1
On 18.12.2017 12:34, Kleber Sacilotto de Souza wrote:
> Do not close the tracking bug until all the snap-related tasks are
> either Invalid or Fix Released.
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>

> ---
>  stable/wfl/wft/promote_to_updates.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/stable/wfl/wft/promote_to_updates.py b/stable/wfl/wft/promote_to_updates.py
> index d0377cf4..29f6c393 100644
> --- a/stable/wfl/wft/promote_to_updates.py
> +++ b/stable/wfl/wft/promote_to_updates.py
> @@ -141,6 +141,15 @@ class PromoteToUpdates(Promoter):
>                      cinfo('            package promote-to-security status (%s) does not match security-signoff status (%s)' % (promote_to_security.status, security_signoff.status), 'yellow')
>                      break
>  
> +                # Check that all snap tasks are either "Invalid" or "Fix Released"
> +                snap_done = True
> +                for taskname in s.bug.tasks_by_name:
> +                    if taskname.startswith('snap-') and s.bug.tasks_by_name[taskname].status not in ['Invalid', 'Fix Released']:
> +                        cinfo('            %s is neither "Fix Released" nor "Invalid" (%s)' % (taskname, s.bug.tasks_by_name[taskname].status), 'yellow')
> +                        snap_done = False
> +                if not snap_done:
> +                    break
> +
>              # All is completed so we can finally close out this workflow bug.
>              s.bug.tasks_by_name[s.bug.workflow_project].status = 'Fix Released'
>              if promote_to_updates.status == 'Invalid':
>
Khalid Elmously Jan. 31, 2018, 7:29 p.m. | #2
On 2017-12-18 09:34:14 , Kleber Sacilotto de Souza wrote:
> Do not close the tracking bug until all the snap-related tasks are
> either Invalid or Fix Released.
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
> ---
>  stable/wfl/wft/promote_to_updates.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/stable/wfl/wft/promote_to_updates.py b/stable/wfl/wft/promote_to_updates.py
> index d0377cf4..29f6c393 100644
> --- a/stable/wfl/wft/promote_to_updates.py
> +++ b/stable/wfl/wft/promote_to_updates.py
> @@ -141,6 +141,15 @@ class PromoteToUpdates(Promoter):
>                      cinfo('            package promote-to-security status (%s) does not match security-signoff status (%s)' % (promote_to_security.status, security_signoff.status), 'yellow')
>                      break
>  
> +                # Check that all snap tasks are either "Invalid" or "Fix Released"
> +                snap_done = True
> +                for taskname in s.bug.tasks_by_name:
> +                    if taskname.startswith('snap-') and s.bug.tasks_by_name[taskname].status not in ['Invalid', 'Fix Released']:
> +                        cinfo('            %s is neither "Fix Released" nor "Invalid" (%s)' % (taskname, s.bug.tasks_by_name[taskname].status), 'yellow')
> +                        snap_done = False
> +                if not snap_done:
> +                    break
> +
>              # All is completed so we can finally close out this workflow bug.
>              s.bug.tasks_by_name[s.bug.workflow_project].status = 'Fix Released'
>              if promote_to_updates.status == 'Invalid':



I don't know much about the 'snap-related tasks' - but could they also end up as 'Won't fix" ?

Either way:
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Kleber Sacilotto de Souza Feb. 1, 2018, 9:04 a.m. | #3
On 01/31/18 20:29, Khaled Elmously wrote:
> On 2017-12-18 09:34:14 , Kleber Sacilotto de Souza wrote:
>> Do not close the tracking bug until all the snap-related tasks are
>> either Invalid or Fix Released.
>>
>> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
>> ---
>>  stable/wfl/wft/promote_to_updates.py | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/stable/wfl/wft/promote_to_updates.py b/stable/wfl/wft/promote_to_updates.py
>> index d0377cf4..29f6c393 100644
>> --- a/stable/wfl/wft/promote_to_updates.py
>> +++ b/stable/wfl/wft/promote_to_updates.py
>> @@ -141,6 +141,15 @@ class PromoteToUpdates(Promoter):
>>                      cinfo('            package promote-to-security status (%s) does not match security-signoff status (%s)' % (promote_to_security.status, security_signoff.status), 'yellow')
>>                      break
>>  
>> +                # Check that all snap tasks are either "Invalid" or "Fix Released"
>> +                snap_done = True
>> +                for taskname in s.bug.tasks_by_name:
>> +                    if taskname.startswith('snap-') and s.bug.tasks_by_name[taskname].status not in ['Invalid', 'Fix Released']:
>> +                        cinfo('            %s is neither "Fix Released" nor "Invalid" (%s)' % (taskname, s.bug.tasks_by_name[taskname].status), 'yellow')
>> +                        snap_done = False
>> +                if not snap_done:
>> +                    break
>> +
>>              # All is completed so we can finally close out this workflow bug.
>>              s.bug.tasks_by_name[s.bug.workflow_project].status = 'Fix Released'
>>              if promote_to_updates.status == 'Invalid':
> 
> 
> 
> I don't know much about the 'snap-related tasks' - but could they also end up as 'Won't fix" ?

Semantically 'Invalid' and 'Won't fix' are pretty similar in this case,
but our tools handle all the tasks that are not going to be done as
'Invalid'.

Thanks,
Kleber

> 
> Either way:
> Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
>
Kleber Sacilotto de Souza Feb. 6, 2018, 3:43 p.m. | #4
On 12/18/17 12:34, Kleber Sacilotto de Souza wrote:
> Do not close the tracking bug until all the snap-related tasks are
> either Invalid or Fix Released.
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
> ---
>  stable/wfl/wft/promote_to_updates.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/stable/wfl/wft/promote_to_updates.py b/stable/wfl/wft/promote_to_updates.py
> index d0377cf4..29f6c393 100644
> --- a/stable/wfl/wft/promote_to_updates.py
> +++ b/stable/wfl/wft/promote_to_updates.py
> @@ -141,6 +141,15 @@ class PromoteToUpdates(Promoter):
>                      cinfo('            package promote-to-security status (%s) does not match security-signoff status (%s)' % (promote_to_security.status, security_signoff.status), 'yellow')
>                      break
>  
> +                # Check that all snap tasks are either "Invalid" or "Fix Released"
> +                snap_done = True
> +                for taskname in s.bug.tasks_by_name:
> +                    if taskname.startswith('snap-') and s.bug.tasks_by_name[taskname].status not in ['Invalid', 'Fix Released']:
> +                        cinfo('            %s is neither "Fix Released" nor "Invalid" (%s)' % (taskname, s.bug.tasks_by_name[taskname].status), 'yellow')
> +                        snap_done = False
> +                if not snap_done:
> +                    break
> +
>              # All is completed so we can finally close out this workflow bug.
>              s.bug.tasks_by_name[s.bug.workflow_project].status = 'Fix Released'
>              if promote_to_updates.status == 'Invalid':
> 

Applied to kteam-tools/master branch.

Thanks,
Kleber

Patch

diff --git a/stable/wfl/wft/promote_to_updates.py b/stable/wfl/wft/promote_to_updates.py
index d0377cf4..29f6c393 100644
--- a/stable/wfl/wft/promote_to_updates.py
+++ b/stable/wfl/wft/promote_to_updates.py
@@ -141,6 +141,15 @@  class PromoteToUpdates(Promoter):
                     cinfo('            package promote-to-security status (%s) does not match security-signoff status (%s)' % (promote_to_security.status, security_signoff.status), 'yellow')
                     break
 
+                # Check that all snap tasks are either "Invalid" or "Fix Released"
+                snap_done = True
+                for taskname in s.bug.tasks_by_name:
+                    if taskname.startswith('snap-') and s.bug.tasks_by_name[taskname].status not in ['Invalid', 'Fix Released']:
+                        cinfo('            %s is neither "Fix Released" nor "Invalid" (%s)' % (taskname, s.bug.tasks_by_name[taskname].status), 'yellow')
+                        snap_done = False
+                if not snap_done:
+                    break
+
             # All is completed so we can finally close out this workflow bug.
             s.bug.tasks_by_name[s.bug.workflow_project].status = 'Fix Released'
             if promote_to_updates.status == 'Invalid':