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
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
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.
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 datarefresh
: refresh raw data from remote APIraw_data=(new_data)
: explicitly set raw data, rather than fetching from remote APIraw_data
: return most recent raw dataimage
: return an image representation of the current metric state. At the moment it is a JSON string withchartType
: 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 thecredentials
hash passed to it.