LabelCat Build Status Test Coverage

Disclaimer: This is not an official Google product.

Organizing the issues in your GitHub repositories can be a different kind of animal, that's why you need LabelCat.

LabelCat is a NodeJS app that uses Google's Prediction API to automatically label GitHub Issues as they are created. Who taught LabelCat this trick you ask? You did...or rather, you will. Once deployed, you must train LabelCat on previously labeled issues, preferably from a variety of well-labeled repositories.

These instructions show how to run LabelCat on Google Cloud Managed VMs for maximum ease-of-use and scalability, but LabelCat can be deployed virtually anywhere.

While many Google Cloud Platform Node.js samples are small and simple, focusing on a single concept or piece of functionality, there aren't many full-blown Node.js apps to look at and tinker with. LabelCat fills the void somewhat by showcasing a larger Node.js app that addresses a number of production concerns. As such LabelCat is an excellent resource as you build your own production Node.js applications on Google Cloud Platform.

Built by @jmdobry

Table of Contents

What's included

As an exercise, try swapping out the backend or frontend with something you write yourself.

Installation

Clone and setup

  1. Install Node.js >= 4.x
  2. git clone https://github.com/GoogleCloudPlatform/LabelCat
  3. cd LabelCat
  4. npm install
  5. cp config.default.js config.js (config.js is where you customize the app)
  6. Modify config.js as necessary.

Register Developer Application on GitHub

LabelCat uses GitHub OAuth to authenticate users. Create an individual developer application if you intend to use LabelCat on repositories owned by your GitHub user. Create an organization developer application if you intend to use LabelCat on repositories owned by an organization that you administer.

Individual Application: Go to https://github.com/settings/developers to register a new individual application.

Organization Application: Go to https://github.com/organizations/<organization>/settings/applications/new. Replace <organization> with the name of your organization.

Register the Application:

  1. Click "Register new application"
  2. Enter application name, e.g. Foo LabelCat
  3. Enter homepage URL, e.g. https://labelcat.appspot.com/
  4. Optionally enter application description
  5. Enter authorization callback URL, e.g. https://labelcat.appspot.com/auth/github/callback
  6. Click "Register application"
  7. Copy the generated Client ID and Client Secret into the config.js file that you created earlier

Register for Google Cloud Platform

The Google Cloud Platform provides a $300 free trial for new accounts, enough to run the app for a "long time" (TODO: Update for accuracy).

  1. Register at https://console.developers.google.com/freetrial
  2. Create a new Project
  3. Enable the Predictions API, Datastore API and PubSub API for your new project
  4. Go to "Credentials", create a new Service Account and download the generated key file

Deployment

  1. Install the Google Cloud SDK
  2. gcloud preview app deploy app.yaml worker.yaml --promote

Contributing

See CONTRIBUTING.

License

Copyright 2015, Google, Inc.

Licensed under the Apache License, Version 2.0

See LICENSE.