← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/snap-failed-build-requests into lp:launchpad

 

Review: Approve code



Diff comments:

> 
> === modified file 'lib/lp/snappy/model/snap.py'
> --- lib/lp/snappy/model/snap.py	2018-09-13 15:21:05 +0000
> +++ lib/lp/snappy/model/snap.py	2018-09-27 13:59:29 +0000
> @@ -676,6 +676,14 @@
>              self, statuses=(JobStatus.WAITING, JobStatus.RUNNING))
>          return [SnapBuildRequest.fromJob(job) for job in jobs]
>  
> +    @property
> +    def failed_build_requests(self):
> +        """See `ISnap`."""
> +        job_source = getUtility(ISnapRequestBuildsJobSource)
> +        # The returned jobs are ordered by descending ID.
> +        jobs = job_source.findBySnap(self, statuses=(JobStatus.FAILED,))
> +        return [SnapBuildRequest.fromJob(job) for job in jobs]

Unlike pending_build_requests, this can conceivably be a very large set and probably wants to be batched.

> +
>      def _getBuilds(self, filter_term, order_by):
>          """The actual query to get the builds."""
>          query_args = [


-- 
https://code.launchpad.net/~cjwatson/launchpad/snap-failed-build-requests/+merge/355773
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References