Skip to content

fix: skip PR review comment collection when pull requests are disabled#393

Open
MoralCode wants to merge 1 commit into
mainfrom
mn-ram/fix/disabled-pr-review-comments
Open

fix: skip PR review comment collection when pull requests are disabled#393
MoralCode wants to merge 1 commit into
mainfrom
mn-ram/fix/disabled-pr-review-comments

Conversation

@MoralCode

Copy link
Copy Markdown
Contributor

The below PR contents are lightly modified (to adjust issue and PR references mostly) from github.com/augurlabs/augur/pull/3745, filed by @mn-ram. The PR itself has been rebased to account for changes to CollectOSS since the fork (there were effectively no merge conflicts)

Description

Builds on augurlabs/augur#3783 which added the check_prs_enabled() infrastructure and applied it to retrieve_all_pr_data.

This PR applies the same check to collect_pull_request_review_comments, which hits the repos/{owner}/{repo}/pulls/comments endpoint. This endpoint also returns 404 when pull requests are disabled on a repo, and previously had no handling for that case — causing an unhandled exception in the secondary collection phase.

Changes:

  • Call check_prs_enabled() early in collect_pull_request_review_comments and return gracefully if PRs are disabled
  • Move GithubRandomKeyAuth and GithubDataAccess instantiation before the check
  • Migrate URL construction to use GithubDataAccess.endpoint_url() following the pattern from retrieve_all_pr_data

Testing

  • Manually add a repo with GitHub pull requests disabled and confirm collect_pull_request_review_comments logs an info message and returns without error

Signed commits

  • Yes, I signed my commits.

Builds on #3783 (check_prs_enabled infrastructure). Applies the same
disabled-PR check to collect_pull_request_review_comments, which hits
the repos/{owner}/{repo}/pulls/comments endpoint — this also returns
404 when PRs are disabled and had no prior handling.

Also migrates the URL construction to use GithubDataAccess.endpoint_url()
following the pattern established in retrieve_all_pr_data.

Signed-off-by: mn-ram <235066282+mn-ram@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants