Analyzing Github Issue Reactions
Tags: github, pipedream, node, javascript
Published: 2019-11-27 19:45:18

_Prioritizing issues with 👍s, ❤️s and 🎉s_

At [Pipedream](https://pipedream.com/), we use Github Issues to track feature requests, bugs, and new app integrations.

![](https://cdn-images-1.medium.com/max/2296/1*iRV79H3q3LoLBH6JLy0oaA.png)

Anytime a user has a new idea, we send them [to the roadmap](https://github.com/PipedreamHQ/roadmap) to make sure the idea gets captured.

Anytime someone suggests an idea that’s already been captured, we send them to the roadmap to add a reaction (a 👍, ❤️ or 🎉) to the issue.

We’re diligent about pushing people to the roadmap because we want to prioritize the most requested items. Reactions are the best way to collect that data.

Unfortunately, Github doesn’t provide high-level dashboards on issue reactions. You can [sort issues](https://help.github.com/en/github/searching-for-information-on-github/sorting-search-results#sort-by-reactions) by the total number of reactions in the Issues UI:


**is:issue is:open sort:reactions-desc**

but you can’t see the reaction count without digging into the issue itself:

![](https://cdn-images-1.medium.com/max/2000/1*xVlofjt4KMhVV0kFwcSjjw.png)

Nor can you compare the count of reactions *across* issues.

To help us prioritize the right issues, we needed to answer question like:

* **What are the top issues this week?** (*What should we be focused on?*)

* **What issues are *trending* this week?** (*Even if it’s not in the top 5, is there an issue getting lots of love this week we should be paying attention to?*)

* **Who’s opening the most issues? Who’s reacting to the most issues?** (*Who are the most engaged users, and how can we prioritize their issues and get more feedback?)*

We built [a workflow](https://pipedream.com/@dylburger/send-issue-reactions-for-a-repo-to-a-google-sheet-p_NMCar1/readme) to collect this data, and a Google sheet and Jupyter notebook to drive the analysis. **I’ll show you how this works and how to use it for your own repo.**

## Pulling Issue Reactions, saving to Google Sheets

This [Pipedream workflow](https://pipedream.com/@dylburger/send-issue-reactions-for-a-repo-to-a-google-sheet-p_NMCar1/readme) pulls reactions for all open issues in your repo once a day, saving them to a Google Sheet where can run more analysis:

![This gives us the basic data we need to run analysis on reactions by issue, author, and more.](https://cdn-images-1.medium.com/max/4628/1*-zRE5r-SpEHWqUylf3Lusg.png)*This gives us the basic data we need to run analysis on reactions by issue, author, and more.*

**Follow the instructions in the workflow’s README** to connect your Github and Google Sheets accounts, and enter the necessary values in the fields of each step (for example, the Github repo and spreadsheet you’d like to save data to).

![](https://cdn-images-1.medium.com/max/2292/1*qouGcty4X2FY0dvaGjRuGA.png)

Once that’s done, press the **Run Now** button to collect your first set of reaction data:

![](https://cdn-images-1.medium.com/max/2000/1*E19gVdzvTHI1sQVVB4PUCw.png)

This workflow uses some built-in Pipedream actions to save data to Google Sheets. But when you forked the workflow, you created a copy you can modify however you’d like.

For example, you can swap out the Google Sheets steps if you’d like to save data to a database, Airtable, or any destination (you can use any [pre-built actions](https://docs.pipedream.com/workflows/steps/actions/) or [run any Node.js code](https://docs.pipedream.com/workflows/steps/code/)).

### How we make requests to the Github API

I use the amazing [octokit/rest.js](https://octokit.github.io/rest.js/) package to facilitate interaction with the Github API. This sets the necessary HTTP headers to enable the reactions API ([it’s still in preview](https://developer.github.com/changes/2016-05-12-reactions-api-preview/)), and handles pagination and retries transparently.

When the workflow runs the **fetch_issues_reaction_data** step, Pipedream provides a fresh OAuth access token in the variable `auths.github.oauth_access_token` that you can use to authorize requests ([read more about connected accounts in the docs](https://docs.pipedream.com/connected-accounts/#connected-accounts)).

This all means you can fetch any data from the Github API with just a few lines of code:

```javascript
const Octokit = require("@octokit/rest").plugin(
  require("@octokit/plugin-retry")
)

const octokit = new Octokit({
  auth: auths.github.oauth_access_token,
  previews: ["squirrel-girl-preview"] // See https://developer.github.com/v3/previews/#reactions
})

# Retrieve owner and repo name from the form params passed by the user
const { owner, repo } = params

let options = octokit.issues.listForRepo.endpoint.merge({
  owner,
  repo,
})

const issues = await octokit.paginate(options)
```

## Exploratory Analysis in Google Sheets

I like to explore my data with a [pivot table](https://support.google.com/docs/answer/1272900?co=GENIE.Platform%3DDesktop&hl=en) before ever jumping into a more complex analysis with SQL or a Jupyter notebook.

Pivot tables support grouping, aggregate functions, sorting, and more, all in a friendly GUI.

### **What issues have the most reactions?**

It’s nice to have a single, ordered table of the top issues.

![](https://cdn-images-1.medium.com/max/2748/1*aYnqXTTFrSZWRjVCEL_h5Q.png)

### **What issues have seen the most reactions in the past week?**

We need to see what issues are *trending*. If it’s not a large project and can be tackled quickly, fixing a trending issue proves our responsiveness to users and helps build trust.

![](https://cdn-images-1.medium.com/max/2588/1*DTjIsyJUMAC_XDlL4Kk6JQ.png)

### Reactions by User

It’s nice to know who our top “reactors” are, so see if that correlates with engagement in Slack or other channels.

![](https://cdn-images-1.medium.com/max/2728/1*213eRTvdU_oePkAiTuRhVg.png)

## A deeper dive with a Jupyter notebook

I wanted to observe how the cumulative sum of reactions for an issue move over time. This helps us understand whether the top issue recently moved to the top, or whether it’s been the top issue for weeks.

![](https://cdn-images-1.medium.com/max/3728/1*4_8OrkbmjkqsuTPsiAprUw.png)

I was also interested to analyze the number of total reactions over time, to see if it’s increasing, on average, or whether it correlates with dates when we’ve promoted our roadmap in our [Slack community](https://pipedream.com/community).

![](https://cdn-images-1.medium.com/max/2000/1*Q4_G79NFHWayln7fUlrteA.png)

As a new product, the number of reactions per day is small, so this doesn’t tell a rich story yet. You can help us by using Pipedream and 👍 your [favorite issues](https://github.com/PipedreamHQ/roadmap)!

I created these charts with pandas and matplotlib, using a a Jupyter notebook. You can see the code in [this Github repo](https://github.com/dylburger/github-reactions-analysis).

## Extending this analysis

There are a number of other questions that would be interesting to analyze in the future:

* Under what conditions are different types of emojis ( 👍, ❤️, 🎉, and more) used? Does the use of a specific emoji correlate with issue closure or activity?

* Does an issue get attention on a project after a certain number of reactions?

* Do issues with labels (or a specific label) get more reactions than issues with no labels?

Questions like these have been explored in [research papers](https://homepages.dcc.ufmg.br/~mtov/pub/2019-sbes.pdf), so there’s a lot of prior art you can read up on to get ideas to apply to your own repo.

Let us know what kind of analyses you end up doing in the comments below!

_This article was originally posted [on Medium](https://medium.com/@dylan.sather/analyzing-github-issue-reactions-5281358839c1)_