# Contributing to the APM Agent The APM Agent is open source and we love to receive contributions from our community — you! There are many ways to contribute, from writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code. You can get in touch with us through [Discuss](https://discuss.elastic.co/c/apm), feedback and ideas are always welcome. ## Code contributions If you have a bugfix or new feature that you would like to contribute, please find or open an issue about it first. Talk about what you would like to do. It may be that somebody is already working on it, or that there are particular issues that you should know about before implementing the change. ### Submitting your changes Generally, we require that you test any code you are adding or modifying. Once your changes are ready to submit for review: 1. Sign the Contributor License Agreement Please make sure you have signed our [Contributor License Agreement](https://www.elastic.co/contributor-agreement/). We are not asking you to assign copyright to us, but to give us the right to distribute your code without restriction. We ask this of all contributors in order to assure our users of the origin and continuing existence of the code. You only need to sign the CLA once. 2. Test your changes Run the test suite to make sure that nothing is broken. See [testing](#testing) for details. 3. Rebase your changes Update your local repository with the most recent code from the main repo, and rebase your branch on top of the latest master branch. We prefer your initial changes to be squashed into a single commit. Later, if we ask you to make changes, add them as separate commits. This makes them easier to review. As a final step before merging we will either ask you to squash all commits yourself or we'll do it for you. 4. Submit a pull request Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests). In the pull request, choose a title which sums up the changes that you have made, and in the body provide more details about what your changes do. Also mention the number of the issue where discussion has taken place, eg "Closes #123". 5. Be patient We might not be able to review your code as fast as we would like to, but we'll do our best to dedicate it the attention it deserves. Your effort is much appreciated! ### Workflow All feature development and most bug fixes hit the master branch first. Pull requests should be reviewed by someone with commit access. Once approved, the author of the pull request, or reviewer if the author does not have commit access, should "Squash and merge". ### Testing To do a full test run, use either `bundle exec rspec` or `rake spec`. Individual specs should also run as expected. The Mongo test needs a Mongo instance running, but will start one itself if Docker is installed. To test other platform, use the Docker setup and scripts like `spec.sh RUBY_DOCKER_IMAGE FRAMEWORK`. ```sh $ spec/scripts/spec.sh ruby:2.6 rails-5.2 ``` ### Releasing To release a new version: 1. Update `VERSION` in `lib/elastic_apm/version.rb` according to the changes (major, minor, patch). 2. Update `CHANGELOG.md` to reflect the new version – change _Unreleased_ section to _Version (release date)_. 3. Make a new commit with the changes above, with a message in the style of `vX.X.X`. 4. Run `rake release`. This will... 1. Tag the current commit as new version. 2. Push the tag to GitHub. 3. Build the gem and upload to Rubygems (local user needs to be signed in and authorized.) 4. Update `2.x` branch to be at released commit and push it to GitHub.