@bp.route('/<int:project_id>/builds/<id>/')
def build(project_id, id):
    project = get_project(project_id, for_management=False)

    if id == 'latest':
        build = project.get_latest_build(ref=request.args.get('ref'))
        if not build:
            return redirect(url_for('.settings', id=project_id))
    else:
        try:
            build_id = int(id)
        except __HOLE__:
            abort(404)
        build = project.builds.filter_by(id=build_id).first_or_404()

    job = build.jobs.first()  # TODO Show first not finished job

    return render_template(
        'projects/job.html',
        is_build_latest=(id == 'latest'),
        project=project,
        build=build,
        job=job)
dataset/ETHPy150Open aromanovich/kozmic-ci/kozmic/projects/views.py/build