diff --git a/pkg/cmd/pr/list/http.go b/pkg/cmd/pr/list/http.go index 8936600bc..e80ffcd90 100644 --- a/pkg/cmd/pr/list/http.go +++ b/pkg/cmd/pr/list/http.go @@ -172,7 +172,6 @@ func searchPullRequests(httpClient *http.Client, repo ghrepo.Interface, filters q.SetType(githubsearch.PullRequest) q.InRepository(ghrepo.FullName(repo)) q.AddQuery(filters.Search) - q.SortBy(githubsearch.CreatedAt, githubsearch.Desc) switch filters.State { case "open": diff --git a/pkg/cmd/pr/list/http_test.go b/pkg/cmd/pr/list/http_test.go index 6ac4e2cfa..9a82b5c16 100644 --- a/pkg/cmd/pr/list/http_test.go +++ b/pkg/cmd/pr/list/http_test.go @@ -116,7 +116,7 @@ func Test_listPullRequests(t *testing.T) { httpmock.GraphQL(`query PullRequestSearch\b`), httpmock.GraphQLQuery(`{"data":{}}`, func(query string, vars map[string]interface{}) { want := map[string]interface{}{ - "q": "repo:OWNER/REPO is:pr is:open author:monalisa sort:created-desc", + "q": "repo:OWNER/REPO is:pr is:open author:monalisa", "limit": float64(30), } if !reflect.DeepEqual(vars, want) { @@ -140,7 +140,7 @@ func Test_listPullRequests(t *testing.T) { httpmock.GraphQL(`query PullRequestSearch\b`), httpmock.GraphQLQuery(`{"data":{}}`, func(query string, vars map[string]interface{}) { want := map[string]interface{}{ - "q": "repo:OWNER/REPO is:pr is:open sort:created-desc one world in:title", + "q": "repo:OWNER/REPO is:pr is:open one world in:title", "limit": float64(30), } if !reflect.DeepEqual(vars, want) { diff --git a/pkg/cmd/pr/list/list_test.go b/pkg/cmd/pr/list/list_test.go index 28be3aee2..73b9ff2b6 100644 --- a/pkg/cmd/pr/list/list_test.go +++ b/pkg/cmd/pr/list/list_test.go @@ -165,7 +165,7 @@ func TestPRList_filteringAssignee(t *testing.T) { http.Register( httpmock.GraphQL(`query PullRequestSearch\b`), httpmock.GraphQLQuery(`{}`, func(_ string, params map[string]interface{}) { - assert.Equal(t, `repo:OWNER/REPO is:pr is:merged assignee:hubot label:"needs tests" base:develop sort:created-desc`, params["q"].(string)) + assert.Equal(t, `repo:OWNER/REPO is:pr is:merged assignee:hubot label:"needs tests" base:develop`, params["q"].(string)) })) _, err := runCommand(http, true, `-s merged -l "needs tests" -a hubot -B develop`)