Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions collectoss/tasks/github/pull_requests/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ def collect_pull_request_review_comments(repo_git: str, full_collection: bool) -
logger = logging.getLogger(collect_pull_request_review_comments.__name__)
logger.debug(f"Collecting pull request review comments for {owner}/{repo}")

key_auth = GithubRandomKeyAuth(logger)
github_data_access = GithubDataAccess(key_auth, logger)

if not github_data_access.check_prs_enabled(owner, repo):
logger.info(f"{owner}/{repo}: Pull requests appear to be disabled for this repo. Skipping review comment collection.")
return

repo_id = get_repo_by_repo_git(repo_git).repo_id

if not full_collection:
Expand All @@ -257,9 +264,6 @@ def collect_pull_request_review_comments(repo_git: str, full_collection: bool) -
tool_version = "2.0"
data_source = "Github API"

key_auth = GithubRandomKeyAuth(logger)
github_data_access = GithubDataAccess(key_auth, logger)

pr_review_comment_batch_size = get_batch_size()

# Batch processing: accumulate comments until batch size reached, then flush
Expand Down
Loading