diff mbox

[kteam-tools,v3] verify-release-ready: fix for new style of release tb

Message ID 20170502134909.9088-1-kleber.souza@canonical.com
State New
Headers show

Commit Message

Kleber Sacilotto de Souza May 2, 2017, 1:49 p.m. UTC
The check for the 'release tracking bug' was still looking for the old
style tracking bug on the changelog:

  * Release Tracking Bug
    - LP: #<lp number>

Change it catch only the new style:

  * linux: <version> -proposed tracker (LP: #<lp number>)

Also fails the check if <lp number> is not an integer.

v2 -> v3:
- remove check for old style entry
- check if <lp number> is an integer
- fix the check for the tb on the master branch
- remove an unused variable

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 maintscripts/verify-release-ready | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

Comments

Stefan Bader May 23, 2017, 7:08 a.m. UTC | #1
On 02.05.2017 15:49, Kleber Sacilotto de Souza wrote:
> The check for the 'release tracking bug' was still looking for the old
> style tracking bug on the changelog:

This is one of several that seem to be sitting in my inbox without any response.
Just not sure whether these changes are still wanted or have been replaced by
other patches...

-Stefan

> 
>   * Release Tracking Bug
>     - LP: #<lp number>
> 
> Change it catch only the new style:
> 
>   * linux: <version> -proposed tracker (LP: #<lp number>)
> 
> Also fails the check if <lp number> is not an integer.
> 
> v2 -> v3:
> - remove check for old style entry
> - check if <lp number> is an integer
> - fix the check for the tb on the master branch
> - remove an unused variable
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
>  maintscripts/verify-release-ready | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready
> index 68ef15be..a0390aa5 100755
> --- a/maintscripts/verify-release-ready
> +++ b/maintscripts/verify-release-ready
> @@ -215,17 +215,18 @@ class VerifyReleaseReady():
>          #
>          found_tracker = False
>          for line in changelog[1]['content']:
> -            if found_tracker:
> -                if '#' in line:
> +            if '-proposed tracker' in line:
> +                found_tracker = True
> +                try:
>                      (junk, tracker_id) = line.split('#')
> -                else:
> +                    (tracker_id,junk) = tracker_id.split(')')
> +                    tracker_id = int(tracker_id)
> +                except:
>                      tracker_id = 'warning'
>                  s.status('conformant release tracking bug line', tracker_id)
>                  if tracker_id == 'warning':
>                      stdo(colored('\t%s\n' % line, 'yellow'))
>                  break
> -            if 'Tracking Bug' in line:
> -                found_tracker = True
>          s.status('release tracking bug', found_tracker)
>  
>          # If we are on a topic branch make sure we are not re-using the same tracking
> @@ -238,15 +239,16 @@ class VerifyReleaseReady():
>                  master_changelog = Debian.master_changelog()
>                  found_tracker = False
>                  master_tracker_id = 'NOT-FOUND'
> -                l = 0
>                  for line in master_changelog[1]['content']:
> -                    l += 1
> -                    if found_tracker:
> -                        if '#' in line:
> +                    if '-proposed tracker' in line:
> +                        try:
>                              (junk, master_tracker_id) = line.split('#')
> +                            (master_tracker_id, junk) = master_tracker_id.split(')')
> +                            master_tracker_id = int(master_tracker_id)
> +                            found_tracker = True
> +                        except:
> +                            break
>                          break
> -                    if 'Tracking Bug' in line:
> -                        found_tracker = True
>  
>                  if found_tracker:
>                      unique_tracker = tracker_id != master_tracker_id
>
Colin Ian King May 23, 2017, 8:34 a.m. UTC | #2
On 02/05/17 14:49, Kleber Sacilotto de Souza wrote:
> The check for the 'release tracking bug' was still looking for the old
> style tracking bug on the changelog:
> 
>   * Release Tracking Bug
>     - LP: #<lp number>
> 
> Change it catch only the new style:
> 
>   * linux: <version> -proposed tracker (LP: #<lp number>)
> 
> Also fails the check if <lp number> is not an integer.
> 
> v2 -> v3:
> - remove check for old style entry
> - check if <lp number> is an integer
> - fix the check for the tb on the master branch
> - remove an unused variable
> 
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> ---
>  maintscripts/verify-release-ready | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready
> index 68ef15be..a0390aa5 100755
> --- a/maintscripts/verify-release-ready
> +++ b/maintscripts/verify-release-ready
> @@ -215,17 +215,18 @@ class VerifyReleaseReady():
>          #
>          found_tracker = False
>          for line in changelog[1]['content']:
> -            if found_tracker:
> -                if '#' in line:
> +            if '-proposed tracker' in line:
> +                found_tracker = True
> +                try:
>                      (junk, tracker_id) = line.split('#')
> -                else:
> +                    (tracker_id,junk) = tracker_id.split(')')
> +                    tracker_id = int(tracker_id)
> +                except:
>                      tracker_id = 'warning'
>                  s.status('conformant release tracking bug line', tracker_id)
>                  if tracker_id == 'warning':
>                      stdo(colored('\t%s\n' % line, 'yellow'))
>                  break
> -            if 'Tracking Bug' in line:
> -                found_tracker = True
>          s.status('release tracking bug', found_tracker)
>  
>          # If we are on a topic branch make sure we are not re-using the same tracking
> @@ -238,15 +239,16 @@ class VerifyReleaseReady():
>                  master_changelog = Debian.master_changelog()
>                  found_tracker = False
>                  master_tracker_id = 'NOT-FOUND'
> -                l = 0
>                  for line in master_changelog[1]['content']:
> -                    l += 1
> -                    if found_tracker:
> -                        if '#' in line:
> +                    if '-proposed tracker' in line:
> +                        try:
>                              (junk, master_tracker_id) = line.split('#')
> +                            (master_tracker_id, junk) = master_tracker_id.split(')')
> +                            master_tracker_id = int(master_tracker_id)
> +                            found_tracker = True
> +                        except:
> +                            break
>                          break
> -                    if 'Tracking Bug' in line:
> -                        found_tracker = True
>  
>                  if found_tracker:
>                      unique_tracker = tracker_id != master_tracker_id
> 
Seems reasonable to me.

Acked-by: Colin Ian King <colin.king@canonical.com>
Kleber Sacilotto de Souza May 23, 2017, 9:20 a.m. UTC | #3
On 05/23/17 09:08, Stefan Bader wrote:
> On 02.05.2017 15:49, Kleber Sacilotto de Souza wrote:
>> The check for the 'release tracking bug' was still looking for the old
>> style tracking bug on the changelog:
> 
> This is one of several that seem to be sitting in my inbox without any response.
> Just not sure whether these changes are still wanted or have been replaced by
> other patches...

This is still needed, not fixed yet.

Kleber

> 
> -Stefan
> 
>>
>>   * Release Tracking Bug
>>     - LP: #<lp number>
>>
>> Change it catch only the new style:
>>
>>   * linux: <version> -proposed tracker (LP: #<lp number>)
>>
>> Also fails the check if <lp number> is not an integer.
>>
>> v2 -> v3:
>> - remove check for old style entry
>> - check if <lp number> is an integer
>> - fix the check for the tb on the master branch
>> - remove an unused variable
>>
>> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
>> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
>> ---
>>  maintscripts/verify-release-ready | 24 +++++++++++++-----------
>>  1 file changed, 13 insertions(+), 11 deletions(-)
>>
>> diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready
>> index 68ef15be..a0390aa5 100755
>> --- a/maintscripts/verify-release-ready
>> +++ b/maintscripts/verify-release-ready
>> @@ -215,17 +215,18 @@ class VerifyReleaseReady():
>>          #
>>          found_tracker = False
>>          for line in changelog[1]['content']:
>> -            if found_tracker:
>> -                if '#' in line:
>> +            if '-proposed tracker' in line:
>> +                found_tracker = True
>> +                try:
>>                      (junk, tracker_id) = line.split('#')
>> -                else:
>> +                    (tracker_id,junk) = tracker_id.split(')')
>> +                    tracker_id = int(tracker_id)
>> +                except:
>>                      tracker_id = 'warning'
>>                  s.status('conformant release tracking bug line', tracker_id)
>>                  if tracker_id == 'warning':
>>                      stdo(colored('\t%s\n' % line, 'yellow'))
>>                  break
>> -            if 'Tracking Bug' in line:
>> -                found_tracker = True
>>          s.status('release tracking bug', found_tracker)
>>  
>>          # If we are on a topic branch make sure we are not re-using the same tracking
>> @@ -238,15 +239,16 @@ class VerifyReleaseReady():
>>                  master_changelog = Debian.master_changelog()
>>                  found_tracker = False
>>                  master_tracker_id = 'NOT-FOUND'
>> -                l = 0
>>                  for line in master_changelog[1]['content']:
>> -                    l += 1
>> -                    if found_tracker:
>> -                        if '#' in line:
>> +                    if '-proposed tracker' in line:
>> +                        try:
>>                              (junk, master_tracker_id) = line.split('#')
>> +                            (master_tracker_id, junk) = master_tracker_id.split(')')
>> +                            master_tracker_id = int(master_tracker_id)
>> +                            found_tracker = True
>> +                        except:
>> +                            break
>>                          break
>> -                    if 'Tracking Bug' in line:
>> -                        found_tracker = True
>>  
>>                  if found_tracker:
>>                      unique_tracker = tracker_id != master_tracker_id
>>
> 
> 
> 
>
Stefan Bader May 23, 2017, 9:30 a.m. UTC | #4

Kleber Sacilotto de Souza May 23, 2017, 11:44 a.m. UTC | #5

diff mbox

Patch

diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready
index 68ef15be..a0390aa5 100755
--- a/maintscripts/verify-release-ready
+++ b/maintscripts/verify-release-ready
@@ -215,17 +215,18 @@  class VerifyReleaseReady():
         #
         found_tracker = False
         for line in changelog[1]['content']:
-            if found_tracker:
-                if '#' in line:
+            if '-proposed tracker' in line:
+                found_tracker = True
+                try:
                     (junk, tracker_id) = line.split('#')
-                else:
+                    (tracker_id,junk) = tracker_id.split(')')
+                    tracker_id = int(tracker_id)
+                except:
                     tracker_id = 'warning'
                 s.status('conformant release tracking bug line', tracker_id)
                 if tracker_id == 'warning':
                     stdo(colored('\t%s\n' % line, 'yellow'))
                 break
-            if 'Tracking Bug' in line:
-                found_tracker = True
         s.status('release tracking bug', found_tracker)
 
         # If we are on a topic branch make sure we are not re-using the same tracking
@@ -238,15 +239,16 @@  class VerifyReleaseReady():
                 master_changelog = Debian.master_changelog()
                 found_tracker = False
                 master_tracker_id = 'NOT-FOUND'
-                l = 0
                 for line in master_changelog[1]['content']:
-                    l += 1
-                    if found_tracker:
-                        if '#' in line:
+                    if '-proposed tracker' in line:
+                        try:
                             (junk, master_tracker_id) = line.split('#')
+                            (master_tracker_id, junk) = master_tracker_id.split(')')
+                            master_tracker_id = int(master_tracker_id)
+                            found_tracker = True
+                        except:
+                            break
                         break
-                    if 'Tracking Bug' in line:
-                        found_tracker = True
 
                 if found_tracker:
                     unique_tracker = tracker_id != master_tracker_id