Web Application for the Ohloh Stack. Currently Rails 4.2.7 & Ruby 2.2.5
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.capistrano OTWO-3274: Add capistrano for deployment Feb 12, 2015
app OTWO-5392 Capture & report Api errors to newrelic Nov 14, 2018
bin Fix rubocop minor warnings Dec 23, 2015
config OTWO-5392 Capture & report Api errors to newrelic Nov 14, 2018
db OTWO-5270 OH Link Checker Script Oct 1, 2018
features OTWO-5304 Replaced the firebase CDN files with newer version and remo… Aug 29, 2018
fixtures/vcr_cassettes OTWO-5392 Capture & report Api errors to newrelic Nov 14, 2018
lib OTWO-5270 OH Link Checker Script Oct 1, 2018
log Implement pull request changes May 20, 2015
public OTWO-4662 Added Accout Activity for 3,6,12 months window Aug 31, 2018
script OTWO-5186 Script to generate missing tiny logos Apr 19, 2018
spec Remove unused digits references Dec 14, 2017
test OTWO-5392 Capture & report Api errors to newrelic Nov 14, 2018
tmp/pids OTWO-4971: Alter Github bulk import flash notice (#1253) Oct 26, 2017
vagrant Rename deployer to serv-deployer in vagrant Aug 11, 2016
vendor OTWO-4909 Updated the enhanced license display Sep 5, 2017
.env Merge branch 'master' of github.com:blackducksoftware/ohloh-ui into O… Jan 29, 2018
.env.test OTWO-5086 Use fisbot api for code_locations and repositories Feb 25, 2018
.gitignore OTWO-5166 - Subscriptions Delete API returning 400 Status (#1310) Mar 28, 2018
.haml-lint.yml Make line length limits match rest of code base. Dec 9, 2014
.rubocop.yml OTWO-4905 Script to resolve duplicate repositories Dec 15, 2017
.ruby-gemset Initial checkin Nov 18, 2014
.ruby-version Considering updating our Ruby Sep 30, 2016
Capfile OTWO-5048: Upgrade Capistrano from 3.6.1 to 3.10.1 Jan 3, 2018
Dockerfile Work through all of the asset precompilation problems. May 4, 2015
Gemfile Bumping Ohloh SCM version to 2.4.0 Feb 16, 2018
Gemfile.lock Bumping Ohloh SCM version to 2.4.0 Feb 16, 2018
Guardfile Add helpful gems and resolve airbrake errors Oct 27, 2016
LICENSE Add license in preparation for OSS release May 5, 2017
Rakefile Remove version rake tasks Jul 30, 2015
Readme.md OTWO-5086 Use fisbot api for code_locations and repositories Feb 25, 2018
config.ru Fix rubocop minor warnings Dec 23, 2015
erd.pdf OTWO-4125: Fixed destroy method failure for existing failure groups Feb 25, 2016
licenses.csv Script to create LicensePermissions & assignments Aug 7, 2017

Readme.md

OhlohUI

Dependencies:

  • OhlohUI uses the ruby version 2.2.5. Please install ruby 2.
  • OhlohUI uses the postgresql database. Please install postgresql and create a new user on it.

Getting Started:

$ git clone git@github.com:blackducksoftware/ohloh-ui.git
$ cd ohloh-ui
$ gem install bundler
$ bundle install

The OhlohUI data is split between two databases in production. The development setup needs to reflect the same. The database names are configured in a file specific to each environment. For development, create a file env.development, with the following contents.

DB_ENCODING = 'UTF-8'

DB_HOST = localhost
DB_NAME =
DB_USERNAME =
DB_PASSWORD =

FOREIGN_DB_HOST = localhost
FOREIGN_DB_NAME =
FOREIGN_DB_USERNAME =
FOREIGN_DB_PASSWORD =

The default DB encoding was set to SQL_ASCII to support data encoded by older ruby. For new data, the UTF-8 encoding should work fine. The *_USERNAME and *_PASSWORD entries need to reflect the user created in postgresql. The *DB_NAME entries should be new database names. These will be created during our setup.

$ rake db:create
$ rake db:structure:load
$ rake db:second_base:structure:load

This might throw a bunch of errors about relations and constraints already existing. Please ignore them and proceed.

Setup a default admin user. The arguments are optional. By default a user with the login admin_user, password admin_password and email admin@example.com will be created.

$ ruby script/setup_default_admin.rb <login> <passsword> <email>
$ rails s

Visit localhost:3000 to checkout the site.

Tests:

Add the following to the .env.development file. Fill in the blank values appropriately. Modify .env.test to reflect the values that were added here.

TEST_DB_HOST = localhost
TEST_DB_NAME =
TEST_DB_USERNAME =
TEST_DB_PASSWORD =

FOREIGN_TEST_DB_HOST = localhost
FOREIGN_TEST_DB_NAME =
FOREIGN_TEST_DB_USERNAME =
FOREIGN_TEST_DB_PASSWORD =

Then run the following:

$ rake db:test:prepare
$ rake test

Integration Tests:

The following packages need to be installed to make the feature specs work:

Mac OSX

$ brew install brew-cask
$ brew cask install google-chrome
$ brew install chromedriver

Ubuntu

$ sudo apt-get install chromium-browser
$ sudo apt-get install chromium-chromedriver
$ sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver

Recording/fixing VCR cassettes for Fisbot API:

Define an alias for vcr.localhost.org in /etc/hosts:

127.0.0.1 vcrlocalhost.org

Start the fisbot server(test environment) at localhost:4004. Manually clean the fisbot tables after each recording.

Pull Request Builder:

The OhlohUI CI uses the following task to verify PR compatibility.

$ rake ci:all_tasks

This runs:

  • rubocop
  • haml-lint
  • brakeman
  • bundle audit
  • teaspoon
  • rake test
  • spinach