Enable issues_for_formula to show only issues, only PRs, or both

- This change is useful for the "these issues are also open for this
  build failure" exception. Hopefully there'll be less noise on PRs with
  people encouraging us to fix things faster if we don't link them to
  WIP PRs (or any PRs at all).
- Fixes https://github.com/Homebrew/brew/issues/ 15608.
This commit is contained in:
Issy Long 2023-07-08 22:15:58 +01:00
parent 4bbc0af693
commit b9d8fd4f79
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 3 additions and 3 deletions

View File

@ -489,7 +489,7 @@ class BuildError < RuntimeError
sig { returns(T::Array[T.untyped]) }
def fetch_issues
GitHub.issues_for_formula(formula.name, tap: formula.tap, state: "open")
GitHub.issues_for_formula(formula.name, tap: formula.tap, state: "open", type: "issue")
rescue GitHub::API::RateLimitExceededError => e
opoo e.message
[]

View File

@ -56,10 +56,10 @@ module GitHub
API.open_rest(url_to("repos", user, repo))
end
def self.issues_for_formula(name, tap: CoreTap.instance, tap_remote_repo: tap&.full_name, state: nil)
def self.issues_for_formula(name, tap: CoreTap.instance, tap_remote_repo: tap&.full_name, state: nil, type: nil)
return [] unless tap_remote_repo
search_issues(name, repo: tap_remote_repo, state: state, in: "title")
search_issues(name, repo: tap_remote_repo, state: state, type: type, in: "title")
end
def self.user