github.com/waldiirawan/apm-agent-go/v2@v2.2.2/CONTRIBUTING.md (about) 1 # Contributing to the Go APM Agent 2 3 The Go APM Agent is open source and we love to receive contributions from our community — you! 4 5 There are many ways to contribute, from writing tutorials or blog posts, improving the 6 documentation, submitting bug reports and feature requests or writing code. 7 8 You can get in touch with us through [Discuss](https://discuss.elastic.co/c/apm). 9 Feedback and ideas are always welcome. 10 11 ## Code contributions 12 13 If you have a bugfix or new feature that involves significant changes that you would like to 14 contribute, please find or open an issue to discuss the changes first. It may be that somebody 15 is already working on it, or that there are particular issues that you should know about before 16 implementing the change. 17 18 For minor changes (e.g. fixing a typo), you can just send your changes. 19 20 ### Submitting your changes 21 22 Generally, we require that you test any code you are adding or modifying. Once your changes are 23 ready to submit for review: 24 25 1. Sign the Contributor License Agreement 26 27 Please make sure you have signed our [Contributor License Agreement](https://www.elastic.co/contributor-agreement/). 28 We are not asking you to assign copyright to us, but to give us the right to distribute 29 your code without restriction. We ask this of all contributors in order to assure our 30 users of the origin and continuing existence of the code. You only need to sign the CLA once. 31 32 2. Test your changes 33 34 Run the test suite to make sure that nothing is broken. 35 See [testing](#testing) for details. 36 37 3. Review your changes 38 39 Before sending your changes for review, it pays to review it yourself first! 40 41 If you're making significant changes, please familiarize yourself with [Effective Go](https://golang.org/doc/effective_go.html) 42 and [go/wiki/CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments). 43 These documents will walk you through writing idiomatic Go code, which we strive for. 44 45 Here are a few things to check: 46 - format the code with [gofmt](https://golang.org/cmd/gofmt/) or [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports) 47 - lint your code using [golint](https://github.com/golang/lint) 48 - check for common errors using [go vet](https://golang.org/cmd/vet/) 49 50 4. Rebase your changes 51 52 Update your local repository with the most recent code from the main repo, and rebase your 53 branch on top of the latest main branch. We prefer your initial changes to be squashed 54 into a single commit. Later, if we ask you to make changes, add them as separate commits. 55 This makes them easier to review. As a final step before merging we will either ask you to 56 squash all commits yourself or we'll do it for you. 57 58 5. Submit a pull request 59 60 Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests). 61 In the pull request, choose a title which sums up the changes that you have made, and in 62 the body provide more details about what your changes do, and the reason for making them. 63 Also mention the number of the issue where discussion has taken place, or issues that are 64 fixed/closed by the changes, e.g. "Closes #123". 65 66 6. Be patient 67 68 We might not be able to review your code as fast as we would like to, but we'll do our 69 best to dedicate it the attention it deserves. Your effort is much appreciated! 70 71 ### Testing 72 73 The tests currently do not require any external resources, so just run `go test ./...`. 74 We test with all versions of Go from 1.8 onwards using [Travis CI](https://travis-ci.org). 75 76 We track code coverage. 100% coverage is not a goal, but please do check that your tests 77 adequately cover the code using `go test -cover`. 78 79 ### Release procedure 80 81 The Go APM Agent and the APM Server do not have a direct dependency where the APM Server needs to be released before the Go APM Agent is released. Even though, they currently have an independent versioning scheme, we try and release the APM Server and Agents closely so new features and bug fixes are available as soon as possible. 82 83 For example, APM Server version `7.15.0` corresponds with the Go APM Agent version `1.14.0` and so on. 84 85 1. Update `version.go` and `internal/apmversion/version.go`, and then run `make update-modules` 86 2. Update [`CHANGELOG.asciidoc`](changelog.asciidoc), by adding a new version heading (`==== 1.x.x - yyyy/MM/dd`) and changing the base tag of the Unreleased comparison URL 87 3. For major and minor releases, update the EOL table in [`upgrading.asciidoc`](docs/upgrading.asciidoc). 88 4. Merge changes into github.com/elastic/apm-agent-go@main 89 5. Create tags: vN.N.N, and module/$MODULE/vN.N.N for each instrumentation module with the script `scripts/tagversion.sh`. Execute the output manually in your terminal. Note: The output assumes `upstream` is the name of the upstream remote. 90 6. Create release on GitHub: `gh release create vN.N.N` 91 7. Reset the latest major branch (1.x, 2.x etc) to point to the new release tag, e.g. git branch -f N.x vN.n.n 92 8. Update the latest major branch on upstream with `git push upstream <major_branch>`