Skip to content

an-ju/projectscope

 
 

Repository files navigation

Projectscope

Travis CI: Build Status

Code Climate: Code Climate

Test Coverage: Test Coverage

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

Environment variables required to set up the app are:

  • ADMIN_PASSWORD: used to bypass the oauth system
  • github_app_id: used for GitHub oauth
  • github_app_token: used for GitHub oauth

Then you can use the web interface to create projects.

rails c

if you then run

Project.all.each &:resample_all_metrics

on the console 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 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 it is a JSON string with
    • chartType: specifies the type of the chart, which will decide how the chart gets rendered.
    • data: contains data used for rendering the graph.
  • scredentials: class method that returns a list of symbols that are the names of the configuration variables the gem expects to find in the credentials hash passed to it.

About

ProjectScope developed for CS169 at UC Berkeley.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 72.9%
  • CSS 24.7%
  • Ruby 1.6%
  • Other 0.8%