|
| 1 | +# Contributing to mParticle Android SDK |
| 2 | + |
| 3 | +Thanks for contributing! Please read this document to follow our conventions for contributing to the mParticle SDK. |
| 4 | + |
| 5 | + |
| 6 | +## Setting Up |
| 7 | + |
| 8 | +1. Fork the repository and then clone down your fork |
| 9 | +2. Commit your code per the conventions below, and PR into the mParticle SDK main branch |
| 10 | +3. Your PR title will be checked automatically against the below convention (view the commit history to see examples of a proper commit/PR title). If it fails, you must update your title |
| 11 | +4. Our engineers will work with you to get your code change implemented once a PR is up |
| 12 | + |
| 13 | + |
| 14 | +## Development Process |
| 15 | + |
| 16 | +1. Create your branch from `main` |
| 17 | +2. Make your changes |
| 18 | +3. Add tests for any new functionality |
| 19 | +4. Run the test suite to ensure tests (both new and old) all pass |
| 20 | +6. Update the documentation |
| 21 | +7. Create a Pull Request |
| 22 | + |
| 23 | + |
| 24 | +### Pull Requests |
| 25 | + |
| 26 | +* Fill in the required template |
| 27 | +* Follow the [Android style guide](https://developer.android.com/kotlin/style-guide) |
| 28 | +* Include screenshots and animated GIFs in your pull request whenever possible |
| 29 | +* End all files with a newline |
| 30 | + |
| 31 | +### PR Title and Commit Convention |
| 32 | + |
| 33 | +PR titles should follow conventional commit standards. This helps automate the release process. |
| 34 | + |
| 35 | +The standard format for commit messages is as follows: |
| 36 | + |
| 37 | +``` |
| 38 | +<type>[optional scope]: <description> |
| 39 | +
|
| 40 | +[optional body] |
| 41 | +
|
| 42 | +[optional footer] |
| 43 | +``` |
| 44 | + |
| 45 | +The following lists the different types allowed in the commit message: |
| 46 | + |
| 47 | +- **feat**: A new feature (automatic minor release) |
| 48 | +- **fix**: A bug fix (automatic patch release) |
| 49 | +- **docs**: Documentation only changes |
| 50 | +- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
| 51 | +- **refactor**: A code change that neither fixes a bug nor adds a feature |
| 52 | +- **perf**: A code change that improves performance |
| 53 | +- **test**: Adding missing or correcting existing tests |
| 54 | +- **chore**: Changes that don't modify src or test files, such as automatic documentation generation, or building latest assets |
| 55 | +- **ci**: Changes to CI configuration files/scripts |
| 56 | +- **revert**: Revert commit |
| 57 | +- **build**: Changes that affect the build system or other dependencies |
| 58 | + |
| 59 | +### Testing |
| 60 | + |
| 61 | +We use JUnit and Mockito for our testing framework. Please write tests for new code you create. Before submitting your PR, ensure all tests pass by running: |
| 62 | + |
| 63 | +#### Lint Checks |
| 64 | +```bash |
| 65 | +./gradlew lint |
| 66 | +``` |
| 67 | + |
| 68 | +#### Unit Tests |
| 69 | +```bash |
| 70 | +./gradlew test |
| 71 | +``` |
| 72 | + |
| 73 | +#### Instrumented Tests |
| 74 | +```bash |
| 75 | +./gradlew :android-core:cAT :android-kit-base:cAT --stacktrace |
| 76 | +``` |
| 77 | + |
| 78 | +Make sure all tests pass successfully before submitting your PR. If you encounter any test failures, investigate and fix the issues before proceeding. |
| 79 | + |
| 80 | + |
| 81 | +### Reporting Bugs |
| 82 | + |
| 83 | +This section guides you through submitting a bug report for the mParticle Android SDK. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports. |
| 84 | + |
| 85 | +To notify our team about an issue, please submit a ticket through our [mParticles support page](https://support.mparticle.com/hc/en-us/requests/new). |
| 86 | + |
| 87 | +**When you are creating a ticket, please include as many details as possible:** |
| 88 | + |
| 89 | +* Use a clear and descriptive title |
| 90 | +* Describe the exact steps which reproduce the problem |
| 91 | +* Provide specific examples to demonstrate the steps |
| 92 | +* Describe the behavior you observed after following the steps |
| 93 | +* Explain which behavior you expected to see instead and why |
| 94 | +* Include logcat output and stack traces if applicable |
| 95 | +* Include your SDK version and Android OS version |
| 96 | + |
| 97 | + |
| 98 | +## License |
| 99 | + |
| 100 | +By contributing to the mParticle Android SDK, you agree that your contributions will be licensed under its [Apache License 2.0](LICENSE). |
0 commit comments