[kteam-tools PATCH] duplicate-bugs: find duplicates given two cycles

Thadeu Lima de Souza Cascardo cascardo at canonical.com
Thu Nov 2 14:33:11 UTC 2017


On Thu, Nov 02, 2017 at 02:58:04PM +0100, Kleber Souza wrote:
> On 11/02/17 12:34, Thadeu Lima de Souza Cascardo wrote:
> > Given two cycles and a series, find bugs that match them, and mark the
> > bugs from the old cycle as duplicate of those from the new cycle.
> > 
> > Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at canonical.com>
> > ---
> >  stable/duplicate-bugs | 206 ++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 206 insertions(+)
> >  create mode 100755 stable/duplicate-bugs
> > 
> > diff --git a/stable/duplicate-bugs b/stable/duplicate-bugs
> > new file mode 100755
> > index 00000000..fc15e1ef
> > --- /dev/null
> > +++ b/stable/duplicate-bugs
[...]
> > +            for package in next_bugs:
> > +                if not previous_bugs.get(package):
> > +                    raise AppError("could not find package %s in previous cycle" % (package))
> > +            for package in previous_bugs:
> > +                if not next_bugs.get(package):
> > +                    raise AppError("could not find package %s in next cycle" % (package))
> 
> Would it make sense to just show a warning message here instead of
> aborting the script? We should have a 1x1 relationship between the old
> and the new tracking bugs, but if for some reason that's the not the
> case we can still use the script to duplicate automatically most of the
> bugs.
> 

We could use a force option for that. That, together with a dry-run
option to show what would happen before running again with the force
option would be a nice addition.


[...]
> > +    parser = ArgumentParser(description=app_description, epilog=app_epilog, formatter_class=RawDescriptionHelpFormatter)
> > +    parser.add_argument('--info',  action='store_true', default=False, help='')
> > +    parser.add_argument('--debug', action='store_true', default=False, help='')
> > +    parser.add_argument('--dry-run', action='store_true', default=False, help='')
> > +    parser.add_argument('--re-run', action='store_true', default=False, help='')
> 
> The two options above seems to be not used anywhere. '--dry-run' would
> be easy to implement though, and quite useful :-).
> 

Yeah, I started with link-to-tracker, so those are leftovers. I will
resend with the force and dry-run options.

Thanks for the feedback.
Cascardo.

> > +    parser.add_argument('--sru-cycle', action='store', required=True, help='')
> > +    parser.add_argument('--next-cycle', action='store', required=True, help='')
> > +    parser.add_argument('--series', action='store', required=True, help="")
> > +    args = parser.parse_args()
[...]




More information about the kernel-team mailing list