NACK: [kteam-tools 1/1] [link-to-tracker] Add a sanity check before modifying a TB

Juerg Haefliger juerg.haefliger at canonical.com
Fri Jun 30 10:28:19 UTC 2017


Scrap that. There are legitimate reasons for doing this, so the sanity
check needs to be smarter. Will send v2.

...Juerg


On 06/29/2017 09:57 AM, Juerg Haefliger wrote:
> The to-be-modified TB should have '<version to be filled>' in its title.
> Bail out if that's not the case to prevent accidents (which happened to
> me twice already).
> 
> Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
> ---
>  stable/link-to-tracker | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/stable/link-to-tracker b/stable/link-to-tracker
> index 356c017c5017..a4df8dfa0cd3 100755
> --- a/stable/link-to-tracker
> +++ b/stable/link-to-tracker
> @@ -165,6 +165,11 @@ class Tracking(object):
>              if not found:
>                  raise AppError('Cannot find tracker bug matching package %s series %s' % (target_package, target_series))
>  
> +            # Sanity check: Bail out if the version is already filled
> +            lpbug = self.launchpad.bugs[bugid]
> +            if 'version to be filled' not in lpbug.title:
> +                raise AppError('Version is already filled for LP #%s (%s)' % (bugid, lpbug.title))
> +
>              # -------------------------------------------------------------------------------------
>              # C H A N G E L O G   W O R K
>  
> @@ -185,10 +190,11 @@ class Tracking(object):
>                      f.write(line)
>              retval = 0
>  
> -            lpbug = self.launchpad.bugs[bugid]
> +            # Update the title of the tracking bug
>              lpbug.title = title
>              lpbug.lp_save()
>  
> +            # Update the state and assignee of the 'prepare-package' task
>              task = tasks_by_name['prepare-package'].lp_task
>              task.status = "In Progress"
>              task.assignee = self.launchpad.me
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 845 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20170630/d8fb36d6/attachment.sig>


More information about the kernel-team mailing list