|
| 1 | +# Contribute to Agave-CLI |
| 2 | + |
| 3 | +Want to contribute? Awesome! We have a contributor's guide that explains |
| 4 | +[setting up a development environment and the contribution process](docs/contributing/). |
| 5 | + |
| 6 | +This page contains information about reporting issues as well as some tips and |
| 7 | +guidelines useful to experienced open source contributors. |
| 8 | +Finally, make sure |
| 9 | +you read our [community guidelines](#community-guidelines) before you |
| 10 | +start participating. |
| 11 | + |
| 12 | +## Topics |
| 13 | + |
| 14 | +* [Reporting Security Issues](#reporting-security-issues) |
| 15 | +* [Design and Cleanup Proposals](#design-and-cleanup-proposals) |
| 16 | +* [Reporting Issues](#reporting-other-issues) |
| 17 | +* [Quick Contribution Tips and Guidelines](#quick-contribution-tips-and-guidelines) |
| 18 | +* [Comunity Guidelines](#community-guidelines) |
| 19 | + |
| 20 | +## Reporting security issues |
| 21 | + |
| 22 | +The Maintainers take security seriously. If you discover a security |
| 23 | +issue, please bring it to their attention right away! |
| 24 | + |
| 25 | +Please **DO NOT** file a public issue, instead send your report privately to |
| 26 | +[jochoa@tacc.utexas.edu](mailto:jochoa@tacc.utexas.edu). |
| 27 | + |
| 28 | +Security reports are greatly appreciated and we will publicly thank you for it. |
| 29 | + |
| 30 | + |
| 31 | +## Reporting other issues |
| 32 | + |
| 33 | +A great way to contribute to the project is to send a detailed report when you |
| 34 | +encounter an issue. We always appreciate a well-written, thorough bug report, |
| 35 | +and will thank you for it! |
| 36 | + |
| 37 | +Check that [our issue database](https://github.com/TACC-Cloud/agave-cli/issues) |
| 38 | +doesn't already include that problem or suggestion before submitting an issue. |
| 39 | +If you find a match, you can use the "subscribe" button to get notified on |
| 40 | +updates. Do *not* leave random "+1" or "I have this too" comments, as they |
| 41 | +only clutter the discussion, and don't help resolving it. However, if you |
| 42 | +have ways to reproduce the issue or have additional information that may help |
| 43 | +resolving the issue, please leave a comment. |
| 44 | + |
| 45 | +When reporting issues, always include: |
| 46 | + |
| 47 | +* The version of the operating system you are using. |
| 48 | + |
| 49 | +Also include the steps required to reproduce the problem if possible and |
| 50 | +applicable. This information will help us review and fix your issue faster. |
| 51 | +When sending lengthy log-files, consider posting them as a gist (https://gist.github.com). |
| 52 | +Don't forget to remove sensitive data from your logfiles before posting (you can |
| 53 | +replace those parts with "REDACTED"). |
| 54 | + |
| 55 | +## Quick contribution tips and guidelines |
| 56 | + |
| 57 | +This section gives the experienced contributor some tips and guidelines. |
| 58 | + |
| 59 | +### Pull requests are always welcome |
| 60 | + |
| 61 | +Not sure if that typo is worth a pull request? Found a bug and know how to fix |
| 62 | +it? Do it! We will appreciate it. Any significant improvement should be |
| 63 | +documented as [a GitHub issue](https://github.com/TACC-Cloud/agave-cli/issues) before |
| 64 | +anybody starts working on it. |
| 65 | + |
| 66 | +We are always thrilled to receive pull requests. We do our best to process them |
| 67 | +quickly. If your pull request is not accepted on the first try, |
| 68 | +don't get discouraged! |
| 69 | + |
| 70 | + |
| 71 | +### Design and cleanup proposals |
| 72 | + |
| 73 | +You can propose new designs for existing features. You can also design |
| 74 | +entirely new features. We really appreciate contributors who want to refactor or |
| 75 | +otherwise cleanup our project. |
| 76 | + |
| 77 | + |
| 78 | +### Conventions |
| 79 | + |
| 80 | +Fork the repository and make changes on your fork in a feature branch: |
| 81 | + |
| 82 | +- If it's a bug fix branch, name it XXXX-something where XXXX is the number of |
| 83 | + the issue. |
| 84 | +- If it's a feature branch, create an enhancement issue to announce |
| 85 | + your intentions, and name it XXXX-something where XXXX is the number of the |
| 86 | + issue. |
| 87 | + |
| 88 | +Submit tests for your changes. See [TESTING.md](./TESTING.md) for details. |
| 89 | + |
| 90 | +Update the documentation when creating or modifying features. Test your |
| 91 | +documentation changes for clarity, concision, and correctness, as well as a |
| 92 | +clean documentation build. |
| 93 | + |
| 94 | +Write clean code. Universally formatted code promotes ease of writing, reading, |
| 95 | +and maintenance. |
| 96 | +We follow the [Google Python Style Guide](https://github.com/google/styleguide/blob/gh-pages/pyguide.md). |
| 97 | + |
| 98 | +Pull request descriptions should be as clear as possible and include a reference |
| 99 | +to all the issues that they address. |
| 100 | + |
| 101 | +### Successful Changes |
| 102 | + |
| 103 | +Before contributing large or high impact changes, make the effort to coordinate |
| 104 | +with the maintainers of the project before submitting a pull request. This |
| 105 | +prevents you from doing extra work that may or may not be merged. |
| 106 | + |
| 107 | +Large PRs that are just submitted without any prior communication are unlikely |
| 108 | +to be successful. |
| 109 | + |
| 110 | +While pull requests are the methodology for submitting changes to code, changes |
| 111 | +are much more likely to be accepted if they are accompanied by additional |
| 112 | +engineering work. While we don't define this explicitly, most of these goals |
| 113 | +are accomplished through communication of the design goals and subsequent |
| 114 | +solutions. Often times, it helps to first state the problem before presenting |
| 115 | +solutions. |
| 116 | + |
| 117 | +Typically, the best methods of accomplishing this are to submit an issue, |
| 118 | +stating the problem. This issue can include a problem statement and a |
| 119 | +checklist with requirements. If solutions are proposed, alternatives should be |
| 120 | +listed and eliminated. Even if the criteria for elimination of a solution is |
| 121 | +frivolous, say so. |
| 122 | + |
| 123 | +Larger changes typically work best with design documents. These are focused on |
| 124 | +providing context to the design at the time the feature was conceived and can |
| 125 | +inform future documentation contributions. |
| 126 | + |
| 127 | +### Commit Messages |
| 128 | + |
| 129 | +Commit messages must start with a capitalized and short summary (max. 50 chars) |
| 130 | +written in the imperative, followed by an optional, more detailed explanatory |
| 131 | +text which is separated from the summary by an empty line. |
| 132 | + |
| 133 | +Commit messages should follow best practices, including explaining the context |
| 134 | +of the problem and how it was solved, including in caveats or follow up changes |
| 135 | +required. They should tell the story of the change and provide readers |
| 136 | +understanding of what led to it. |
| 137 | + |
| 138 | +If you're lost about what this even means, please see [How to Write a Git |
| 139 | +Commit Message](http://chris.beams.io/posts/git-commit/) for a start. |
| 140 | + |
| 141 | +In practice, the best approach to maintaining a nice commit message is to |
| 142 | +leverage a `git add -p` and `git commit --amend` to formulate a solid |
| 143 | +changeset. This allows one to piece together a change, as information becomes |
| 144 | +available. |
| 145 | + |
| 146 | +If you squash a series of commits, don't just submit that. Re-write the commit |
| 147 | +message, as if the series of commits was a single stroke of brilliance. |
| 148 | + |
| 149 | +That said, there is no requirement to have a single commit for a PR, as long as |
| 150 | +each commit tells the story. For example, if there is a feature that requires a |
| 151 | +package, it might make sense to have the package in a separate commit then have |
| 152 | +a subsequent commit that uses it. |
| 153 | + |
| 154 | +Remember, you're telling part of the story with the commit message. Don't make |
| 155 | +your chapter weird. |
| 156 | + |
| 157 | +### Review |
| 158 | + |
| 159 | +Code review comments may be added to your pull request. Discuss, then make the |
| 160 | +suggested modifications and push additional commits to your feature branch. Post |
| 161 | +a comment after pushing. New commits show up in the pull request automatically, |
| 162 | +but the reviewers are notified only when you comment. |
| 163 | + |
| 164 | +Pull requests must be cleanly rebased on top of master without multiple branches |
| 165 | +mixed into the PR. |
| 166 | + |
| 167 | +**Git tip**: If your PR no longer merges cleanly, use `rebase master` in your |
| 168 | +feature branch to update your pull request rather than `merge master`. |
| 169 | + |
| 170 | +Before you make a pull request, squash your commits into logical units of work |
| 171 | +using `git rebase -i` and `git push -f`. A logical unit of work is a consistent |
| 172 | +set of patches that should be reviewed together: for example, upgrading the |
| 173 | +version of a vendored dependency and taking advantage of its now available new |
| 174 | +feature constitute two separate units of work. Implementing a new function and |
| 175 | +calling it in another file constitute a single logical unit of work. The very |
| 176 | +high majority of submissions should have a single commit, so if in doubt: squash |
| 177 | +down to one. |
| 178 | + |
| 179 | +After every commit, [make sure the test suite passes](./TESTING.md). Include |
| 180 | +documentation changes in the same pull request so that a revert would remove |
| 181 | +all traces of the feature or fix. |
| 182 | + |
| 183 | +Include an issue reference like `Closes #XXXX` or `Fixes #XXXX` in commits that |
| 184 | +close an issue. Including references automatically closes the issue on a merge. |
| 185 | + |
| 186 | +Please do not add yourself to the `AUTHORS` file, as it is regenerated regularly |
| 187 | +from the Git history. |
| 188 | + |
| 189 | +Please see the [Coding Style](#coding-style) for further guidelines. |
| 190 | + |
| 191 | +### Merge approval |
| 192 | + |
| 193 | +Maintainers use LGTM (Looks Good To Me) in comments on the code review to |
| 194 | +indicate acceptance, or use the Github review approval feature. |
| 195 | + |
| 196 | + |
| 197 | +### Sign your work |
| 198 | + |
| 199 | +The sign-off is a simple line at the end of the explanation for the patch. Your |
| 200 | +signature certifies that you wrote the patch or otherwise have the right to pass |
| 201 | +it on as an open-source patch. The rules are pretty simple: if you can certify |
| 202 | +the below (from [developercertificate.org](http://developercertificate.org/)): |
| 203 | + |
| 204 | +``` |
| 205 | +Developer Certificate of Origin |
| 206 | +Version 1.1 |
| 207 | +
|
| 208 | +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. |
| 209 | +1 Letterman Drive |
| 210 | +Suite D4700 |
| 211 | +San Francisco, CA, 94129 |
| 212 | +
|
| 213 | +Everyone is permitted to copy and distribute verbatim copies of this |
| 214 | +license document, but changing it is not allowed. |
| 215 | +
|
| 216 | +Developer's Certificate of Origin 1.1 |
| 217 | +
|
| 218 | +By making a contribution to this project, I certify that: |
| 219 | +
|
| 220 | +(a) The contribution was created in whole or in part by me and I |
| 221 | + have the right to submit it under the open source license |
| 222 | + indicated in the file; or |
| 223 | +
|
| 224 | +(b) The contribution is based upon previous work that, to the best |
| 225 | + of my knowledge, is covered under an appropriate open source |
| 226 | + license and I have the right under that license to submit that |
| 227 | + work with modifications, whether created in whole or in part |
| 228 | + by me, under the same open source license (unless I am |
| 229 | + permitted to submit under a different license), as indicated |
| 230 | + in the file; or |
| 231 | +
|
| 232 | +(c) The contribution was provided directly to me by some other |
| 233 | + person who certified (a), (b) or (c) and I have not modified |
| 234 | + it. |
| 235 | +
|
| 236 | +(d) I understand and agree that this project and the contribution |
| 237 | + are public and that a record of the contribution (including all |
| 238 | + personal information I submit with it, including my sign-off) is |
| 239 | + maintained indefinitely and may be redistributed consistent with |
| 240 | + this project or the open source license(s) involved. |
| 241 | +``` |
| 242 | + |
| 243 | +Then you just add a line to every git commit message: |
| 244 | + |
| 245 | + Signed-off-by: Joe Smith <joe.smith@email.com> |
| 246 | + |
| 247 | +Use your real name (sorry, no pseudonyms or anonymous contributions.) |
| 248 | + |
| 249 | +If you set your `user.name` and `user.email` git configs, you can sign your |
| 250 | +commit automatically with `git commit -s`. |
| 251 | + |
| 252 | +## community guidelines |
| 253 | +The guidelines are simple: be courteous to others, write readable code, and |
| 254 | +remeber that the repo is the source of all truth (any discussion pertaiing this |
| 255 | +project will be held in issues and PRs). |
| 256 | + |
| 257 | +## Coding Style |
| 258 | + |
| 259 | +Unless explicitly stated, we follow all coding guidelines from the Go |
| 260 | +community. While some of these standards may seem arbitrary, they somehow seem |
| 261 | +to result in a solid, consistent codebase. |
| 262 | + |
| 263 | +It is possible that the code base does not currently comply with these |
| 264 | +guidelines. We are not looking for a massive PR that fixes this, since that |
| 265 | +goes against the spirit of the guidelines. All new contributions should make a |
| 266 | +best effort to clean up and make the code base better than they left it. |
| 267 | +Obviously, apply your best judgement. Remember, the goal here is to make the |
| 268 | +code base easier for humans to navigate and understand. Always keep that in |
| 269 | +mind when nudging others to comply. |
| 270 | + |
| 271 | +The rules: |
| 272 | + |
| 273 | +1. Recommended: Format code using [`yapf`](https://github.com/google/yapf/) |
| 274 | + (`yapf -i --style=google src.py`). |
| 275 | +2. All code should pass the default levels of |
| 276 | + [`pylint`](https://www.pylint.org/). |
| 277 | +3. Comment the code. Tell us the why, the history and the context. |
| 278 | +4. Document _all_ declarations and methods, even private ones. Declare |
| 279 | + expectations, caveats and anything else that may be important. |
| 280 | +5. Variable name length should be proportional to its context and no longer. |
| 281 | + `noCommaALongVariableNameLikeThisIsNotMoreClearWhenASimpleCommentWouldDo`. |
| 282 | + In practice, short methods will have short variable names and globals will |
| 283 | + have longer names. |
| 284 | +6. No underscores in package names. If you need a compound name, step back, |
| 285 | + and re-examine why you need a compound name. If you still think you need a |
| 286 | + compound name, lose the underscore. |
| 287 | +7. No utils or helpers packages. If a function is not general enough to |
| 288 | + warrant its own package, it has not been written generally enough to be a |
| 289 | + part of a util package. Just leave it unexported and well-documented. |
| 290 | +8. Even though we call these "rules" above, they are actually just |
| 291 | + guidelines. Since you've read all the rules, you now know that. |
| 292 | + |
| 293 | +For more information read [PEP 8 - Style Guide for Python Code](https://www.python.org/dev/peps/pep-0008/?#package-and-module-names). |
0 commit comments