def get_koji_build_info(build_id, session, config):
    """
    Returns build information from koji based on build id.

    :param dict build_id: build id of a build in koji.
    :param koji.ClientSession session: koji connection session object
    :return: build information.
    :rtype: dict
    """

    print("Retriewing build metadata from: ", config.koji_host)
    build = session.getBuild(build_id)
    if not build:
        raise Exception("Build with id '{id}' has not been found.".format(id=build_id))

    print("Build with the ID", build_id, "found.")

    return build