13da5c369Sopenharmony_ci# Contributing to nix 23da5c369Sopenharmony_ci 33da5c369Sopenharmony_ciWe're really glad you're interested in contributing to nix! This 43da5c369Sopenharmony_cidocument has a few pointers and guidelines to help get you started. 53da5c369Sopenharmony_ci 63da5c369Sopenharmony_ciTo have a welcoming and inclusive project, nix uses the Rust project's 73da5c369Sopenharmony_ci[Code of Conduct][conduct]. All contributors are expected to follow it. 83da5c369Sopenharmony_ci 93da5c369Sopenharmony_ci[conduct]: https://www.rust-lang.org/conduct.html 103da5c369Sopenharmony_ci 113da5c369Sopenharmony_ci 123da5c369Sopenharmony_ci# Issues 133da5c369Sopenharmony_ci 143da5c369Sopenharmony_ciWe use GitHub's [issue tracker][issues]. 153da5c369Sopenharmony_ci 163da5c369Sopenharmony_ci[issues]: https://github.com/nix-rust/nix/issues 173da5c369Sopenharmony_ci 183da5c369Sopenharmony_ci 193da5c369Sopenharmony_ci## Bug reports 203da5c369Sopenharmony_ci 213da5c369Sopenharmony_ciBefore submitting a new bug report, please [search existing 223da5c369Sopenharmony_ciissues][issue-search] to see if there's something related. If not, just 233da5c369Sopenharmony_ci[open a new issue][new-issue]! 243da5c369Sopenharmony_ci 253da5c369Sopenharmony_ciAs a reminder, the more information you can give in your issue, the 263da5c369Sopenharmony_cieasier it is to figure out how to fix it. For nix, this will likely 273da5c369Sopenharmony_ciinclude the OS and version, and the architecture. 283da5c369Sopenharmony_ci 293da5c369Sopenharmony_ci[issue-search]: https://github.com/nix-rust/nix/search?utf8=%E2%9C%93&q=is%3Aissue&type=Issues 303da5c369Sopenharmony_ci[new-issue]: https://github.com/nix-rust/nix/issues/new 313da5c369Sopenharmony_ci 323da5c369Sopenharmony_ci 333da5c369Sopenharmony_ci## Feature / API requests 343da5c369Sopenharmony_ci 353da5c369Sopenharmony_ciIf you'd like a new API or feature added, please [open a new 363da5c369Sopenharmony_ciissue][new-issue] requesting it. As with reporting a bug, the more 373da5c369Sopenharmony_ciinformation you can provide, the better. 383da5c369Sopenharmony_ci 393da5c369Sopenharmony_ci 403da5c369Sopenharmony_ci## Labels 413da5c369Sopenharmony_ci 423da5c369Sopenharmony_ciWe use labels to help manage issues. The structure is modeled after 433da5c369Sopenharmony_ci[Rust's issue labeling scheme][rust-labels]: 443da5c369Sopenharmony_ci- **A-** prefixed labels state which area of the project the issue 453da5c369Sopenharmony_ci relates to 463da5c369Sopenharmony_ci- **E-** prefixed labels explain the level of experience necessary to fix the 473da5c369Sopenharmony_ci issue 483da5c369Sopenharmony_ci- **O-** prefixed labels specify the OS for issues that are OS-specific 493da5c369Sopenharmony_ci- **R-** prefixed labels specify the architecture for issues that are 503da5c369Sopenharmony_ci architecture-specific 513da5c369Sopenharmony_ci 523da5c369Sopenharmony_ci[rust-labels]: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#issue-triage 533da5c369Sopenharmony_ci 543da5c369Sopenharmony_ci 553da5c369Sopenharmony_ci# Pull requests 563da5c369Sopenharmony_ci 573da5c369Sopenharmony_ciGitHub pull requests are the primary mechanism we use to change nix. GitHub itself has 583da5c369Sopenharmony_cisome [great documentation][pr-docs] on using the Pull Request feature. We use the 'fork and 593da5c369Sopenharmony_cipull' model described there. 603da5c369Sopenharmony_ci 613da5c369Sopenharmony_ciPlease make pull requests against the `master` branch. 623da5c369Sopenharmony_ci 633da5c369Sopenharmony_ciIf you change the API by way of adding, removing or changing something or if 643da5c369Sopenharmony_ciyou fix a bug, please add an appropriate note to the [change log][cl]. We 653da5c369Sopenharmony_cifollow the conventions of [Keep A CHANGELOG][kacl]. 663da5c369Sopenharmony_ci 673da5c369Sopenharmony_ci[cl]: https://github.com/nix-rust/nix/blob/master/CHANGELOG.md 683da5c369Sopenharmony_ci[kacl]: https://github.com/olivierlacan/keep-a-changelog/tree/18adb5f5be7a898d046f6a4acb93e39dcf40c4ad 693da5c369Sopenharmony_ci[pr-docs]: https://help.github.com/articles/using-pull-requests/ 703da5c369Sopenharmony_ci 713da5c369Sopenharmony_ci## Testing 723da5c369Sopenharmony_ci 733da5c369Sopenharmony_cinix has a test suite that you can run with `cargo test`. Ideally, we'd like pull 743da5c369Sopenharmony_cirequests to include tests where they make sense. For example, when fixing a bug, 753da5c369Sopenharmony_ciadd a test that would have failed without the fix. 763da5c369Sopenharmony_ci 773da5c369Sopenharmony_ciAfter you've made your change, make sure the tests pass in your development 783da5c369Sopenharmony_cienvironment. We also have [continuous integration set up on 793da5c369Sopenharmony_ciCirrus-CI][cirrus-ci], which might find some issues on other platforms. The CI 803da5c369Sopenharmony_ciwill run once you open a pull request. 813da5c369Sopenharmony_ci 823da5c369Sopenharmony_ciThere is also infrastructure for running tests for other targets 833da5c369Sopenharmony_cilocally. More information is available in the [CI Readme][ci-readme]. 843da5c369Sopenharmony_ci 853da5c369Sopenharmony_ci[cirrus-ci]: https://cirrus-ci.com/github/nix-rust/nix 863da5c369Sopenharmony_ci[ci-readme]: ci/README.md 873da5c369Sopenharmony_ci 883da5c369Sopenharmony_ci### Disabling a test in the CI environment 893da5c369Sopenharmony_ci 903da5c369Sopenharmony_ciSometimes there are features that cannot be tested in the CI environment. 913da5c369Sopenharmony_ciTo stop a test from running under CI, add `skip_if_cirrus!()` to it. Please 923da5c369Sopenharmony_cidescribe the reason it shouldn't run under CI, and a link to an issue if 933da5c369Sopenharmony_cipossible! 943da5c369Sopenharmony_ci 953da5c369Sopenharmony_ci## bors, the bot who merges all the PRs 963da5c369Sopenharmony_ci 973da5c369Sopenharmony_ciAll pull requests are merged via [bors], an integration bot. After the 983da5c369Sopenharmony_cipull request has been reviewed, the reviewer will leave a comment like 993da5c369Sopenharmony_ci 1003da5c369Sopenharmony_ci> bors r+ 1013da5c369Sopenharmony_ci 1023da5c369Sopenharmony_cito let bors know that it was approved. Then bors will check that it passes 1033da5c369Sopenharmony_citests when merged with the latest changes in the `master` branch, and 1043da5c369Sopenharmony_cimerge if the tests succeed. 1053da5c369Sopenharmony_ci 1063da5c369Sopenharmony_ci[bors]: https://bors-ng.github.io/ 1073da5c369Sopenharmony_ci 1083da5c369Sopenharmony_ci 1093da5c369Sopenharmony_ci## API conventions 1103da5c369Sopenharmony_ci 1113da5c369Sopenharmony_ciIf you're adding a new API, we have a [document with 1123da5c369Sopenharmony_ciconventions][conventions] to use throughout the nix project. 1133da5c369Sopenharmony_ci 1143da5c369Sopenharmony_ci[conventions]: https://github.com/nix-rust/nix/blob/master/CONVENTIONS.md 115