# Contributing [fork]: https://github.com/github/metrics-exporter-statsd/fork [pr]: https://github.com/github/metrics-exporter-statsd/compare [code-of-conduct]: CODE_OF_CONDUCT.md Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE.md). Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. ## Submitting a pull request 1. [Fork][fork] and clone the repository 1. Set up a local build 1. Create a new branch: `git checkout -b my-branch-name` 1. Make your change 1. Push to your fork and [submit a pull request][pr] 1. Pat yourself on the back and wait for your pull request to be reviewed and merged. Here are a few things you can do that will increase the likelihood of your pull request being accepted: * Write tests. * Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. * Write a good PR description * Write a [good commit message](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). ## Setting up a local build Make sure you have [rust toolchain installed](https://www.rust-lang.org/tools/install) on your system and then: ```sh cargo build && cargo test ``` Run clippy and fix any lints: ```sh cargo fmt --all -- --check cargo clippy -- --deny warnings -D clippy::unwrap_used cargo clippy --tests -- --deny warnings -A clippy::unwrap_used ``` ## Releasing (write access required) If you are one of the maintainers of this package then follow this process: 1. Create a PR for this release with following changes: - Updated `CHANGELOG.md` with desired change comments and ensure that it has the version to be released with date at the top. - Go through all recent PRs and make sure they are properly accounted for. - Make sure all changelog entries have links back to their PR(s) if appropriate. - Update package version in Cargo.toml. 1. Get an approval and merge your PR. 1. Run ./script/publish from main `branch` supplying your token and version information. ## Secrets and authentication for publishing Repository administrators will need to manage the authentication keys for publishing to crates.io. - All the administrators of the repo should also be made owners of the crate, follow [cargo-owner](https://doc.rust-lang.org/cargo/commands/cargo-owner.html) command guide to add additional owners of the crate. - The token is generated by one of the repository administrators and placed under `CRATES_IO_TOKEN` repository secret, all the actions dealing with publishing need to use this secret for publishing to crates.io. ## Resources * [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) * [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) * [GitHub Help](https://help.github.com)