Skip to content

Latest commit

 

History

History
307 lines (198 loc) · 10.6 KB

CONTRIBUTING.md

File metadata and controls

307 lines (198 loc) · 10.6 KB

Contributor's Guide

We welcome pull requests from anyone welling to help! Follow these steps to contribute:

  1. Find an issue that needs assistance by searching through current issues.

  2. Let us know you are working on it by posting a comment on the issue.

  3. Follow the Contribution Guidelines to start working on the issue.

If you've found a bug that is not on the board, follow these steps.

Contribution Guidelines

Prerequisites

Prerequisite Version
Node.js ~ ^6
npm (comes with Node) ~ ^3

Updating to the latest releases is recommended.

If Node is already installed in your machine, run the following command to validate the versions:

node -v

If your versions are lower than the prerequisite versions, you should update.

Forking The Project

Setting Up Your System

  1. Install Git or your favorite Git client.
  2. (Optional) Setup an SSH Key for GitHub.
  3. Create a parent projects directory on your system. For this guide, it will be assumed that it is /mean/

Forking ConquerJS

  1. Go to the top level ConquerJS repository: https://github.com/JosephLivengood/ConquerJS
  2. Click the "Fork" Button in the upper right hand corner of the interface (More Details Here)
  3. After the repository has been forked, you will be taken to your copy of the repo at yourUsername/ConquerJS

Cloning Your Fork

  1. Open a Terminal / Command Line / Bash Shell in your projects directory (i.e.: /yourprojectdirectory/)
  2. Clone your fork of ConquerJS
$ git clone https://github.com/yourUsername/ConquerJS.git
(make sure to replace yourUsername with your GitHub Username)

This will download the entire repo to your projects directory.

Setup Your Upstream

  1. Change directory to the new ConquerJS directory (cd ConquerJS)
  2. Add a remote to the official repo:
$ git remote add upstream https://github.com/JosephLivengood/ConquerJS.git

Congratulations, you now have a local copy of the repo!

Maintaining Your Fork

Now that you have a copy of your fork, there is work you will need to do to keep it current.

Rebasing from Upstream

Do this prior to every time you create a branch for a PR:

  1. Make sure you are on the master branch
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

If your aren't on master, resolve outstanding files / commits and checkout the master branch

$ git checkout master
  1. Do A Pull with Rebase Against upstream
$ git pull --rebase upstream master

This will pull down all of the changes to the official master branch, without making an additional commit in your local repo.

  1. (Optional) Force push your updated staging branch to your GitHub fork
$ git push origin master --force

This will overwrite the master branch of your fork.

Create A Branch

Before you start working, you will need to create a separate branch specific to the issue / feature you're working on. You will push your work to this branch.

Naming Your Branch

Name the branch something like fix/xxx or feature/xxx where xxx is a short description of the changes or feature you are attempting to add. For example fix/email-login would be a branch where you fix something specific to email login.

Adding Your Branch

To create a branch on your local machine (and switch to this branch):

$ git checkout -b [name_of_your_new_branch]

and to push to GitHub:

$ git push origin [name_of_your_new_branch]
If you need more help with branching, take a look at this.

Setup ConquerJS

Once you have repo cloned, before you start the application, you first need to install all of the dependencies:

# Install NPM dependencies
npm install

Then you need to add the private environment variables (API Keys):

# Create a copy of the "sample.env" and name it as ".env".
# Populate it with the necessary API keys and secrets:
cp sample.env .env

Then edit the .env file and modify the API keys only for services that you will use.

Note: Not all keys are required, to run the app locally, however having at least one auth client/secret is important if you want to be able to login.

Now navigate to your browser and open http://localhost:8080. If the app loads, congratulations – you're all set.

Make Changes

This bit is up to you!

Run The Test Suite

When you're ready to share your code, run the test suite:

$ npm test

and ensure all tests pass.

Creating A Pull Request

What is a Pull Request?

