[RFC 07/11] REST: Add Patch Checks to the API

Finucane, Stephen stephen.finucane at intel.com
Tue May 17 23:33:53 AEST 2016

On 12 May 14:04, Andy Doan wrote:
> On 05/11/2016 03:57 AM, Finucane, Stephen wrote:
> >On 10 May 17:30, Andy Doan wrote:
> >>On 05/09/2016 08:58 AM, Finucane, Stephen wrote:
> >>>On 15 Apr 13:24, Andy Doan wrote:
> >>>>+patches_router = NestedSimpleRouter(router, r'patches', lookup='patch')
> >>>>+patches_router.register(r'checks', ChecksViewSet, base_name='patch-checks')
> >>>>+patches_router.register(r'check', CheckViewSet, base_name='patch-check')
> >>>
> >>>I think that 'check' would be more valuable as part of the 'patch'
> >>>endpoint, rather than as a separate endpoint. The whole idea of 'check'
> >>>is to provide a quick overview of the status, before delving into more
> >>>detailed results via 'checks'.
> >>
> >>The problem with putting "check" into the Patch endpoint is that we
> >>have an explosion of DB hits (self.check_set.all() for each Patch).
> >
> >Had a similar issue with the patch list screen: that was resolved using
> >'prefetch_related' [1]. Seems like it's possible to do the same thing
> >with DRF [2][3]?
> great tip. i've fixed this in code. I'll include this in my v3 patch
> set. You want me to send that now, or wait till i get your feedback
> on my v2 set?

Reviewed v2, so send in v3 now :)


More information about the Patchwork mailing list