npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-pr-fu

v4.0.1

Published

Advanced Github Flow with Hubot

Downloads

21

Readme

hubot-pr-fu

hubot-pr-fu is a chat bot built on the Hubot framework. It was initially generated by generator-hubot. The npm module name is hubot-pr-fu.

Installing the script

Integrating with exisiting bot

Install the script via npm:

npm install hubot-pr-fu --save

Add the script to your external-scripts.json file:

[ "hubot-pr-fu" ]

And start your bot

Running hubot-pr-fu Locally

You can test your hubot by running the following, however some plugins will not behave as expected unless the environment variables they rely upon have been set.

You can start hubot-pr-fu locally by running:

% bin/hubot -a slack

Notes

  • There might be some inconsistency with determining the conflict of PRs. GitHub's API returns a mergeable key in the response that has three possible states: true, false and nil. nil state means that the mergeability of that PR has not yet been determined, and a background job has been scheduled. For reasons of making the logic simpler, we don't display information about these nil state PRs. So there might be a rare case where the total number of PRs in pr all command doesn't match with the sum of mergeable PRs and non-mergeable PRs in the same command's response.

Commands/Features

Note: This bot is still under active development, and so has really little error checking (existence of organization or repo, valid permissions etc.). User discretion is advised

User specific commands

pr orgname/repo all

This command returns the PR stats for the repo specified under the specified organization. This information would include:

  1. Total open PRs
  2. Total PRs which are mergeable and those which are not
  3. List of users who have open PRs and links to each of those

pr orgname/repo conflicts

This command returns all the PRs which have merge conflicts. This has more detailed information for those compared to pr all command. The title, PR number, link to that PR, assignee and the username who opened this PR is included in the information.

pr orgname/repo <username>

This command returns all the PRs opened by this user. This includes all open PRs which are mergeable and non-mergeable. The username is assumed to be a valid Github username. For now, there is no authorization or authentication built-in. Another assumption is that a username in lowercase is same as capitalized or camelcased. That is, for a username bootstrap, the users Bootstrap, bootStrap are the same.

One caveat is that the robot will treat every string after pr other than all and conflicts as a username. So, don't abuse this. Adding a way to make this better is in the works.

Configuration

Some env vars are assumed to exist:

Getting a Slack Token

  1. Signin into Slack via https://slack.com/signin
  2. Head to https://.slack.com/services/new/bot
  3. Register a new bot with whatever name you want
  4. Save the service, and you'll be shown the API key. Grab this key and k set it to HUBOT_SLACK_TOKEN

Contribution

An example script is included at scripts/example.coffee, so check it out to get started, along with the Scripting Guide.