From 12f4794151f550be49df5bbdb5db14f1a154310a Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Tue, 1 Jul 2025 11:12:16 +0100 Subject: [PATCH] fix: remove assignee-related intervention Signed-off-by: Babak K. Shandiz --- pkg/cmd/pr/shared/finder.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/pkg/cmd/pr/shared/finder.go b/pkg/cmd/pr/shared/finder.go index 51860e102..df8cc0fd4 100644 --- a/pkg/cmd/pr/shared/finder.go +++ b/pkg/cmd/pr/shared/finder.go @@ -242,33 +242,6 @@ func (f *finder) Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, err } } - // Ok this is super, super horrible so bear with me. - // The `assignees` field on a Pull Request exposes users that are assigned. It is also possible for bots to be - // assigned, but they only appear under the `assignedActors` field. Ideally, the caller of `Find` would determine - // the correct field to use based on the `fd.Detector` that is passed in, but they can't construct a detector - // because the BaseRepo is only determined within this function. The more correct solution is to do what I did with - // the issue commands and decouple argument parsing from API lookup. See PR #10811 for example. - var actorAssigneesUsed bool - if fields.Contains("assignees") { - if opts.Detector == nil { - cachedClient := api.NewCachedHTTPClient(httpClient, time.Hour*24) - opts.Detector = fd.NewDetector(cachedClient, f.baseRefRepo.RepoHost()) - } - - issueFeatures, err := opts.Detector.IssueFeatures() - if err != nil { - return nil, nil, fmt.Errorf("error detecting issue features: %v", err) - } - - // If actors are assignable on this host then we additionally request the `assignedActors` field. - // Note that we don't remove the `assignees` field because some commands (`pr view`) do not display actor - // assignees yet, so we have to have both sets of data. - if issueFeatures.ActorIsAssignable { - fields.Add("assignedActors") - actorAssigneesUsed = true - } - } - var pr *api.PullRequest if f.prNumber > 0 { // If we have a PR number, let's look it up @@ -324,10 +297,6 @@ func (f *finder) Find(opts FindOptions) (*api.PullRequest, ghrepo.Interface, err }) } - if actorAssigneesUsed { - pr.AssignedActorsUsed = true - } - return pr, f.baseRefRepo, g.Wait() }