Conversation
Also splits List vs. Search queries into separate methods for better maintanability.
|
Thanks for looping me in @mislav 🙇 |
samcoe
approved these changes
Mar 24, 2021
Contributor
samcoe
left a comment
There was a problem hiding this comment.
👏 Nice work! I think searching for issues and prs is going to be a very popular feature.
pkg/cmd/pr/list/http.go
Outdated
| q.SetType(githubsearch.PullRequest) | ||
| q.InRepository(ghrepo.FullName(repo)) | ||
| q.AddQuery(filters.Search) | ||
| q.SortBy(githubsearch.CreatedAt, githubsearch.Desc) |
Contributor
There was a problem hiding this comment.
Will this override any sort parameter the user might have specified in filters.Search?
Contributor
Author
There was a problem hiding this comment.
That's a great question. Any user's query will always be appended at the end, so their own sort:* directive would override this implicit sort: directive after ElasticSearch parses it. However, after some thought, I decided that since sort:created-desc is already the default for issue search, it doesn't really need to be explicitly specified here. I'll remove it 👍
samcoe
reviewed
Mar 24, 2021
| Search string | ||
| } | ||
|
|
||
| func (opts *FilterOptions) IsDefault() bool { |
This is the default sort mode for issues, so it's not needed to explicitly set it. Furthermore, the user can specify their own sort mode through the `--search` option.
This comment was marked as spam.
This comment was marked as spam.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds search functionality to
pr listto complementissue list --search.Since the search backend is now easily available through code, this also adds support for
--authorfilter for compatibility withissue list#2628 /cc @GeorgeMacFollowup to #3196 /cc @g14a
Fixes #452, ref. #641