filters: re-add the possibility of filtering undelegated patches

Daniel Axtens dja at axtens.net
Tue Jun 4 10:10:51 AEST 2019


Mauro Carvalho Chehab <mchehab at infradead.org> writes:

> The filters.py redesign that happened for patchwork 1.1 removed
> a functionality that we use a lot: to filter patches that weren't
> delegated to anyone.
>
> Also, it is a way harder to find someone to delegate with a free
> text input. Use, instead a combo-box just like before.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab at osg.samsung.com>
>
> ---
>
> LinuxTV was using some pre-version 1.0 patchwork instance since
> last week. Migrating was not easy, due to the delegation patches we
> developed for 1.x, that caused the migration scripts to fail.
>
> On Friday, we finally migrated to the latest stable version:
>
> 	https://patchwork.linuxtv.org
>
> After the migration, we noticed that one feature that we used a
> lot got removed from patchwork: the filter was not allowing anymore
> to filter not-delegated patches.
>
> On media, we receive a large amount of patches per week. Just after
> the migration, we received ~30 patches, and that's because it is
> a weekend!
>
> In order to handle such high volume, we have several sub-maintainers,
> each one responsible for one part of the subsystem. While we do have
> delegation rules on patchwork, we still do manual delegation. So,
> being able to see what patches are not on someone's queue is very
> important to us.
>
> This patch restores such feature to patchwork. As a plus, it now
> shows a combo-box with just the names of people that maintain
> projects, instead of a free-text input that would otherwise seek
> the entire user's database.

Right, that seems like a feature we probably should not have killed,
sorry.

It looks like it went away in 2015:

commit f439f5414206c94d486c60801a86acc57ad3f273
Author: Stephen Finucane <stephen.finucane at intel.com>
Date:   Mon Aug 24 11:05:47 2015 +0100

    Add delegate filter autocomplete support
    
    It would be helpful to provide autocomplete functionality for the
    delegate filter field, similar to that provided for the submitter
    field. This will provide a way to handle larger delegate lists without
    overloading the user with options.
    
    Add this functionality through use of Selectize, which is already used
    to provide similar functionality for filtering of "submitters".
    
    Signed-off-by: Stephen Finucane <stephen.finucane at intel.com>

So perhaps reverting that all the way back might not be the way to go,
but we should have something for your usecase.

Stephen, thoughts?

>      def _form(self):
> -        return mark_safe('<input type="text" name="delegate" '
> -                         'id="delegate_input" class="form-control">')
> +        delegates = User.objects.filter(profile__maintainer_projects__isnull = False)

If we were to go down this route, I think we'd want to be filtering
against the project as well? I'm thinking of OzLabs where there are a
couple dozen different projects with completely different sets of
people.

Regards,
Daniel

> +
> +        str = '<select name="delegate">'
> +
> +        selected = ''
> +        if not self.applied:
> +            selected = 'selected'
> +
> +        str += '<option %s value="">------</option>' % selected
> +
> +        selected = ''
> +        if self.applied and self.delegate is None:
> +            selected = 'selected'
> +
> +        str += '<option %s value="%s">%s</option>' % \
> +                (selected, self.no_delegate_str, self.no_delegate_str)
> +
> +        for d in delegates:
> +            selected = ''
> +            if d == self.delegate:
> +                selected = ' selected'
> +
> +            str += '<option %s value="%s">%s</option>' % (selected,
> +                    d.id, d.username)
> +        str += '</select>'
> +
> +        return mark_safe(str)
>  
>      def key(self):
>          if self.delegate:
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork


More information about the Patchwork mailing list