Skip to content

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

Open
mn-ram wants to merge 1 commit intoaugurlabs:fix/disabled_prsfrom
mn-ram:fix/disabled-pr-review-comments
Open

fix: skip PR review comment collection when pull requests are disabled#3798
mn-ram wants to merge 1 commit intoaugurlabs:fix/disabled_prsfrom
mn-ram:fix/disabled-pr-review-comments

Conversation

@mn-ram
Copy link
Copy Markdown

@mn-ram mn-ram commented Mar 27, 2026

Description

Builds on #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.

@mn-ram mn-ram requested a review from sgoggins as a code owner March 27, 2026 02:12
Builds on augurlabs#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 <[email protected]>
@mn-ram mn-ram force-pushed the fix/disabled-pr-review-comments branch from 060a698 to 3ab406d Compare March 27, 2026 02:15
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.

1 participant