Skip to content

Support --web flag in issue and pr list - #1282

Merged
mislav merged 7 commits into
cli:trunkfrom
AliabbasMerchant:webInList
Jul 16, 2020
Merged

Support --web flag in issue and pr list#1282
mislav merged 7 commits into
cli:trunkfrom
AliabbasMerchant:webInList

Conversation

@AliabbasMerchant

Copy link
Copy Markdown
Contributor

Summary

closes #1228

I have tested it out from my side

Have also added an --author flag in pr list, and am making sure that it is allowed only with the --web flag

@mislav mislav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great! Thank you

Comment thread command/pr.go Outdated
prListCmd.Flags().StringSliceP("label", "l", nil, "Filter by label")
prListCmd.Flags().StringSliceP("label", "l", nil, "Filter by labels")
prListCmd.Flags().StringP("assignee", "a", "", "Filter by assignee")
prListCmd.Flags().StringP("author", "A", "", "Filter by author")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's only add --author once it's supported in both web and non-web mode #1102. Otherwise, people might be mislead to try it without --web and will be greeted with an error.

@AliabbasMerchant
AliabbasMerchant requested a review from mislav June 30, 2020 14:22

@mislav mislav left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

Note that #644 will soon land, which adds two more flags to be supported in issue list --web mode: --mention and --milestone. I shall ping you once trunk is updated so you can merge it in and add web equivalents ✨

@AliabbasMerchant

Copy link
Copy Markdown
Contributor Author

@mislav I think I should shift to accepting a map then, rather than accepting a huge number of function arguments (seeing that even more filters would be added in the future).
Although I will have to figure out how to handle special values (most probably those would have to be via arguments only)
What do you feel?

@mislav

mislav commented Jun 30, 2020

Copy link
Copy Markdown
Contributor

@AliabbasMerchant +1 on accepting a map, or—better yet—a struct

@mislav

mislav commented Jul 2, 2020

Copy link
Copy Markdown
Contributor

@AliabbasMerchant You may merge trunk now with the latest issue filters 🙇‍♂️

@mislav
mislav merged commit 1ed35a7 into cli:trunk Jul 16, 2020
@mislav

mislav commented Jul 16, 2020

Copy link
Copy Markdown
Contributor

@AliabbasMerchant Thank you for your ongoing hard work! 🎉

Comment thread command/pr.go
"https://github.com/%s/pulls",
ghrepo.FullName(baseRepo),
)
prListURL := generateRepoURL(baseRepo, "pulls")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So now URL generation is shifted to a separate function? Awesome!

Comment thread command/pr.go
return err
}
fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s in your browser.\n", openURL)
fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s in your browser.\n", displayURL(openURL))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh. I purposely did not use the displayURL function, thinking that it would be better to show the perfect URL, but okay 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The URL-encoded query would be hard to read, so I've made a call to not display it. We also avoid printing query strings in other feedback messages.

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.

open issue / PR list on the web

3 participants