api: Base.build_repo factory method.