A pull request (PR) is a method of submitting proposed changes to the official repo (or any Repo, for that matter). You will make changes to copies of the files which make up ConquerJS in a personal fork, then apply to have them accepted.

Important: ALWAYS EDIT ON A BRANCH

Take away only one thing from this document, it should be this: Never, EVER make edits to the staging branch. ALWAYS make a new branch BEFORE you edit files. This is critical, because if your PR is not accepted, your copy of staging will be forever sullied and the only way to fix it is to delete your fork and re-fork.

Methods

There are many methods of creating a pull request for the ConquerJS Boilerplate:

Recommended Method: Editing via your Local Fork

This is the recommended method. Read about How to Setup and Maintain a Local Instance.

  1. Perform the maintenance step of rebasing staging.
  2. Ensure you are on the staging branch using git status:
$ git status
On branch staging
Your branch is up-to-date with 'origin/staging'.

nothing to commit, working directory clean
  1. If you are not on staging or your working directory is not clean, resolve any outstanding files/commits and checkout staging git checkout staging

  2. Create a branch off of staging with git: git checkout -B branch/name-here Note: Branch naming is important. Use a name like fix/short-fix-description or feature/short-feature-description.

  3. Edit your file(s) locally

  4. Check your git status to see unstaged files.

  5. Add your edited files: git add path/to/filename.ext You can also do: git add . to add all unstaged files. Take care, though, because you can accidentally add files you don't want added. Review your git status first.

  6. Commit your edits: git commit -m "Brief Description of Commit". Do not add the issue number in the commit message.

  7. Push your commits to your GitHub Fork: git push -u origin branch/name-here

  8. Go to Common Steps

Common Steps

  1. Once the edits have been committed, you will be prompted to create a pull request on your fork's GitHub Page.

  2. By default, all pull requests should be against the main repo, master branch.

  3. Submit a Pull Request from your branch to our staging branch.

  4. The title (also called the subject) of your PR should be descriptive of your changes and succinctly indicates what is being fixed.

    • Do not add the issue number in the PR title or commit message.

    • Examples: Add Test Cases for Click Score API Correct typo in Profile component Account

  5. In the body of your PR include a more detailed summary of the changes you made and why.

    • If the PR is meant to fix an existing bug/issue, then, at the end of your PR's description, append the keyword closes and #xx (where xx is the issue number). Example: closes #37. This tells GitHub to close the existing issue, if the PR is merged.
  6. Indicate if you have tested on a local copy of the site or not.

How We Review and Merge Pull Requests

Issue Moderators routinely go through open pull requests in a process called Quality Assurance (QA).

  1. If an Issue Moderator QA's a pull request and confirms that the new code does what it is supposed without seeming to introduce any new bugs, they will comment "LGTM" which means "Looks good to me."

  2. Another Issue Moderator will QA the same pull request. Once they have also confirmed that the new code does what it is supposed to without seeming to introduce any new bugs, they will merge the pull request.

How We Close Stale Issues

We will close any issues or pull requests that have been inactive for more than 15 days, except those that match the following criteria:

  • bugs that are confirmed
  • pull requests that are waiting on other pull requests to be merged
  • features that are a part of a GitHub project

Next Steps

If your PR is accepted

Once your PR is accepted, you may delete the branch you created to submit it. This keeps your working fork clean.

You can do this with a press of a button on the GitHub PR interface. You can delete the local copy of the branch with: git branch -D branch/to-delete-name

If your PR is rejected

Don't despair! You should receive solid feedback from the Issue Moderators as to why it was rejected and what changes are needed.

Many Pull Requests, especially first Pull Requests, require correction or updating. If you have used the GitHub interface to create your PR, you will need to close your PR, create a new branch, and re-submit.

If you have a local copy of the repo, you can make the requested changes and amend your commit with: git commit --amend This will update your existing commit. When you push it to your fork you will need to do a force push to overwrite your old commit: git push --force

Be sure to post in the PR conversation that you have made the requested changes so they can be reviewed again.