Skip to content

Latest commit

 

History

History
111 lines (68 loc) · 5.75 KB

workflow-for-adding-code.md

File metadata and controls

111 lines (68 loc) · 5.75 KB

Add code to Ushahidi

Workflow for Adding Code

1. Get a github account

First, create a github account.

Ushahidi code development is happening in Github. We track all our tasks, both front-end and back-end, in issues connected to the repo Platform API.

2. Fork the repository

A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.

The Ushahidi is built from 3 separate repositories. Depending on the task you'll need to fork one or more of these. Usually you'll need to fork at least the API and the Client repositories.

To fork a repository:

  1. Click the link above
  2. In the top-right corner of the page, click Fork.

Thats all! Now you have your very own fork of the original repository.

3. Clone your fork to get the code to your computer

If you hadn't yet cloned (and installed) the platform code, you can just go ahead an clone your fork:

git clone git@github.com:yourusername/platform.git

4. Add your fork as a remote

If you already cloned and installed the platform, you can add your new fork as a "remote" repository:

git remote rename origin upstream
git remote add origin git@github.com:yourusername/platform.git

When you clone a repository, the URL you clone is always created as the "origin" remote repository. The commands above rename the "origin" to "upstream", and create a new "origin" that points to your fork. This will allow you to pull in new versions of the platform, but push your own branches to your fork.

5. Find a feature to work on

The best way to pick a feature to work on is to say hi to Ushahidi’s developers in our community-channels in gitter/irc, let them know what you’d like to work on (front end, back end, etc), and chat about what could be suitable for you. You can find more info on how to contact us here.

Ushahidi issues (bugs, feature requests, etc) are in Github Issues. Find something that needs doing.

  • Community tasks in github are feature that are up for grabs by community devs.
  • Other tasks that we haven’t labeled yet may be suitable for work. Feel free to contact the team if you intend to work on something that grabs your attention.

6. Start a branch for your feature

If you’re working on a feature that nobody has claimed before, you will need to create a branch of Ushahidi that’s specific to this feature. To do this, cd (change directory) into your Ushahidi code in the terminal window, and type:

git checkout master
git pull
git checkout -b some-task

Where “some-task” is a short description without spaces of what this task is (e.g. “visualise-data”). Now you can start work on your code.

7. Write Code

Now write your code. Make sure you meet the Ushahidi coding standards and use the Ushahidi pattern library if you need to change the css.

If you get stuck, or want to talk through ideas, you can contact other Ushahidi developers.

8. Submit your code

When you’re ready to submit your code for approval, do this:

  1. Commit and push your code

    git add .
    git commit -m “message about this commit”
    git push origin some-task
    
  2. Then, open your fork on github, ie. "https://www.github.com/yourusername/platform". You’ll see a banner indicating that you’ve recently pushed a new branch, and that you can submit this branch “upstream,” to the original repository:

  3. Click on "Compare and Pull Request" to create a pull request. Enter a title and description, then click "Create pull request".

     ![](https://github-images.s3.amazonaws.com/help/pull_requests/pullrequest-send.png)
    

In order to make it easy for someone to review your pull request, please write a checklist for how to test and evaluate your submission. You can read more about

The first time you submit code you may be asked to sign Ushahidi’s contributor agreement.

The Ushahidi admins will then review and comment on your code, and will either accept your code or ask you to make changes to it. If you are asked to make changes to your code, make those changes then resubmit your code using:

git add .
git commit -m “message about this commit”
git push origin some-task

If your code is accepted, then the admin will merge your pull request. Your code will then appear in the Ushahidi Platform github repository, with you credited for it.

9. Further Reading