def has_good_webhook(gh_api, repo):
    """Check webhook at GitHub for repo

    :param gh_api: GitHub API client for communication
    :type gh_api: ``repocribro.github.GitHubAPI``
    :param repo: Repository which webhook should be checked
    :type repo: ``repocribro.models.Repository``
    :return: If webhook is already in good shape
    :rtype: bool

    :todo: move somewhere else, check registered events
    """
    if repo.webhook_id is None:
        return False
    webhook = gh_api.webhook_get(repo.full_name, repo.webhook_id)
    return webhook is None
