|
| 1 | +# Contributing to expandorg/assignment |
| 2 | + |
| 3 | +:+1: First off, thanks for taking the time to contribute! :+1: |
| 4 | + |
| 5 | +We're excited to hear and learn from you. Your experiences will benefit others who read and use these guides. |
| 6 | +We've put together the following guidelines to help you figure out where you can best be helpful. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. |
| 7 | + |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +0. [Types of contributions we're looking for](#types-of-contributions-were-looking-for) |
| 12 | +0. [How Can I Contribute?](#how-can-i-contribute) |
| 13 | +0. [Setting up your environment](#setting-up-your-environment) |
| 14 | +0. [Pull requests](#pull-requests) |
| 15 | +0. [License](#license) |
| 16 | + |
| 17 | +## Types of contributions we're looking for |
| 18 | + |
| 19 | +There are many ways you can directly contribute to the guides (in descending order of need): |
| 20 | + |
| 21 | +- Reporting a bug |
| 22 | +- Discussing the current state of the code |
| 23 | +- Submitting a fix |
| 24 | +- suggesting enhancements |
| 25 | + |
| 26 | +## How Can I Contribute? |
| 27 | + |
| 28 | +### Report bugs using Github's [issues](https://github.com/expandorg/assignment/issues) |
| 29 | +We use GitHub issues to track public bugs. Report a bug by [opening a new issue](); it's that easy! Write bug reports with detail, background, and sample code. |
| 30 | + |
| 31 | +**Great Bug Reports** tend to have: |
| 32 | + |
| 33 | +- A quick summary and/or background |
| 34 | +- Steps to reproduce |
| 35 | + - Be specific! |
| 36 | + - Give sample code if you can. |
| 37 | +- What you expected would happen |
| 38 | +- What actually happens |
| 39 | +- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work) |
| 40 | + |
| 41 | +### Suggesting Enhancements |
| 42 | +How Do I Submit A Enhancement Suggestion? |
| 43 | + |
| 44 | +Enhancement suggestions are tracked as GitHub [issues](https://github.com/expandorg/assignment/issues). Create an issue on this repository and provide the following information: |
| 45 | + |
| 46 | +- Use a clear and descriptive title for the issue to identify the suggestion. |
| 47 | +- Provide a step-by-step description of the suggested enhancement in as many details as possible. |
| 48 | +- Describe the current behavior and explain which behavior you expected to see instead** and why. |
| 49 | + |
| 50 | +## Setting up your environment |
| 51 | + |
| 52 | +Clone the repository with: |
| 53 | + |
| 54 | +`go get -u github.com/expandorg/assignment` |
| 55 | + |
| 56 | +or create a directory `$GOPATH/src/github/expandorg` and execute: git clone git@github.com:expandorg/assignment.git |
| 57 | + |
| 58 | +Run the project dependencies (db, etc.) with `make up` |
| 59 | +Run the latest migration with `make migrate-latest` |
| 60 | +Run the project with `make run` |
| 61 | + |
| 62 | +### Dependencies |
| 63 | + |
| 64 | +We use `dep` to manage our dependencies. To add a new vendor, use: |
| 65 | + |
| 66 | +`deps ensure -add DEPENDENCY` |
| 67 | + |
| 68 | +To update vendors for built project, run: |
| 69 | + |
| 70 | +`make update-deps` |
| 71 | + |
| 72 | +#### Add a new migration |
| 73 | + |
| 74 | +```make add-migration name="migration_name"``` |
| 75 | + |
| 76 | +For migration names be descriptive and start with verbs: `create_`, `drop_`, `add_`, etc. This will look at the latest migrated version (1, 2, 3) and creates 2 files with new version: |
| 77 | + |
| 78 | +`2_migration_name.up.sql` and `2_migration_name.down.sql` |
| 79 | + |
| 80 | +#### Migrate |
| 81 | + |
| 82 | +You can migrate to latest: |
| 83 | + |
| 84 | +```make migrate-latest``` |
| 85 | + |
| 86 | +OR You can migrate up and migrate down a version: |
| 87 | + |
| 88 | +```make run-migrations action="goto" version="1"``` |
| 89 | + |
| 90 | +When you migrate up, you can see in the `schema_migrations` the last migrated version. When you migrate down, it updates the the version column in `schema_migrations`. |
| 91 | + |
| 92 | +### Tests |
| 93 | +```make run-tests``` |
| 94 | + |
| 95 | +## Pull Requests |
| 96 | +We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests |
| 97 | +Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests: |
| 98 | + |
| 99 | +1. Fork the repo and create your branch from `master`. |
| 100 | +2. If you've added code that should be tested, add tests. |
| 101 | +3. If you've changed APIs, update the documentation. |
| 102 | +4. Ensure the test suite passes. |
| 103 | +5. Make sure your code lints. |
| 104 | +6. Issue that pull request! |
| 105 | + |
| 106 | +## License |
| 107 | +By contributing, you agree that your contributions will be licensed under its MLP-2 License. |
| 108 | + |
| 109 | +Thanks! :heart: |
| 110 | + |
| 111 | +Expand.org Team |
0 commit comments