Thanks so much for helping with the development of Reservations! This guide
will cover the process for helping out with the project and should allow you
to get started quickly and easily. If you need any help with contributing,
please e-mail stc-reservations{at}yale{dot}edu
or mention
@YaleSTC/reservations to contact the core team.
There are many of ways you can contribute to the Reservations project, from
reporting bugs and making suggestions, to
updating documentation and improving the codebase.
If you're new to coding in general, the first three options are a good way to
familiarize yourself with the application and the overall codebase. If you're
new to Rails development, feel free to work on some of our less complex
issues, labeled with diff: 1
or diff: 2
. If
you have any questions please feel free to comment in the GitHub issues or
contact the core team; we appreciate any and all help we can get!
If you've been using Reservations and notice a bug, or want to suggest a new feature, please open a GitHub issue. Before doing so, however, please search open / closed issues to see if someone else has already opened a similar issue.
A bug is a verifiable problem that is caused by the Reservations code. Good bug reports allow us to quickly identify the root causes of problems and resolve them. Here are some guidelines for submitting bug reports:
- Is it a duplicate? - check to see if the bug has already been reported.
- Has it been resolved? - check if it can be reproduced using the
master
branch or a newer version. - What is the problem? - see if you can isolate exactly how to reproduce the issue.
- Include a screenshot or screencast - you can use LICEcap to capture a screencast and save it as an animated gif.
- Tell us all the things - include as much information as possible (see the template below for a good starting point).
Bug Report Template (thanks Ghost team!)
Short and descriptive example bug report title
### Issue Summary
A summary of the issue and the browser/OS environment in which it occurs. If
suitable, include the steps required to reproduce the bug.
### Steps to Reproduce
1. This is the first step
2. This is the second step
3. Further steps, etc.
Any other information you want to share that is relevant to the issue being
reported. Especially, why do you consider this to be a bug? What do you expect
to happen instead?
### Technical details:
* Reservations Version: [vX.X.X OR master (a1b2c3)]
* Operating System: [Operating System X]
* Browser: [Browser vX.X.X]
A member of the core team will label your issue appropriately and may follow up for more information. We try to deal with bugs as quickly as possible and will keep the issue updated with our progress, but it may take some time before it is resolved.
Feature requests are always welcome as well. Before submitting a feature request, please search both opened and closed issues to see if the feature has already been requested. Remember that it's up to you to convince the core team of the merits of the feature. Please include as much detail as possible, including but not limited to the use case, a proposed implementation, and why it is likely to be useful.
One great way of helping out is improving documentation, which can take the
form of user-, developer- , and sysadmin-facing documentation. Our user-facing
documentation is located on our GitHub Pages site,
while our developer- and sysadmin-facing documentation is located in code
comments, in our README,
in the /doc
folder of the repo, and in our GitHub wiki.
The easiest way to make small improvements to our user-facing documentation is
by editing the file with the online GitHub editor: browse the
gh-pages
branch,
choose the file you want to edit, click the "Edit" button, make changes, and
follow the GitHub instructions from there. Once your changes are merged they
will immediately appear on the website.
If you'd like to help comment our codebase to make it more easily understandable, we ideally try to use YARD for consistency and ease of use. That said, any documentation is helpful so feel free to add comments where you feel necessary. If you'd like to suggest changes to the wiki please open up an issue and let us know what you think should be changed.
Helping to improve the Reservations codebase is great. In general, we only
accept pull requests for changes related to an open GitHub issue, so make sure
you open one (and it's approved) before you start working. This also makes it
easier to review and test your work. During active development there will be
milestones for upcoming
versions; we'd prefer if you select open issues from those over issues in the
wish list.
Otherwise, feel free to select any open issues, noting that we try to classify
them by rough priority using the labels beginning with pri:
.
The following is an overview of how to work on Reservations:
Each developer working on Reservations should fork the core Reservations repository and clone it as a local repository. Remember to add the core repository as a remote:
git remote add upstream [email protected]:YaleSTC/Reservations.git
You can either create a separate topic branch in your forked repository or
work off the forked master
branch (we recommend the former). Make sure you
pull in the latest changes from upstream
if you cloned a while ago
(git pull upstream master
) before branching. We recommend prefixing the
branch name with the GitHub issue number and including a few descriptive
words, i.e. 1234_brief_issue_description
.
We generally maintain release branches for minor versions (e.g.
release-v3.4
) for patching purposes - if you're working on a version-
specific bug make sure you branch off of the correct place.
Make sure to update or add to the test suite where appropriate; patches and
features will not be accepted without tests. We use RSpec
for general testing and Capybara for
integration testing. Make sure that the current test suite passes before
submitting a PR by running rake
.
We use Rubocop as the arbiter of style for
Reservations. You should run rubocop -D
to ensure that all of your changes
match the project conventions. We occasionally allow exceptions from code
complexity violations; you should make any such request in the GitHub pull
request comments.
Before you submit your PR, you should clean up your commit history and resolve
any merge conflicts with master
(or your upstream branch). While we
recommend making a bunch of small commits while you're working, it's important
to maintain a readable and useful commit history in the main repository.
- First, find out how many commits there are on your branch:
git log --oneline master..your-branch-name | wc -l
- Then, use an interactive rebase to squash all but the first commit unless
you have a good reason to keep more than one:
where
git rebase -i HEAD~#
#
is the number of commits on your branch. Mark the first commit asr
(for reword) so you can update the message and the rest ass
(for squash).
In terms of the commit message, we recommend the following:
- The first line should summarize the impact of the commit and should be less
than 72 characters. Note that this will likely go into the Changelog as well.
- This should also be in the present tense / imperative mood (e.g. "Add feature" vs "Added feature" and "Change element" vs "Changes element").
- Leave the second line blank
- The third line should reference the issue this PR resolves, either
issue #1234
if you're just mentioning the issue orcloses #1234
if you're closing an issue.- If you don't have an issue to reference, make sure you don't need to open one before opening the PR.
- Use bullet points on the following lines to elaborate on your brief description.
Example:
Fix the very important thing that was broken
closes #1234
- change the first file
- change the second file
- take this other thing into account
- modify this other thing
After you've squashed commits and crafted the perfect commit message, you need
to resolve any merge conflicts with the upstream branch. First, make sure that
you have latest version of master
(or your upstream branch) checked out and
then rebase your squashed branch on top of it:
git checkout master
git pull upstream master
git checkout 1234_your_branch_name
git rebase master
Now just push your branch up to GitHub. If you've already pushed it prior to
rebasing, you'll need to force push it (using the -f
flag, CAREFULLY),
otherwise you should be able to just push it normally:
git push origin 1234_your_branch_name
Before finally submitting, make sure that your branches passes all of our tests and style checks:
rake
rubocop -D
At this point you have a branch that is based off of the latest version of your upstream branch with a clean history and useful commit message. To submit, follow the following steps:
- If you go to your fork's page on GitHub, there should be a prompt to submit
a PR
- If not go here, select
YaleSTC/reservations
as the base fork and the relevant base branch and your fork as the head fork with your branch as the compare brach.
- If not go here, select
- Click "Create Pull Request" and add a description which references the
original issue (e.g.
Resolves #1234
), describes the changes you made and any new tools or libraries you added, as well as any breaking changes.
If it takes a while for your PR to be reviewed and new merge conflicts pop up,
simply follow the steps above to resolve them and force
push your branch CAREFULLY back up to your fork (i.e. origin
).
Finally, note that these are only one workflow you can use to generate branches with useful commit history and resolve merge conflicts. As long as you open up PR's that are clear and easy to merge, you can do whatever you want.
The code review process generally includes the following steps:
- Reading through the issue / PR comments to understand the original issue and the work that was done.
- Checking out the branch and verifying that it resolves the issue / does what it claims to do.
- Running the tests and style checks (either manually or via Travis).
- Read through the diff to ensure that all changes make sense and that no potential bugs or inefficiencies are introduced.
You're welcome to participate in the code review of other people's PR's, although the core team will have final say over whether or not to merge a PR. Feel free to comment heavily and ask questions, provided you're polite and respectful. If someone asks a question on your PR, please respond constructively and informatively - there are no bad questions! For more information see our Code of Conduct.
The following are the major dependencies of Reservations:
- Ruby 2.1
- Bundler
- a database server (MySQL or any database supported by Rails)
- ImageMagick
- GhostScript
- a CAS authentication system (optional)
Please read through the README for information about setting up your local installation of Reservations.
inspired by the Angular.js code of conduct
As contributors and maintainers of the Reservations project, we pledge to respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities.
Any communication must be constructive and never resort to personal attacks, trolling, public or private harrassment, insults, or other unprofessional conduct.
We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, disability, age, race, ethnicity, religion, or level of experience. We expect anyone contributing to the Reservations project to do the same.
If any member of the community violates this code of conduct, the maintainers of the Reservations project may take action, removing issues, comments, and PRs or blocking accounts as deemed appropriate.
If you are subject to or witness unacceptable behavior, or have any other
concerns, please email us at stc-reservations{at}yale{dot}edu
.