[kteam-tools] link-to-tracker: accept series in tracking bug tags

Message ID 20171031155755.22304-1-cascardo@canonical.com
State New
Headers show
Series
  • [kteam-tools] link-to-tracker: accept series in tracking bug tags
Related show

Commit Message

Thadeu Lima de Souza Cascardo Oct. 31, 2017, 3:57 p.m.
If the series is found in the tracking bug tags, consider it as a
candidate. This allows us to consider bugs whose nomination for the
series task has not been accepted yet.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 stable/link-to-tracker | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Kleber Souza Nov. 1, 2017, 10:10 a.m. | #1
On 10/31/17 16:57, Thadeu Lima de Souza Cascardo wrote:
> If the series is found in the tracking bug tags, consider it as a
> candidate. This allows us to consider bugs whose nomination for the
> series task has not been accepted yet.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

It seems reasonable to me.

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  stable/link-to-tracker | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/stable/link-to-tracker b/stable/link-to-tracker
> index bb31d973..559d7541 100755
> --- a/stable/link-to-tracker
> +++ b/stable/link-to-tracker
> @@ -172,13 +172,15 @@ class Tracking():
>                  if not title.startswith(target_package + ':'):
>                      continue
>                  tasks_by_name = s.create_tasks_by_name_mapping(bugid, s.project_tracked)
> -                if '%s (Ubuntu %s)' % (target_package, target_series.title()) in tasks_by_name:
> -                    found_tasks.append((bugid, tasks_by_name))
> +                found_tasks.append((bugid, tasks_by_name))
>  
>              # Look through the list and see what we have -- pick out the open ones.
>              found = []
>              for (bugid, tasks_by_name) in found_tasks:
>                  lpbug = s.launchpad.bugs[bugid]
> +                if '%s (Ubuntu %s)' % (target_package, target_series.title()) not in tasks_by_name and \
> +                        target_series not in lpbug.tags:
> +                    continue
>                  if not s.args.re_run and '<version to be filled>' not in lpbug.title:
>                      continue
>                  if s.args.sru_cycle and s.bug_to_sru_cycle(lpbug) != s.args.sru_cycle:
>
Marcelo Henrique Cerri Nov. 1, 2017, 11:20 a.m. | #2
Acked-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
Kleber Souza Nov. 14, 2017, 4:01 p.m. | #3
Applied to kteam-tools/master branch. Thanks.

Patch

diff --git a/stable/link-to-tracker b/stable/link-to-tracker
index bb31d973..559d7541 100755
--- a/stable/link-to-tracker
+++ b/stable/link-to-tracker
@@ -172,13 +172,15 @@  class Tracking():
                 if not title.startswith(target_package + ':'):
                     continue
                 tasks_by_name = s.create_tasks_by_name_mapping(bugid, s.project_tracked)
-                if '%s (Ubuntu %s)' % (target_package, target_series.title()) in tasks_by_name:
-                    found_tasks.append((bugid, tasks_by_name))
+                found_tasks.append((bugid, tasks_by_name))
 
             # Look through the list and see what we have -- pick out the open ones.
             found = []
             for (bugid, tasks_by_name) in found_tasks:
                 lpbug = s.launchpad.bugs[bugid]
+                if '%s (Ubuntu %s)' % (target_package, target_series.title()) not in tasks_by_name and \
+                        target_series not in lpbug.tags:
+                    continue
                 if not s.args.re_run and '<version to be filled>' not in lpbug.title:
                     continue
                 if s.args.sru_cycle and s.bug_to_sru_cycle(lpbug) != s.args.sru_cycle: