diff mbox

[kteam-tools,v2,3/3,verify-release-ready] Also check display name 'linux' for derivative fixes

Message ID 20170704074456.10027-4-juerg.haefliger@canonical.com
State New
Headers show

Commit Message

Juerg Haefliger July 4, 2017, 7:44 a.m. UTC
Currently, if the script is run against a derivative package, fixes
that have been reported against the master and brought in through a
rebase are incorrectly flagged as:
  LP: #<bug> is not package linux-<derivative>

Fix this by also checking for 'linux' as a valid diplay name, but only
if the package is a derivative.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
---
 maintscripts/verify-release-ready | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

Comments

Andy Whitcroft July 4, 2017, 3:02 p.m. UTC | #1
On Tue, Jul 04, 2017 at 09:44:56AM +0200, Juerg Haefliger wrote:
> Currently, if the script is run against a derivative package, fixes
> that have been reported against the master and brought in through a
> rebase are incorrectly flagged as:
>   LP: #<bug> is not package linux-<derivative>
> 
> Fix this by also checking for 'linux' as a valid diplay name, but only
> if the package is a derivative.
> 
> Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
> ---
>  maintscripts/verify-release-ready | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready
> index 55d9ff0d56d1..539366a212b1 100755
> --- a/maintscripts/verify-release-ready
> +++ b/maintscripts/verify-release-ready
> @@ -356,6 +356,13 @@ class VerifyReleaseReady():
>          changelog_series = changelog[1]['series']
>          changelog_source_package = changelog[1]['package']
>  
> +        # juergh: Is this a derivative package?
> +        derivative = False
> +        if ((changelog_source_package != 'linux' and
> +             not changelog_source_package.startswith('linux-lts-') and
> +             not changelog_source_package.startswith('linux-hwe'))):
> +            derivative = True
> +
>          tracker = None
>  
>          for bug in changelog_bugs:
> @@ -377,13 +384,19 @@ class VerifyReleaseReady():
>              is_fix_committed = False
>              for task in lp_bug.bug_tasks:
>                  task_display_name = task.bug_target_display_name.lower()
> -                # if the display name 'linux (ubuntu X)' matches our package continue
> -                if changelog_source_package in task_display_name:
> +
> +                # if the display name 'linux (ubuntu X)' matches our package
> +                # or the package is a derivative and the diplay name is 'linux'
> +                # (which means the fix is in the master tree), continue...
> +                if ((task_display_name.startswith(changelog_source_package + ' ') or
> +                     (derivative and task_display_name.startswith('linux ')))):
>                      is_targeted_to_package = True

These names are "normally" the right format for this, but you might
consider using the task.self_link which is more predicatable in form.

> +
>                      # if the display name contains the series, or we are devel continue
>                      if (changelog_series in task_display_name) or \
>                         (changelog_series == s.lp_devel_series.displayname.lower()):
>                          is_targeted_to_series = True
> +
>                          # if we are on a devel or series targeted task check status of that task
>                          if task.status in (u'Fix Committed', u'Fix Released'):
>                              is_fix_committed = True
> -- 
> 2.11.0
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Juerg Haefliger July 5, 2017, 6:02 a.m. UTC | #2
>>          for bug in changelog_bugs:
>> @@ -377,13 +384,19 @@ class VerifyReleaseReady():
>>              is_fix_committed = False
>>              for task in lp_bug.bug_tasks:
>>                  task_display_name = task.bug_target_display_name.lower()
>> -                # if the display name 'linux (ubuntu X)' matches our package continue
>> -                if changelog_source_package in task_display_name:
>> +
>> +                # if the display name 'linux (ubuntu X)' matches our package
>> +                # or the package is a derivative and the diplay name is 'linux'
>> +                # (which means the fix is in the master tree), continue...
>> +                if ((task_display_name.startswith(changelog_source_package + ' ') or
>> +                     (derivative and task_display_name.startswith('linux ')))):
>>                      is_targeted_to_package = True
> 
> These names are "normally" the right format for this, but you might
> consider using the task.self_link which is more predicatable in form.

I'd rather not introduce a new but attribute but extend the current logic.

...Juerg


>> +
>>                      # if the display name contains the series, or we are devel continue
>>                      if (changelog_series in task_display_name) or \
>>                         (changelog_series == s.lp_devel_series.displayname.lower()):
>>                          is_targeted_to_series = True
>> +
>>                          # if we are on a devel or series targeted task check status of that task
>>                          if task.status in (u'Fix Committed', u'Fix Released'):
>>                              is_fix_committed = True
>> -- 
>> 2.11.0
>>
>>
>> -- 
>> kernel-team mailing list
>> kernel-team@lists.ubuntu.com
>> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Kleber Sacilotto de Souza July 6, 2017, 4:25 p.m. UTC | #3
On 07/05/17 08:02, Juerg Haefliger wrote:
> 
>>>          for bug in changelog_bugs:
>>> @@ -377,13 +384,19 @@ class VerifyReleaseReady():
>>>              is_fix_committed = False
>>>              for task in lp_bug.bug_tasks:
>>>                  task_display_name = task.bug_target_display_name.lower()
>>> -                # if the display name 'linux (ubuntu X)' matches our package continue
>>> -                if changelog_source_package in task_display_name:
>>> +
>>> +                # if the display name 'linux (ubuntu X)' matches our package
>>> +                # or the package is a derivative and the diplay name is 'linux'
>>> +                # (which means the fix is in the master tree), continue...
>>> +                if ((task_display_name.startswith(changelog_source_package + ' ') or
>>> +                     (derivative and task_display_name.startswith('linux ')))):
>>>                      is_targeted_to_package = True
>>
>> These names are "normally" the right format for this, but you might
>> consider using the task.self_link which is more predicatable in form.
> 
> I'd rather not introduce a new but attribute but extend the current logic.
> 

The attribute is already available on the 'task' object, and getting the
exact name of the package affected by the bug could be done by something
like:

re.search('\+source/(.+?)/', task.self_link).group(1)


> ...Juerg
> 
> 
>>> +
>>>                      # if the display name contains the series, or we are devel continue
>>>                      if (changelog_series in task_display_name) or \
>>>                         (changelog_series == s.lp_devel_series.displayname.lower()):
>>>                          is_targeted_to_series = True
>>> +
>>>                          # if we are on a devel or series targeted task check status of that task
>>>                          if task.status in (u'Fix Committed', u'Fix Released'):
>>>                              is_fix_committed = True
>>> -- 
>>> 2.11.0
>>>
>>>
>>> -- 
>>> kernel-team mailing list
>>> kernel-team@lists.ubuntu.com
>>> https://lists.ubuntu.com/mailman/listinfo/kernel-team
> 
> 
>
diff mbox

Patch

diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready
index 55d9ff0d56d1..539366a212b1 100755
--- a/maintscripts/verify-release-ready
+++ b/maintscripts/verify-release-ready
@@ -356,6 +356,13 @@  class VerifyReleaseReady():
         changelog_series = changelog[1]['series']
         changelog_source_package = changelog[1]['package']
 
+        # juergh: Is this a derivative package?
+        derivative = False
+        if ((changelog_source_package != 'linux' and
+             not changelog_source_package.startswith('linux-lts-') and
+             not changelog_source_package.startswith('linux-hwe'))):
+            derivative = True
+
         tracker = None
 
         for bug in changelog_bugs:
@@ -377,13 +384,19 @@  class VerifyReleaseReady():
             is_fix_committed = False
             for task in lp_bug.bug_tasks:
                 task_display_name = task.bug_target_display_name.lower()
-                # if the display name 'linux (ubuntu X)' matches our package continue
-                if changelog_source_package in task_display_name:
+
+                # if the display name 'linux (ubuntu X)' matches our package
+                # or the package is a derivative and the diplay name is 'linux'
+                # (which means the fix is in the master tree), continue...
+                if ((task_display_name.startswith(changelog_source_package + ' ') or
+                     (derivative and task_display_name.startswith('linux ')))):
                     is_targeted_to_package = True
+
                     # if the display name contains the series, or we are devel continue
                     if (changelog_series in task_display_name) or \
                        (changelog_series == s.lp_devel_series.displayname.lower()):
                         is_targeted_to_series = True
+
                         # if we are on a devel or series targeted task check status of that task
                         if task.status in (u'Fix Committed', u'Fix Released'):
                             is_fix_committed = True