From 6d0e5bf2b8d6acce51add7bbdd4e047ea2db15d9 Mon Sep 17 00:00:00 2001 From: Toshiya Doi Date: Fri, 10 Apr 2020 01:01:41 +0900 Subject: [PATCH] Remove Participants related codes for `pr view`` --- api/queries_pr.go | 18 --------------- command/pr.go | 17 -------------- test/fixtures/prViewPreview.json | 8 ------- .../prViewPreviewWithMetadataByBranch.json | 22 ------------------- .../prViewPreviewWithMetadataByNumber.json | 14 ------------ 5 files changed, 79 deletions(-) diff --git a/api/queries_pr.go b/api/queries_pr.go index ad29f163f..0b2fd378a 100644 --- a/api/queries_pr.go +++ b/api/queries_pr.go @@ -107,12 +107,6 @@ type PullRequest struct { Milestone struct { Title string } - Participants struct { - Nodes []struct { - Login string - } - TotalCount int - } } type NotFoundError struct { @@ -423,12 +417,6 @@ func PullRequestByNumber(client *Client, repo ghrepo.Interface, number int) (*Pu milestone{ title } - participants(first: 100) { - nodes { - login - } - totalCount - } } } }` @@ -528,12 +516,6 @@ func PullRequestForBranch(client *Client, repo ghrepo.Interface, baseBranch, hea milestone{ title } - participants(first: 100) { - nodes { - login - } - totalCount - } } } } diff --git a/command/pr.go b/command/pr.go index 21c3853cd..797ce9606 100644 --- a/command/pr.go +++ b/command/pr.go @@ -425,23 +425,6 @@ func prProjectList(pr api.PullRequest) string { return list } -func prParticipantList(pr api.PullRequest) string { - if len(pr.Participants.Nodes) == 0 { - return "" - } - - participantNames := make([]string, 0, len(pr.Participants.Nodes)) - for _, participant := range pr.Participants.Nodes { - participantNames = append(participantNames, participant.Login) - } - - list := strings.Join(participantNames, ", ") - if pr.Participants.TotalCount > len(pr.Participants.Nodes) { - list += ", …" - } - return list -} - var prURLRE = regexp.MustCompile(`^https://github\.com/([^/]+)/([^/]+)/pull/(\d+)`) func prFromURL(arg string) (string, ghrepo.Interface) { diff --git a/test/fixtures/prViewPreview.json b/test/fixtures/prViewPreview.json index 408d0f1fa..f660eaa6c 100644 --- a/test/fixtures/prViewPreview.json +++ b/test/fixtures/prViewPreview.json @@ -25,14 +25,6 @@ "milestone": { "title": "" }, - "participants": { - "nodes": [ - { - "login": "marseilles" - } - ], - "totalcount": 1 - }, "commits": { "totalCount": 12 }, diff --git a/test/fixtures/prViewPreviewWithMetadataByBranch.json b/test/fixtures/prViewPreviewWithMetadataByBranch.json index 483b4d63c..aaf9c6dfa 100644 --- a/test/fixtures/prViewPreviewWithMetadataByBranch.json +++ b/test/fixtures/prViewPreviewWithMetadataByBranch.json @@ -27,14 +27,6 @@ "totalcount": 0 }, "milestone": {}, - "participants": { - "nodes": [ - { - "login": "nobody" - } - ], - "totalcount": 1 - }, "commits": { "totalCount": 12 }, @@ -118,20 +110,6 @@ "milestone": { "title": "uluru" }, - "participants": { - "nodes": [ - { - "login": "marseilles" - }, - { - "login": "monaco" - }, - { - "login": "montpellier" - } - ], - "totalcount": 3 - }, "headRepositoryOwner": { "login": "OWNER" }, diff --git a/test/fixtures/prViewPreviewWithMetadataByNumber.json b/test/fixtures/prViewPreviewWithMetadataByNumber.json index 24927cb19..de0da816a 100644 --- a/test/fixtures/prViewPreviewWithMetadataByNumber.json +++ b/test/fixtures/prViewPreviewWithMetadataByNumber.json @@ -73,20 +73,6 @@ "milestone": { "title": "uluru" }, - "participants": { - "nodes": [ - { - "login": "marseilles" - }, - { - "login": "monaco" - }, - { - "login": "montpellier" - } - ], - "totalcount": 3 - }, "commits": { "totalCount": 12 },