def format_data(self, data):
"""Re-format the response data for the front-end.
Arguments:
data (:py:class:`dict`): The JSON data from the response.
Returns:
:py:class:`dict`: The re-formatted data.
"""
commits = {commit['id']: commit for commit in data.get('commits', [])}
builds = [
self.format_build(build, commits.get(build.get('commit_id'), {}))
for build in data.get('builds', [])
]
estimate_time(builds)
return dict(
builds=builds[:4],
health=health_summary(builds),
name=self.repo,
)
评论列表
文章目录