|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Contributions should be made via pull requests. Pull requests will be reviewed |
| 4 | +by one or more maintainers and merged when acceptable. |
| 5 | + |
| 6 | +The goal of the Compose Reference Implementation is to be a complete and simple implementation of [the Compose Specification](https://github.com/compose-spec/compose-spec/). |
| 7 | +A developer should be able by reading the code: |
| 8 | + - to understand the main concept of the specification |
| 9 | + - have concrete examples to develop his own implementation. |
| 10 | + |
| 11 | +## Successful Changes |
| 12 | + |
| 13 | +We ask that before contributing, please make the effort to ensure you have read the [Compose Specification](https://github.com/compose-spec/compose-spec/blob/master/spec.md) and |
| 14 | +[Compose Vision](https://github.com/compose-spec/compose-spec/blob/master/VISION.md) to ensure that your change is in keeping with the objectives of Compose. |
| 15 | +You can coordinate with the maintainers of the project before submitting large proposals |
| 16 | +or high impact PRs, this will prevent you from doing extra work that may or may not be merged. |
| 17 | +PRs that are just submitted without any prior communication will likely be summarily closed. |
| 18 | + |
| 19 | +While pull requests are the methodology for submitting changes, changes are much more |
| 20 | +likely to be accepted if they are accompanied by a full justification of what developer |
| 21 | +problem you are solving. Often times, it helps to first state the problem before presenting |
| 22 | +solutions. |
| 23 | + |
| 24 | +Typically, the best methods of accomplishing this are to submit an issue, stating the |
| 25 | +problem. This issue can include a problem statement and a checklist with requirements. |
| 26 | +If solutions are proposed, alternatives should be listed and eliminated. Even if the |
| 27 | +criteria for elimination of a solution is frivolous, say so. |
| 28 | +Larger changes typically work best with design documents, these are items which may |
| 29 | +change the scope or vision for Compose. These should be accompanied with a more detailed |
| 30 | +overview of the proposal, providing context to the justfication at the time the feature |
| 31 | +was conceived and can inform future documentation contributions. |
| 32 | + |
| 33 | +## Commit Messages |
| 34 | + |
| 35 | +There are times for one line commit messages and this is not one of them. |
| 36 | +Commit messages should follow best practices, including explaining the context |
| 37 | +of the problem and how it was solved, including in caveats or follow up changes |
| 38 | +required. They should tell the story of the change and provide readers |
| 39 | +understanding of what led to it. |
| 40 | + |
| 41 | +If you're lost about what this even means, please see [How to Write a Git |
| 42 | +Commit Message](http://chris.beams.io/posts/git-commit/) for a start. |
| 43 | + |
| 44 | +In practice, the best approach to maintaining a nice commit message is to |
| 45 | +leverage a `git add -p` and `git commit --amend` to formulate a solid |
| 46 | +changeset. This allows one to piece together a change, as information becomes |
| 47 | +available. |
| 48 | + |
| 49 | +If you squash a series of commits, don't just submit that. Re-write the commit |
| 50 | +message, as if the series of commits was a single stroke of brilliance. |
| 51 | + |
| 52 | +That said, there is no requirement to have a single commit for a PR, as long as |
| 53 | +each commit tells the story. For example, if there is a feature that requires a |
| 54 | +package, it might make sense to have the package in a separate commit then have |
| 55 | +a subsequent commit that uses it. |
| 56 | + |
| 57 | +Remember, you're telling part of the story with the commit message. Don't make |
| 58 | +your chapter weird. |
| 59 | + |
| 60 | +## Sign your work |
| 61 | + |
| 62 | +The sign-off is a simple line at the end of the explanation for the patch. Your |
| 63 | +signature certifies that you wrote the patch or otherwise have the right to pass |
| 64 | +it on as an open-source patch. The rules are pretty simple: if you can certify |
| 65 | +the below (from [developercertificate.org](http://developercertificate.org/)): |
| 66 | + |
| 67 | +``` |
| 68 | +Developer Certificate of Origin |
| 69 | +Version 1.1 |
| 70 | +
|
| 71 | +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. |
| 72 | +660 York Street, Suite 102, |
| 73 | +San Francisco, CA 94110 USA |
| 74 | +
|
| 75 | +Everyone is permitted to copy and distribute verbatim copies of this |
| 76 | +license document, but changing it is not allowed. |
| 77 | +
|
| 78 | +Developer's Certificate of Origin 1.1 |
| 79 | +
|
| 80 | +By making a contribution to this project, I certify that: |
| 81 | +
|
| 82 | +(a) The contribution was created in whole or in part by me and I |
| 83 | + have the right to submit it under the open source license |
| 84 | + indicated in the file; or |
| 85 | +
|
| 86 | +(b) The contribution is based upon previous work that, to the best |
| 87 | + of my knowledge, is covered under an appropriate open source |
| 88 | + license and I have the right under that license to submit that |
| 89 | + work with modifications, whether created in whole or in part |
| 90 | + by me, under the same open source license (unless I am |
| 91 | + permitted to submit under a different license), as indicated |
| 92 | + in the file; or |
| 93 | +
|
| 94 | +(c) The contribution was provided directly to me by some other |
| 95 | + person who certified (a), (b) or (c) and I have not modified |
| 96 | + it. |
| 97 | +
|
| 98 | +(d) I understand and agree that this project and the contribution |
| 99 | + are public and that a record of the contribution (including all |
| 100 | + personal information I submit with it, including my sign-off) is |
| 101 | + maintained indefinitely and may be redistributed consistent with |
| 102 | + this project or the open source license(s) involved. |
| 103 | +``` |
| 104 | + |
| 105 | +Then you just add a line to every git commit message: |
| 106 | + |
| 107 | + Signed-off-by: Joe Smith <[email protected]> |
| 108 | + |
| 109 | +Use your real name (sorry, no pseudonyms or anonymous contributions.) |
| 110 | + |
| 111 | +If you set your `user.name` and `user.email` git configs, you can sign your |
| 112 | +commit automatically with `git commit -s`. |
| 113 | + |
0 commit comments