Git Product home page Git Product logo

goodbrother's Introduction

Goodbrother

List open PRs in Github by user.

Motivation

If you have many repos that receive regular updades with Dependabot, you're simply likely to miss some of them. I occasionally only found PRs when I get notification that they were closed in favor of a even newer version.

Goodbrother is there to let me know if I still have some open.

Install

yarn add goodbrother

Usage

Main method is to get open PRs by username.

import { getPullRequestsByUser, groupPullRequestsByRepository } from 'goodbrother'

const openPRs = await getPullRequestsByUser('stscoundrel');

/**
 * Array of PRs with structure like:
 * {
 *   id: 1068208284,
 *   name: Bump eslint-config-airbnb-base from 14.2.1 to 15.0.0,
 *   link: https://github.com/stscoundrel/gatsby-source-plugin-zoega/pull/18,
 *   isDependabot: true,
 *   repository: stscoundrel/gatsby-source-plugin-zoega,
 * }
 */
console.log(openPRs);

// You can also group the result by repository.
const byRepository = groupPullRequestsByRepository(openPRs);

/**
 * Array of repo summaries with structure like:
 * {
 *   name: stscoundrel/gatsby-source-plugin-zoega,
 *   pullRequests: [
 *     {
 *       id: 1068208284,
 *       name: Bump eslint-config-airbnb-base from 14.2.1 to 15.0.0,
 *       link: https://github.com/stscoundrel/gatsby-source-plugin-zoega/pull/18,
 *       isDependabot: true,
 *       repository: stscoundrel/gatsby-source-plugin-zoega,
 *      },
 *     ...
 *   ]
 * }
 */

goodbrother's People

Contributors

dependabot[bot] avatar stscoundrel avatar

Watchers

 avatar  avatar

goodbrother's Issues

Repository: add link & count

In programmatic use these both can easily be interpolated from pullRequests, but when just viewing the JSON it takes extra clicks. Add them as properties of repository.

Add per page

Default search result amount doesnt seem to match watch docs first suggested. Add something like &per_page=1000, or whichever is the max amount. Possibly pagination too

PR list: sort by updated

Add &sort=updated to api call. Should we need to go by the 60 request / hour unauthenticated limit, might make sense to have sorted list of active repos.

Paginate search responses

Search api has default limit of 100. While this should be enough for reasonable scenarios, there are cases where users repos have 100+ open PRs. For example, 203 open PRs in my repos in 02/2022.

  • If total_count is greater than 100, do additional requests
  • To avoid edgecase spamloop, add some reasonable limit. Like max of 5 requests. If someone needs to get list of over 500 open pull requests, well, what the hell are they doing with their lives.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.