From b9d8fd4f790c7fc0fdb713ff72be88240030aab3 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sat, 8 Jul 2023 22:15:58 +0100 Subject: [PATCH] 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. --- Library/Homebrew/exceptions.rb | 2 +- Library/Homebrew/utils/github.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 3c88e79015..273d240e0e 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -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 [] diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index 6fcd91181c..b0b77393ee 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -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