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

Support for a "pulls" query #14

Open
BryanLa opened this issue Dec 11, 2019 · 4 comments
Open

Support for a "pulls" query #14

BryanLa opened this issue Dec 11, 2019 · 4 comments

Comments

@BryanLa
Copy link

BryanLa commented Dec 11, 2019

Any chance you're looking at adding support for a query to the /pulls endpoint, instead of /issues?

It would be great to be able to query for only PRs, and use other switches for /pulls query string parameters such as "base" and "head".

@sshaw
Copy link
Owner

sshaw commented Dec 11, 2019

Hi, thanks for the info. Sounds like a good idea.

Currently there's an --export (-x) option. Given what you've proposed, it sounds like when one specifies --export pr we should use the /pulls endpoint and otherwise do what's currently being done.

Do you know if the options currently being used (assignee, milestone, etc.. ) when /issues is queried are supported by /pulls (yes I know you linked to the docs –thank you!– but hoping you can assist me here 😉) and are the parameter names the same across the two?

Also, any ideas if Bitbucket or GitLab have similar options?

@BryanLa
Copy link
Author

BryanLa commented Dec 11, 2019

Thanks @sshaw!

Yes, I think that would be a great idea to alter the API endpoint, based on the export switch value.

As far as the options for each GitHub API endpoint, it looks like the only ones shared across the two are state, sort and direction. Here's the reference for /issues. Another thought... what if you provided a freeform -q/--query-string switch, and allow folks to plug in their own, and pass them in the API query?

Sorry, I don't know about Bitbucket and GitLab... maybe the above could be enabled just for -p=github, initially?

@sshaw
Copy link
Owner

sshaw commented Dec 12, 2019

what if you provided a freeform -q/--query-string switch, and allow folks to plug in their own, and pass them in the API query?

Yeah seems like the best direction to go. But maybe have specific switches to normalize and/or simplify common options across services.

Maybe something like -q foo=bar -q baz=123. Will look into this...

@sshaw
Copy link
Owner

sshaw commented Dec 12, 2019

-q 'foo=bar&baz=123' seems cumbersome and since in most (all?) *nix shells & puts a job in the background and must be escaped/quoted. Specifying multiple -qs seems more user-friendly. Plus, the code would have to parse this whereas the other would be parsed by option processing lib (I think!).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants