Skip to content

Commit

Permalink
Merge pull request #2975 from chaoss/speed-up-pr-review-comment-colle…
Browse files Browse the repository at this point in the history
…ction

Speed up pr review comment recollection
  • Loading branch information
sgoggins authored Jan 22, 2025
2 parents 67af21b + 57c3c80 commit 8f838ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion augur/tasks/github/pull_requests/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def process_pull_request_review_contributor(pr_review: dict, tool_source: str, t
return pr_review_cntrb

@celery.task(base=AugurSecondaryRepoCollectionTask)
def collect_pull_request_review_comments(repo_git: str) -> None:
def collect_pull_request_review_comments(repo_git: str, full_collection: bool) -> None:

owner, repo = get_owner_repo(repo_git)

Expand All @@ -230,6 +230,11 @@ def collect_pull_request_review_comments(repo_git: str) -> None:

repo_id = get_repo_by_repo_git(repo_git).repo_id

if not full_collection:
# subtract 2 days to ensure all data is collected
core_data_last_collected = (get_core_data_last_collected(repo_id) - timedelta(days=2)).replace(tzinfo=timezone.utc)
review_msg_url += f"?since={core_data_last_collected.isoformat()}"

pr_reviews = get_pull_request_reviews_by_repo_id(repo_id)

# maps the github pr_review id to the auto incrementing pk that augur stores as pr_review id
Expand Down
2 changes: 1 addition & 1 deletion augur/tasks/start_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def secondary_repo_collect_phase(repo_git, full_collection):
repo_task_group = group(
process_pull_request_files.si(repo_git, full_collection),
process_pull_request_commits.si(repo_git, full_collection),
chain(collect_pull_request_reviews.si(repo_git, full_collection), collect_pull_request_review_comments.si(repo_git)),
chain(collect_pull_request_reviews.si(repo_git, full_collection), collect_pull_request_review_comments.si(repo_git, full_collection)),
process_ossf_dependency_metrics.si(repo_git)
)

Expand Down

0 comments on commit 8f838ff

Please sign in to comment.