Skip to content

Handle github repos with disabled pull requests#3783

Open
MoralCode wants to merge 5 commits intomainfrom
fix/disabled_prs
Open

Handle github repos with disabled pull requests#3783
MoralCode wants to merge 5 commits intomainfrom
fix/disabled_prs

Conversation

@MoralCode
Copy link
Copy Markdown
Collaborator

@MoralCode MoralCode commented Mar 20, 2026

Description
Github recently added the ability to disable PRs on repos to help projects handle AI slop in the short term.

For whatever reason, the API for disabled PRs is throwing a 404 error that we werent previously handling because we were assuming these api calls would always exist.

This PR fixes #3731

this is done by creating a new function within the GitHubDataAccess class that is intended to check for these 404s and return in a way that can be used to skip the affected task.

Notes for Reviewers
This PR also includes a forward-looking function that builds on the discussions that have happened around how and where to build URLs to achieve what may be a best of both worlds approach.

Under this new system, GithubDataAccess has endpoint_url, which, when provided with a URL path and optional dictionary of search arguments, assembles a full URL. This puts GitHubDataAccess in charge of providing the base domain for an API call, while leaving callers in charge of the url path they would like to call. The benefits of this include:

  • not littering the GhDA class with individual functions for every endpoint URL, as was the approach in Start consolodating Github REST API URLs into a central place #3685
  • cleaner handling of url query parameters as dictionaries in caller code
  • proper escaping of symbols and other url-unsafe characters that may make it into query parameter strings by using the python url parsing library to handle the urls

Testing
I will test this locally on some known-affected repos from the underlying issue to confirm the fix.

Signed commits

  • Yes, I signed my commits.

for better handling of future query param encoding needs and
sharing responsibility for url creation (GhDA owns the domain/base url, the caller owns the path and query params they want to use)

Signed-off-by: Adrian Edwards <[email protected]>
@MoralCode MoralCode added this to the v0.93.0 milestone Mar 20, 2026
@MoralCode MoralCode requested a review from sgoggins as a code owner March 20, 2026 13:53
@MoralCode MoralCode added the deployed version Live problems with deployed versions label Mar 20, 2026
@MoralCode MoralCode self-assigned this Mar 24, 2026
sgoggins
sgoggins previously approved these changes Mar 25, 2026
mn-ram added a commit to mn-ram/augur that referenced this pull request Mar 27, 2026
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.
mn-ram added a commit to mn-ram/augur that referenced this pull request Mar 27, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deployed version Live problems with deployed versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pull request endpoints 404ing on repos with PRs disabled

2 participants