Visitar URL original
Add filters issues by eddumelendez · Pull Request #644 · cli/cli · GitHub
The Wayback Machine - https://web.archive.org/web/20200917200638/https://github.com/cli/cli/pull/644
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filters issues #644

Merged
merged 7 commits into from Jul 2, 2020
Merged

Add filters issues #644

merged 7 commits into from Jul 2, 2020

Conversation

@eddumelendez
Copy link
Contributor

eddumelendez commented Mar 13, 2020

This commit introduces two new flags in order to filter issues per mentioned and milestone.

See #641

@eddumelendez eddumelendez force-pushed the eddumelendez:add_filters_issues branch from 6e77988 to bced6e7 Mar 19, 2020
@@ -171,7 +171,7 @@ func IssueStatus(client *Client, repo ghrepo.Interface, currentUsername string)
return &payload, nil
}

func IssueList(client *Client, repo ghrepo.Interface, state string, labels []string, assigneeString string, limit int, authorString string) (*IssuesAndTotalCount, error) {
func IssueList(client *Client, repo ghrepo.Interface, state string, labels []string, assigneeString string, limit int, authorString string, mentionedString string, milestoneString string) (*IssuesAndTotalCount, error) {

This comment has been minimized.

@fsmiamoto

fsmiamoto Mar 20, 2020 Contributor

Don't want to sound picky but don't you guys think it's a little redundant to have the String suffix in the arg name?
Like in mentionedString, assigneeString

This comment has been minimized.

@mislav

mislav Mar 20, 2020 Member

Agreed that it's starting to look weird, but I don't think this is something that we need to address in this PR. As a follow-up, we will look into having IssueList accept a struct of filtering options or something similar, rather than a big argument list that starting to be hard to maintain.

@eddumelendez Thank you for this PR! The code looks good; we're just holding off merging features in general until we figure out things like exact flag naming and how we can fit these features in our release schedule ✨

@vilmibm vilmibm self-requested a review Apr 29, 2020
@BondAnthony
Copy link

BondAnthony commented May 22, 2020

Just a question, but how would one retrieve the milestone number to use in this command? I was hoping to pass the milestone title but that doesn't appear to work based on the docs. The milestone number also doesn't work. It looks like one would need to decode the ID and use that number. Please tell me I'm looking at this wrong.

@mislav mislav changed the base branch from master to trunk May 27, 2020
Copy link
Contributor

probablycorey left a comment

@eddumelendez I tested this out locally but got this error:

graphql error: 'Variable $mentioned is used by but not declared, Variable $milestone is used by but not declared'

I think it is because the milestone and mentioned vars need to be defined in the query here https://github.com/cli/cli/pull/644/files#diff-f9ae6189655de6363f9ac71892daec02R215.

@mislav once this works do you think we can move forward with it, or do you still want to figure out the flag naming scheme you mentioned in https://github.com/cli/cli/pull/644/files#r395592397

@eddumelendez eddumelendez force-pushed the eddumelendez:add_filters_issues branch from 48b599f to a164056 Jun 14, 2020
@eddumelendez
Copy link
Contributor Author

eddumelendez commented Jun 14, 2020

thank you so much @probablycorey good catch!

I have rebased the branch and add the fix

@mislav
mislav approved these changes Jun 15, 2020
Copy link
Member

mislav left a comment

@probablycorey This looks good to me! One tiny nit about the flag name though

@@ -41,6 +41,8 @@ func init() {
issueListCmd.Flags().StringP("state", "s", "open", "Filter by state: {open|closed|all}")
issueListCmd.Flags().IntP("limit", "L", 30, "Maximum number of issues to fetch")
issueListCmd.Flags().StringP("author", "A", "", "Filter by author")
issueListCmd.Flags().StringP("mentioned", "", "", "Filter by mention")

This comment has been minimized.

@mislav

mislav Jun 15, 2020 Member

I'm not 100% sold on "mentioned" since it's past tense. How about present tense, e.g. --mentions ampinsk? @ampinsk: would love to know your thougths.

This comment has been minimized.

@ampinsk

ampinsk Jun 15, 2020 Collaborator

Maybe just --mention?

This comment has been minimized.

@eddumelendez

eddumelendez Jun 15, 2020 Author Contributor

I have updated the flag name

@eddumelendez eddumelendez force-pushed the eddumelendez:add_filters_issues branch from 7c2f3c5 to bb29099 Jun 15, 2020
@eddumelendez eddumelendez force-pushed the eddumelendez:add_filters_issues branch from bb29099 to cffd56f Jun 15, 2020
@cli cli deleted a comment Jun 22, 2020
@probablycorey probablycorey added this to Backlog 🗒 in The GitHub CLI via automation Jun 22, 2020
@probablycorey probablycorey moved this from Backlog 🗒 to Needs review 🤔 in The GitHub CLI Jun 22, 2020
@mislav
mislav approved these changes Jun 30, 2020
@mislav mislav dismissed probablycorey’s stale review Jun 30, 2020

addressed GraphQL error, flag naming

The GitHub CLI automation moved this from Needs review 🤔 to Needs to be merged 🎉 Jun 30, 2020
@mislav mislav merged commit ed78110 into cli:trunk Jul 2, 2020
4 checks passed
4 checks passed
lint
Details
build (ubuntu-latest)
Details
build (windows-latest)
Details
build (macos-latest)
Details
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Jul 2, 2020
@@ -212,10 +212,10 @@ func IssueList(client *Client, repo ghrepo.Interface, state string, labels []str
}

query := fragments + `
query($owner: String!, $repo: String!, $limit: Int, $endCursor: String, $states: [IssueState!] = OPEN, $labels: [String!], $assignee: String, $author: String) {
query($owner: String!, $repo: String!, $limit: Int, $endCursor: String, $states: [IssueState!] = OPEN, $labels: [String!], $assignee: String, $author: String, $mention: String, $milestone: String) {
repository(owner: $owner, name: $repo) {

This comment has been minimized.

@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
The GitHub CLI
  
Done 💤
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.