def format_build(cls, build, commit): # pylint: disable=arguments-differ
"""Re-format the build and commit data for the front-end.
Arguments:
build (:py:class:`dict`): The build data from the response.
commit (:py:class:`dict`): The commit data from the response.
Returns:
:py:class:`dict`: The re-formatted data.
"""
start, finish, elapsed = elapsed_time(
build.get('started_at'),
build.get('finished_at'),
)
return super().format_build(dict(
author=commit.get('author_name'),
duration=(
None if start is None or finish is None else finish - start
),
elapsed=elapsed,
message=commit.get('message'),
outcome=build.get('state'),
started_at=start,
))
评论列表
文章目录