Main Site | Join Robin Hood Coop | Projects | Events | Blog | Media | Forums | Mailing List | Twitter | Facebook

Getting started with contributing (code) to RHC

Most of the following has been lifted directly from the awesome D*iaspora project.

A lot of new contributors that want to dive in to helping fix bugs and develop new awesome things often ask “Well, where do I start?”. Below are some links to comprehensive resources so that newcomers can get up to speed and get dive right in to fixing bugs.

###Request to be added to Slack and Github
PM @danielhassan

###Getting started with git and GitHub

All of Robin Hood’s code is hosted on Github, a social coding platform that leverages Git for many different Free and Open Source projects. You can use any operating system to contribute with GitHub, all you need is an account and to follow GitHub’s easy and helpful guide for setting up your account from the command line and learning to use the commands. Git is supported on all major platforms.

Once you’re all set up, check out the issue tracker and watch for entries tagged with “newcomer” or “quickfix”. Most often those are the things which you don’t need a deep understanding of the complete codebase for to work on them, and the tasks should be easy enough for novice programmers to tackle.

###All about bugs

There are some different things about bugs that you ought to know, specifically, how to report a bug, and how to claim and fix a bug. Both incorporate well into our GitHub-based workflow, and is designed to make the process of fixing bugs easier for everybody.

###How to contribute the right way

Robin Hood’s development tries its very best to stick to a set of guidelines when it comes to contributing code. When you’re writing a bugfix or custom code from scratch, it’s good practice to ask yourself:

  • Does my code have tests? << TODO
  • Am I sticking to the Git Workflow the best I can?
  • Do I follow the styleguide? << TODO

Also, please familiarize yourself with some good tips on how to become a member in an open source community.

###Other helpful resources << TODO

<color=red>!! THIS IS WORK IN PROGRESS !!

Certainly not yet a working solution.
Help is appreciated.

RHC Quick Start with Cloud9

Cloud 9 free plan offers one private workspace. So, you can use cloud9 for this completely free. RHC source is not (yet) public so you should use the private workspace.

Fork the repo

Start by forking the github repo. (When forking private repo the forked repo should also remain as private. But just to be sure, check that your work has the private label as shown on the pic) More info on this in posts by @danielhassan

Create workspace

Create account in c9 and then select to create new workspace. There is basically 3 thing that you should make sure to get right when creating new workspace: Check that the workspace you are creating is private ( <- at the moment this is very important!!), clone from your newly created fork and last select ruby on rails template.

If you created your cloud9 account using github credentials you most likely should now have successfully cloned the RHC repo. Congratulations, you can skip rest of this topic.

If you didn’t use your github credentials you most likely see some kind of cloning error in terminal window or it is asking password for ubuntu-user for github login. If later case just end the login pressing CTRL-c keys. Problem is that github doesn’t have the ssh-keys of your ssh-client.

I was unable to get the ssh-agent working on the cloud9 instance. So, we need to use the ssh key we already have. Run following command in terminal cloud9 terminal window

cat ~/.ssh/

Select the text that was printed on the terminal and copy it to clipboard by pressing CTRL-c. Now you can follow the instruction found from this page. Start from the step 4.

Once you have added the cloud9 ssh key to your github account run the following commands in cloud9 terminal

git fetch origin 
git checkout develop

Configure upstream so that we can easily sync our fork in future

git remote add upstream


Run following command on the cloud9 terminal

sudo apt-get install postgresql postgresql-contrib

Unfortunately you can access postgress configuration files only by using the terminal. So, using cloud9 terminal open the file /etc/postgresql/9.3/main/pg_hba.conf

sudo vim /etc/postgresql/9.3/main/pg_hba.conf

change the line

local   all             all                                     peer

to this one

local   all             all                                     md5

Once again using the cloud9 terminal start the database, create database user and database and make necessary adjustements using following commands

sudo service postgresql start
sudo su postgres

createuser -U postgres -P -d rh

When it asks for a password just enter password.

createdb -U rh robinhood_development

psql -U postgres -d robinhood_development

Using the cloud9 IDE create file config/database.yml and copy following as the files content

  adapter: postgresql
  encoding: unicode
  database: robinhood_development
  pool: 5
  username: rh
  password: password
  host: localhost
  port: 5432

Setting up Rails

I try to maintain branch that follows the develop-branch and has all the necessary changes required to make this project work under cloud9. Get changes from my branch by running following commands on your cloud9-terminal

git checkout develop
git remote add polac
git fetch polac
git merge polac/develop_c9

Before installing all dependencies we need to install nokogiri separately. Otherwise the cloud9 runs out of memory. After that we can install all other dependencies, setup the database and load some initial data.

gem install nokogiri -v '1.6.0'
bundle install
rake db:migrate
rake "pages:import[pages.json]"

Run Project

Just click run project from the “Run Project”-button. returns 404. Where does the code live nowadays?

Hey! What is your github username?

As per :

It’s “tanuk”. From your question I’m guessing that the project is hidden from public. If so, what’s the reason for that? I think limiting the visibility is bad for getting new contributors.

As for the call for new team members, I’m not a web developer (and I won’t be able to donate much time anyway), so I’m very hesitant to present myself as a new team member candidate. However, I am interested in browsing the bug list in case there’s something that I could help with, and I might want to report new bugs too.

Have just added you to the repo. Actually the code base until recently was not at all public - the intention is to open it up entirely, but we decided to do this in a phased approach to gauge how many people were able to commit :smile: