Em Tue, 04 Jun 2019 10:10:51 +1000 Daniel Axtens <[email protected]> escreveu:
> Mauro Carvalho Chehab <[email protected]> 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 <[email protected]> > > > > --- > > > > 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 <[email protected]> > 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 <[email protected]> > > 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? Maybe the change was done in order to allow delegating patches to anyone: commit e0fd7cd91a5fbe0a0077c46bea870ccd09c8920d (v1.0.0-154-ge0fd7cd) Author: Stephen Finucane <[email protected]> Date: Mon Aug 24 14:21:43 2015 +0100 Allow assigning of any user as delegate With was reverted one year later: commit 198139e4112cf337ffea403000441931b4ddad06 (v1.1.0-227-g198139e) Author: Stephen Finucane <[email protected]> Date: Sun Sep 25 22:37:11 2016 +0100 Revert "Allow assigning of any user as delegate" > > > 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? Before f439f5414206c94d486c60801a86acc57ad3f273, it used to check for the project ID, but the code with was calling set_project() at the Filter initialization, but this got removed. I don't know enough about Django to re-add it. > I'm thinking of OzLabs where there are a > couple dozen different projects with completely different sets of > people. Either that or the Django's equivalent to: SELECT DISTINCT(p.delegate_id) FROM `patchwork_patch` AS p, patchwork_submission AS s WHERE p.submission_ptr_id = s.id and project_id = <current project> That would, IMHO, be better, as it will only filter for the ones that actually have patches delegated. As a plus, if we ever re-introduce a feature to allow delegating to anyone, this will still work. We're actually considering to have a way to delegate to driver maintainers (with aren't project maintainers at Django). > > 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 > > [email protected] > > https://lists.ozlabs.org/listinfo/patchwork Thanks, Mauro _______________________________________________ Patchwork mailing list [email protected] https://lists.ozlabs.org/listinfo/patchwork
