Skip to content

MVP dashboard for ProjectScope, using new gems architecture developed by AV folks

Notifications You must be signed in to change notification settings

stevenwuyinze/projectscope

 
 

Repository files navigation

Main Repo Status:

CS169 Group Forked Repo Status:

Pivotal Tracker: https://www.pivotaltracker.com/n/projects/1886749

MVP dashboard for ProjectScope

A dashboard to show project metrics such as those supported by gems like project_metric_code_climate, project_metric_github, and others, using the project_metrics gem to wrap them for consumption by a Rails app

Standing up an instance

Get set up with a Github Access token (for the github gem):

https://help.github.com/articles/creating-an-access-token-for-command-line-use/

Then run rails server like so:

GITHUB_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN> rails s

Then you can use the web interface to create projects. Both the above gems (github, codeclimate), require a key pair of

"url" "http://github.com/AgileVentures/LocalSupport"

specifying the github url for the project. In order to generate sample metrics to show up in the project index page, run rails console like so:

GITHUB_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN> rails c

if you then run

Project.all.each &:resample_all_metrics

on the console (and the GITHUB_ACCESS_TOKEN env var is set) it will generate a set of samples you can then see in the interface

or execute

rake project:resample_all

Managing the app secret

The file config/application.yml.asc is a symmetric-key-encrypted YAML file that itself contains the encryption keys for encrypting sensitive database attributes at rest. It is safe to version this file. The secrets in this file are managed as described in this article.

Creating new metric gems

Each metric gem must provide the following methods:

  • initialize(credentials={}, raw_data=nil) Constructor that takes any credentials needed for the gem to contact any remote services, as a hash, and optionally takes an initial set of raw data (i.e. what would be delivered by the API of the remote service)
  • score: computes the metric score (normalized from 0 to 100) given the current raw data
  • refresh: refresh raw data from remote API
  • raw_data=(new_data): explicitly set raw data, rather than fetching from remote API
  • raw_data: return most recent raw data
  • image: return an image representation of the current metric state. At the moment this "image" will be rendered as HTML, so you can in principle return a link to a remote image, but we recommend returning an SVG image since this is extremely flexible and can be rendered as interactive HTML, allowing mouse over explanation on parts of the image etc.

If the metric gem provides the class method credentials, it should return a list of strings that are the names of the configuration variables the gem expects to find in the credentials hash passed to it. Note that these are configuration variables for an instance of the metric, for example, the GitHub or PivotalTracker token to access a particular private repo or account. (Application-wide configuration variables are handled separately.)

TODO

  • should we be passing global project tokens via project metric settings? (github gem relying on ENV var)
  • get versions of the gems stored in db for future reference?
  • get JSON API set up so that other services can consume our data
  • get some sad path testing in place
  • get some rspecs on the individual models?
  • make cukes higher

About

MVP dashboard for ProjectScope, using new gems architecture developed by AV folks

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 59.9%
  • JavaScript 18.9%
  • HTML 11.3%
  • Gherkin 8.7%
  • CSS 1.2%