Can't select my Pull Requests if there are too many new ones.

in utopian-io •  9 months ago

The PR dropdown (e.g. when writing a new development contribution) does not show all your PRs.

Expected behavior:

You should be able to select all your merged PRs from the past 14 days for the selected project.

Actual behavior:

If your PRs are not within the last 30 PRs for the project, you are not able to select them, because the API only pulls the last 30 PRs. If your PR is not among them, you can't select it, even if it's within the last 14 days (according to the rules).

Selectable PRs:

Actual PRs:

How to reproduce:

Well... that's not really possible unless you have a merged PR somewhere and after that more than 30 other PRs have followed.

But I think there's no further information required.${repository}/pulls?state=closed only returns 30 results.
Safest approach would be to iterate through the pages (&page=2, &page=3 and so on) until the 14 day age limit is reached (by checking the merged_at property). There's also a per_page parameter but that would only be a hotfix and not 100% reliable.

Additional info:

The GitHub API let's you only filter PRs by "closed or not" (state=closed) which also includes PRs that were closed but not merged. "merged_at": null, needs to be filtered out.

There's even a separate endpoint to check if PRs are merged or not.


Posted on - Rewarding Open Source Contributors

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.

Hey @mkt I am @utopian-io. I have just upvoted you!


  • Seems like you contribute quite often. AMAZING!


  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!


Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord