| 1 | # Contribution Guide to gokrb5 |
| 2 | |
| 3 | If you're reading this then I guess you are interested in contributing to gokrb5 which is brilliant! |
| 4 | Thank you for your interest and taking the time to read this guide. |
| 5 | |
| 6 | The information below should help you successfully contribute and by following these guidelines you are expressing the |
| 7 | respect you have for the project and other contributors. |
| 8 | |
| 9 | In return I will endeavour to respond promptly to issues and pull requests but please have patience as I do this in my |
| 10 | spare time. Therefore it can take a few weeks for me to get round to some items. |
| 11 | |
| 12 | A variety of contribution types are welcome: |
| 13 | * Raising bug reports. |
| 14 | * Suggesting enhancements. |
| 15 | * Updating and adding to documentation. |
| 16 | * Fixing bugs. |
| 17 | * Coding enhancements. |
| 18 | * Extending test coverage. |
| 19 | |
| 20 | This project is not intended to be a support forum for general Kerberos issues and troubleshooting specific environment |
| 21 | configurations. |
| 22 | |
| 23 | ## Ground Rules |
| 24 | |
| 25 | Above all, be respectful and considerate of others. This means: |
| 26 | * Assume miss-communication is mistake not malice. |
| 27 | * Be patient. Many of those contributing are doing this out of good will and in their own time. |
| 28 | If something is really important to you, describe why and what the impact is so that others can understand and relate to |
| 29 | it. |
| 30 | * Provide feedback in a constructive manner. |
| 31 | |
| 32 | ### Code Contribution Ground Rules |
| 33 | |
| 34 | When contributing code please adhere to these responsibilities: |
| 35 | * Create issues (if one does not already exist) for any changes and enhancements that you wish to make. |
| 36 | Discuss how you intend to fix the bug or implement the enhancement to give the community a chance to comment and get us |
| 37 | to the best solution. |
| 38 | * Do not create any new packages unless absolutely necessary. |
| 39 | * Do not alter the existing exported functions and constants unless absolutely necessary. |
| 40 | This would require a major (vX.\_.\_) version update. |
| 41 | * Only add new exported functions and constants if absolutely necessary. |
| 42 | This would require a minor (v\_.X.\_) version update. |
| 43 | * Keep your code platform agnostic. |
| 44 | * Ensure that any functions added or updated are covered by tests. |
| 45 | * Ensure tests pass. |
| 46 | * Ensure godoc comments are created or updated as required for any new or updated code. |
| 47 | * Ensure your contributions are formatted correctly with gofmt. The travis build will test this. |
| 48 | * Do not use external package dependencies. |
| 49 | As gokrb5 is designed to be a core library used in other applications it is best to avoid dependencies the project has |
| 50 | no control over, other than the Go standard library, as issues with any dependency could have large knock on effects. |
| 51 | * Provide useful commit messages. |
| 52 | * Pull requests must address one issue only and keep to the scope of the issue. This makes it easier to review and merge, so your contribution will get |
| 53 | incorporated faster this way. |
| 54 | * Pull requests must have a message obeying this format: |
| 55 | ``` |
| 56 | <short summary starting with a verb in lowercase and less than 50 characters> |
| 57 | |
| 58 | More detailed explanatory text. This should reference the related issue. |
| 59 | ``` |
| 60 | This to adhere to the [git best practice](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project) and |
| 61 | mirror the [contribution guidelines for the Go standard libarary](https://golang.org/doc/contribute.html). |
| 62 | An Example: |
| 63 | ``` |
| 64 | update to the godoc comments for the function Blah |
| 65 | |
| 66 | The godoc comments to function subpkg.Blah have been updated to make it |
| 67 | clearer as to what the function is for. |
| 68 | ``` |
| 69 | |
| 70 | ### Issue Raising Ground Rules |
| 71 | A good rule of thumb: The easier you make it for the reader of an issue to help the more help you'll get. |
| 72 | |
| 73 | #### Bugs |
| 74 | When raising bugs please include the following items in your issue: |
| 75 | * The version of gokrb5 being used (vX.Y.Z or master or branch name). |
| 76 | * The version of Go being used (output of the ```go version``` command is handy). |
| 77 | * Details of the environment in which you are seeing the issue. For example, what is being used as the KDC, |
| 78 | what the krb5.conf contains, etc. |
| 79 | * Details on how to re-create the issue. |
| 80 | * Details on what you are experiencing that indicates the issue. |
| 81 | * What you expected to see. |
| 82 | * In which gokrb5 package(s) you think the issue arises from. |
| 83 | * If the bug relates to compliance with an RFC please specify the RFC number and section you are referring to. |
| 84 | |
| 85 | #### Enhancements |
| 86 | When raising enhancement requests or suggestions please include the following: |
| 87 | * What the enhancment is or would do. |
| 88 | * Why you need the enhancement or why you think it would be a good idea. |
| 89 | * Any suggestions you may have on how to implement. |
| 90 | |
| 91 | ## Tips |
| 92 | |
| 93 | ### Running Tests |
| 94 | Running the tests without any particular switches runs only the unit tests. |
| 95 | |
| 96 | It is recommended to run tests with the ```-race``` argument. |
| 97 | |
| 98 | There are integration tests that run against various other network services such as KDCs, HTTP web servers, DNS servers, |
| 99 | etc. To run these pass ```-tags=integration``` as an argument to the go test command. |
| 100 | There are vagrant and docker resources available to spin up these network services. See the |
| 101 | [readme](https://github.com/jcmturner/gokrb5/blob/master/testenv/README.md) in the testenv directory for instructions. |