github.com/Microsoft/fabrikate@v0.0.0-20190420002442-bff75be28d02/docs/contributing.md (about)

     1  # Contibuting to Fabrikate
     2  
     3  We do not claim to have all the answers and would gratefully appreciate contributions. This document covers everything you need to know to contribute to Fabrikate.
     4  
     5  ## Issues and Feature Requests
     6  
     7  This project tracks issues exclusively via our project on Github: please [file issues](https://github.com/Microsoft/fabrikate/issues/new/choose) there.
     8  
     9  Please do not ask questions via Github issues. Instead, please [join us on Slack](https://publicslack.com/slacks/https-bedrockco-slack-com/invites/new) and ask there.
    10  
    11  For issues and feature requests, please follow the general format suggested by the template. Our core team working on Fabrikate utilizes agile development and would appreciate feature requests phrased in the form of a [user story](https://www.mountaingoatsoftware.com/agile/user-stories), as this helps us understand better the context of how the feature would be utilized.
    12  
    13  ## Pull Requests
    14  
    15  Every pull request should be matched with a Github issue. If the pull request is substantial enough to include newly designed elements, this issue should describe the proposed design in enough detail that we can come to an agreement before effort is applied to build the feature. Feel free to start conversations on our Slack #fabrikate channel to get feedback on a design.
    16  
    17  When submitting a pull request, please reference the issue the pull request is intended to solve via "Closes #xyz" where is the issue number that is addressed.
    18  
    19  ## Cloning Fabrikate
    20  
    21  Fabrikate is written in [golang](https://golang.org/) so the first step is to make sure you have a fully functioning go development enviroment.
    22  
    23  If you intend to make contributions to Fabrikate (versus just build it), the first step is to [fork Fabrikate on Github](https://github.com/Microsoft/fabrikate) into your own account.
    24  
    25  Next, clone Fabrikate into your GOPATH (which defaults to $HOME/go) with `go get` (substitute your GitHub username for `Microsoft` below if you forked the repo):
    26  
    27  ```sh
    28  $ go get github.com/Microsoft/fabrikate
    29  ```
    30  
    31  If you forked Fabrikate, this will clone your fork into `$GOPATH/<github username>/fabrikate`.  You will want to move to $GOPATH/Microsoft/fabrikate such that the imports in the project work correctly.
    32  
    33  ### Configuring git
    34  Under `$GOPATH/Microsoft/fabrikate` set up git so that you can push changes to the fork:
    35  
    36  ```sh
    37  $ git remote add <name> <github_url_of_fork>
    38  ```
    39  
    40  For example:
    41  
    42  ```sh
    43  $ git remote add myremote https://github.com/octocat/Spoon-Knife
    44  ```
    45  
    46  To push changes to the fork:
    47  
    48  ```sh
    49  $ git push myremote mycurrentbranch
    50  ```
    51  
    52  ## Building Fabrikate
    53  
    54  From the root of the project (which if you followed the instructions above should be `$GOPATH/Microsoft/fabrikate`), first fetch project dependencies with:
    55  
    56  ```sh
    57  $ go get ./...
    58  ```
    59  
    60  You can then build a Fabrikate executable with:
    61  
    62  ```sh
    63  $ go build -o fab
    64  ```
    65  
    66  To build a complete set of release binaries across supported architectures, use our build script, specifying a version number of the release:
    67  
    68  ```sh
    69  $ scripts/build 0.5.0
    70  ```
    71  
    72  ## Testing Fabrikate
    73  
    74  Fabrikate utilizes test driven development to maintain quality across commits. Every code contribution requires covering tests to be accepted by the project and every pull request is built by CI/CD to ensure that the tests pass and that the code is lint free.
    75  
    76  You can run project tests by executing the following commands:
    77  
    78  ```sh
    79  $ go test -v -race ./...
    80  ```
    81  
    82  And run the linter with:
    83  
    84  ```sh
    85  $ golangci-lint run
    86  ```
    87  
    88  ## Contributing
    89  
    90  This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
    91  
    92  When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
    93  
    94  This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
    95  For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
    96  contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.