Closed PRs being returned when querying for Open ones

Hi there,

https://api.github.com/search/issues?q=is:open%20author:app/pull

This api endpoint is returning 11 issues/prs with state:“closed” even though is:open is specified in the query. Please let me know if this is intentional.

Thanks!

W

https://api.github.com/search/issues?q=is:open%20author:app/pull

Pls. Ignore emoji in the original post :o

Hi @wei,

Thanks for being here! GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, “Issues” endpoints may return both issues and pull requests in the response. Could that be the total you are seeing? I hope this helps!

Best,

Andrea

Hi there,

Thanks for the response. I’m fine with seeing both PRs and Issues. I just didn’t expect to see CLOSED issues or PRs when “is open” is specified in the request. Does that make sense?

Thanks!
W

Hey @wei,

My apologies for taking so long to get back to you. I totally understand, maybe pagination would be helpful here. But I’m definitely logging this for improvement. Thanks for this feedback!

Best,

Andrea

Hi @andreagriffiths11

I think you misunderstood my original post. To summarize, the filter I specified (is: open) was not applied to the search correctly because it returned items that should not be in the response (such as closed PRs). 

I believe this is a bug and I don’t think pagination will solve it  : )

Thanks!

W

2 Likes

Hi Wei,

Thank you for the clarification! Thanks again for your feedback.

1 Like

FYI - We were having a similar issue in the UI where closed prs would show up in an org-level search.

I opened a support ticket and they re-indexed the affected repos and they went away.

2 Likes