max-mapper / max-mapper/open-prs

More efficient algorithm using issue search and the org:name filter

Open
#7 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
26
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Current algorithm (for reference):
  1. Get all repos for a user (handles pagination)
  2. Get all orgs for a user
  3. For each org, loop through all repos in that org (handles pagination)
  4. For each repo, if the user can push to it, collect that repo
  5. For each repo from both the user and the users orgs, get all pull requests, filter by open (handles pagination)
  6. Finally, we have all open pull requests that the user can merge
Proposed algorithm
  1. Get all repos for a user (handles pagination)
  2. Get all orgs for a user
  3. Perform an issue search using the repo:<reponame> filter. (And the type:pr is:open filters of course.) It's paginated by 100 results.
  4. Perform an issue search using the apparently undocumented org:<orgname> filter. This filter appears to be cumulative i.e. org:phonegap org:nodejs returns the set of PRs for phonegap union nodejs, so we can search for all open PRs across all repos of all relevant organisations at once.
  5. Manually parse out the repo from the html_url property: https://github.com/nodejs/io.js/pull/2093 as there is no repo field or link on the result object itself.
  6. For each repo, if the user can push to it, collect that repo
  7. Filter PRs from steps 3 and 4 using repos from step 6.
  8. Done.

This is somewhat more complex and may only work with public repos, but it should decrease the number of requests needed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the current repository/org enumeration and pull-request retrieval entry points described in the issue, then review GitHub issue search with the repo:, org:, type:pr, and is:open filters. Check pagination, pull-request repository extraction from html_url, and push-permission filtering, while comparing request counts for public repositories.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, javascript
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.