X Tutup
Skip to content

Support -a, --assignee in pr list#124

Merged
mislav merged 8 commits intomasterfrom
pr-list-assignee
Dec 3, 2019
Merged

Support -a, --assignee in pr list#124
mislav merged 8 commits intomasterfrom
pr-list-assignee

Conversation

@mislav
Copy link
Copy Markdown
Contributor

@mislav mislav commented Nov 27, 2019

This is for symmetry with issue list: #68 (comment)

The problem is that the Repository.pullRequests API connection doesn't support filtering by assignee, therefore we need to switch to search API in case an assignee was specified. This is awkward, but I don't see another way.

TODO:

  • Support --assignee + --state
  • Support --assignee + --base
  • Support --assignee + --label - note: multiple labels not supported in combination with --assignee (the Search API doesn't support label "OR" query)

This is for symmetry with `issue list`.

The problem is that the `Repository.pullRequests` connection doesn't
support filtering by assignee, therefore we need to switch to search API
in case an assignee was specified. This is awkward, but I don't see
another way.
Copy link
Copy Markdown
Contributor

@probablycorey probablycorey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bummer about needing to switch to the search api :( But it doesn't add too much more code.

@mislav mislav added the alpha label Dec 3, 2019
@mislav mislav self-assigned this Dec 3, 2019
Copy link
Copy Markdown
Contributor

@probablycorey probablycorey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup of the RunCommand method and pruning dead code!

My one concern is having the two different graphql queries PRs. It took me a bit to figure out why there were two paths. It seems like the only difference is that the search query can't handle multiple labels.

I'd rather have one code path with the limited label functionality than two paths. Or at least a comment describing why there are two paths.

Other than that, great work finding a work around to the pr assignee problem!

@mislav
Copy link
Copy Markdown
Contributor Author

mislav commented Dec 3, 2019

My one concern is having the two different graphql queries PRs. It took me a bit to figure out why there were two paths. It seems like the only difference is that the search query can't handle multiple labels.

That's right. Your concerns re: multiple code paths are valid and I wish we could switch to just one completely, but right now this is the compromise I chose to take. My primary motivation to keep the Repository.pullRequests code path (and search as secondary) is waiting for https://github.com/github/github/issues/96367 to ship, after which we can scrap the search path.

@mislav mislav merged commit 76e283b into master Dec 3, 2019
@mislav mislav deleted the pr-list-assignee branch December 3, 2019 19:06
cchristous pushed a commit to cchristous/cli that referenced this pull request Feb 28, 2026
…err_msg

infer project name: improve err msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup