launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #20350
Re: [Merge] lp:~maxiberta/launchpad/snap-update-build-status-ui into lp:launchpad
Diff comments:
>
> === modified file 'lib/lp/snappy/model/snap.py'
> --- lib/lp/snappy/model/snap.py 2016-05-06 12:46:46 +0000
> +++ lib/lp/snappy/model/snap.py 2016-05-11 16:40:19 +0000
> @@ -326,6 +329,36 @@
> result.order_by(order_by)
> return result
>
> + def getBuildSummariesForSnapBuildIds(self, snap_build_ids):
> + """See `ISnap`."""
> + result = {}
> + filter_term = SnapBuild.id.is_in(snap_build_ids)
> + order_by = Desc(SnapBuild.id)
> + builds = self._getBuilds(filter_term, order_by)
> +
> + for build in builds:
> + build_view = SnapBuildView(build, None)
> + if build_view.date is not None:
> + when_complete = DateTimeFormatterAPI(build_view.date)
This may be questionable; didn't want to duplicate the date calculation and formatting logic.
> + when_complete = when_complete.displaydate()
> + else:
> + when_complete = None
> +
> + if build.log:
> + build_log_size = build.log.content.filesize
> + else:
> + build_log_size = None
> +
> + result[build.id] = {}
> + result[build.id]["status"] = build.status.name
> + result[build.id]["buildstate"] = build.status
> + result[build.id]["when_complete"] = when_complete
> + result[build.id]["when_complete_estimate"] = build_view.estimate
> + result[build.id]["build_log_url"] = build.log_url
> + result[build.id]["build_log_size"] = build_log_size
> +
> + return result
> +
> @property
> def builds(self):
> """See `ISnap`."""
--
https://code.launchpad.net/~maxiberta/launchpad/snap-update-build-status-ui/+merge/294403
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~maxiberta/launchpad/snap-update-build-status-ui into lp:launchpad.