<commit_before>class Github

  def self.authorization_url(redirect)
    Backend.blocking_worker "circle.workers.github/authorization-url", redirect
  end

  def self.fetch_access_token(user, code)
    Backend.start_worker "circle.workers.github/fetch-github-access-token", user.id.to_s, code
  end

  def self.tentacles(command, user)
    token = user.github_access_token
    Backend.start_worker "tentacles.#{command}", "oauth_token" => token
  end

  def self.all_repos(user)
    token = user.github_access_token
    Backend.start_worker "circle.workers.github/all-repos", token
  end

  def self.add_deploy_key(user, project, username, reponame)
    # TECHNICAL_DEBT .id.to_s should use the ruby->clojure layer
    Backend.fire_worker "circle.workers.github/add-deploy-key", username, reponame, user.github_access_token, project._id.to_s
  end

  def self.add_commit_hook(username, reponame, user)
    Backend.fire_worker "circle.workers.github/add-hooks", username, reponame, user.github_access_token
  end

end<commit_msg>Ensure that projects have at most one hook<commit_after>class Github

  def self.authorization_url(redirect)
    Backend.blocking_worker "circle.workers.github/authorization-url", redirect
  end

  def self.fetch_access_token(user, code)
    Backend.start_worker "circle.workers.github/fetch-github-access-token", user.id.to_s, code
  end

  def self.tentacles(command, user)
    token = user.github_access_token
    Backend.start_worker "tentacles.#{command}", "oauth_token" => token
  end

  def self.all_repos(user)
    token = user.github_access_token
    Backend.start_worker "circle.workers.github/all-repos", token
  end

  def self.add_deploy_key(user, project, username, reponame)
    # TECHNICAL_DEBT .id.to_s should use the ruby->clojure layer
    Backend.fire_worker "circle.workers.github/add-deploy-key", username, reponame, user.github_access_token, project._id.to_s
  end

  def self.add_commit_hook(username, reponame, user)
    Backend.fire_worker "circle.workers.github/ensure-hooks", username, reponame, user.github_access_token
  end

end
{'fraction_non_alphanumeric': 0.09971236816874401, 'fraction_numerical': 0.0, 'mean_word_length': 4.640540540540541, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '709474', 'n_tokens_mistral': 715, 'n_tokens_neox': 695, 'n_words': 134}