Skip to content

Commit

Permalink
ref: remove dead get_pr_commits function (#83576)
Browse files Browse the repository at this point in the history
function was indented improperly and never called

<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored Jan 16, 2025
1 parent 93574c4 commit a74b45a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
5 changes: 0 additions & 5 deletions src/sentry_plugins/github/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ def compare_commits(self, repo, start_sha, end_sha):
# where start sha is oldest and end is most recent
return self.get(f"/repos/{repo}/compare/{start_sha}...{end_sha}")

def get_pr_commits(self, repo, num):
# see https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request
# Max: 250 Commits
return self.get(f"/repos/{repo}/pulls/{num}/commits")


class GithubPluginClient(GithubPluginClientMixin, AuthApiClient):
def __init__(self, url=None, auth=None):
Expand Down
15 changes: 0 additions & 15 deletions src/sentry_plugins/github/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,21 +423,6 @@ def compare_commits(self, repo, start_sha, end_sha, actor=None):
else:
return self._format_commits(repo, res["commits"])

def get_pr_commits(self, repo, number, actor=None):
# (not currently used by sentry)
if actor is None:
raise NotImplementedError("Cannot fetch commits anonymously")

# use config name because that is kept in sync via webhooks
name = repo.config["name"]
try:
with self.get_client(actor) as client:
res = client.get_pr_commits(name, number)
except Exception as e:
self.raise_error(e)
else:
return self._format_commits(repo, res)


class GitHubAppsRepositoryProvider(GitHubRepositoryProvider):
name = "GitHub Apps"
Expand Down

0 comments on commit a74b45a

Please sign in to comment.