All code contributions are welcome! These contribution guidelines will help you jump right into writing code for this repository.
This repository follows a pull request/peer review workflow. All code submitted
into develop
and master
must be done through a pull request.
The master
branch can be considered stable, production ready code. A list of
stable releases is maintained as we go and can be used by anyone concerned with
ongoing development.
All ongoing development takes place in branches off of develop
(the primary
branch). This allows you to work on tasks and features in isolation until they
are 100% finished. It also creates a clear record of how the feature
progressed, and the finished state when it was merged into the overall
codebase.
Every effort should be made to make a branch as stable as possible before
merging your branch into develop
through a pull request.
When the code in your feature branch is done and ready to be merged, a pull
request to develop
should be created.
- Ensure your local checkout of the repository is up to date.
- Check out the
develop
branch. - Create a new branch for your work.
- Make as many changes and commits as necessary within your branch.
- When your code is finished and ready, submit a pull request to merge your
branch into
develop
. - After your pull request receives approval from at least one other team
member, merge your code into
develop
and ensure the merge went smoothly. - After verifying your merge, delete your feature branch.
Branches can be named anything you want. However, it is very helpful to include useful information in branch names, such as:
- GitHub issue numbers.
- Short name of the problem (Ex. adding-thumbnail-support-to-pages).
- Other identifying information.
All pull requests should be peer reviewed by another team member. Please use good coding style & best practices.
Except where noted in our own coding standards repository, we follow the WordPress Coding Standards to the best of our abilities. This helps ensure that everyone's coding style and methodologies follow the same conventions, allowing our review efforts to be focused on the code's effectiveness, performance, and functionality.
Each commit and pull request will automatically be evaluated by Code Climate. Code Climate will use these coding standards and best practices to automatically evaluate each commit. A Code Climate build will "fail" when new issues are introduced within a pull request. While it is not required for your pull request to pass the Code Climate build, it is highly encouraged. Our codebase should be consistently improving, not regressing.
If this repository possesses any unit tests, they are required to pass in order for a pull request to be merged.
If you are introducing new functions in your pull request, please do your best to include unit tests validating the functionality of newly added functions.
Unit test suites are a collection of tests and assertions that ensure your code works as expected. These are usually automatically run through Travis CI, but can also be run locally on any machine.
Pull requests should have a meaningful titles and descriptions of the changes being merged in. This could mean one sentence, or 4 paragraphs. Someone reviewing your pull request should be able to easily understand what was added or changed, why, and how you fixed it. Use your best judgement.
When submitting your pull request to develop
, add a line to CHANGELOG.md
explaining your change. This should be placed under the "Unreleased" heading.
There should be at least one changelog entry per pull request.
Any necessary changes to README.md
files should also be made before making
a pull request.
For anything that needs more explanation, or code examples need to be provided, link out to a blog post on Make ID or documentation page on developer.bu.edu/webteam/ for more detail.
If one exists, the pull request should link to the GitHub issue (typing # will bring up an autocomplete dialogue to search through issues). Also, consider linking the pull request to a Trello card with the GitHub Power-Up.
After successfully merging a branch into the develop
or master
, the pulled
branch should be deleted. Only branches with active development, or unmerged
code should remain in the repository. The person merging the branch and
closing out the pull request is responsible for doing this.
Every pull request into master
should be considered a new release because
master
always reflects the code that exists on production. The following actions should be performed on every pull request being merged into
master
.
- Increment any version number strings.
- Update the "Unreleased" heading in the
CHANGELOG.md
to reflect the new version being prepared for release. - Perform any necessary compile or build tasks through Grunt.
When the code in develop
is ready to be released into the wild, a pull
request to master
should be created.
- Ensure your local checkout of the repository is up to date.
- Check out the
develop
branch. - Create a new branch from
develop
and prepare your release. Take care to perform each step listed above under Creating A New Relase. - Submit a pull request to merge your branch into
master
. - After your pull request receives approval from at least one other team
member, merge your code into
master
and ensure the merge goes smoothly. - Delete your release branch.
- After verifying your merge and deleting your branch, create a release
against master in GitHub
for the repository. Release names should match the version released. Ex.
1.5.1
, or1.6
. - Create a pull request to merge
master
intodevelop
to sync the latest release intodevelop
for future development.
Sometimes, a fix needs to be deployed to production ASAP. When this happens,
there is a third flow that should be followed. Because develop
will have
code that has not yet been released into the wild (and may not be ready), hot
fixes should be performed in a branch off of master
.
- Ensure your local checkout of the repository is up to date.
- Check out the
master
branch. - Create a new branch for your work.
- Make the necessary code changes and commit.
- Submit a pull request to merge your branch into
master
. - Since this code will be deployed to production, the release steps listed above should be followed.
- Because this code will bypass
develop
, it is important to get at least one code review from another team member. - After your pull request receives approval, merge your code into
master
and ensure the merge went smoothly. - Delete your branch.
- After verifying your merge and deleting your branch, create a release
against master in GitHub
for the repository. Release names should match the version released. Ex.
1.5.1
, or1.6
. - Create a pull request to merge
master
intodevelop
to sync the latest release intodevelop
for future development. Approval is not necessary on this pull request.