|
| 1 | +--- |
| 2 | +title: Contributing |
| 3 | +--- |
| 4 | + |
| 5 | +Welcome! We are very happy to accept community contributions to the project, whether through [filing issues](#contributing-issues) or [code](#contributing-code) in the form of [Pull Requests](#pull-requests). Please note that by participating in this project, you agree to abide by the [Code of Conduct](./code-of-conduct.md), as well as the terms of the [Developer Certificate of Origin](#developer-certificate-of-origin-dco). |
| 6 | + |
| 7 | +## Bi-Weekly Community Meeting |
| 8 | +A great way to get started is to join our bi-weekly community meeting. The meeting is held every other Monday from 1:30pm PT - 2:15pm PT. You can find the agenda and links to join [here](https://docs.google.com/document/d/1QdskbeCtgKcdWYHI6EXkLFxyzTCyVT6e8MgB3CaAhWI/edit?usp=sharing) |
| 9 | + |
| 10 | +## Contributing Issues |
| 11 | + |
| 12 | +Before opening any new issues, please search our [existing GitHub issues](https://github.com/project-copacetic/copacetic/issues) to check if your bug or suggestion has already been filed. If such an issue already exists, we recommend adding your comments and perspective to that existing issue instead. |
| 13 | + |
| 14 | +When opening an issue, please select the most appropriate template for what you're contributing: |
| 15 | + |
| 16 | +* **Bug Report:** If you would like to report the project or tool behaving in unexpected ways. |
| 17 | +* **Documentation Improvement:** If you have corrections or improvements to the project's documents, be they typos, factual errors, or missing content. |
| 18 | +* **Request:** If you have a feature request, suggestion, or a even a design proposal to review. |
| 19 | +* **Question:** If you would like to ask the maintainers a question about the project. |
| 20 | + |
| 21 | +## Contributing Code |
| 22 | + |
| 23 | +### Getting Started |
| 24 | + |
| 25 | +Follow the instructions to either: |
| 26 | + |
| 27 | +* [Setup your dev environment to build copa](./installation.md). |
| 28 | +* [Use the copa development container](#visual-studio-code-development-container) in [Visual Studio Code](https://code.visualstudio.com/). |
| 29 | + |
| 30 | +For an overview of the project components, refer to the [copa design](./design.md) document. |
| 31 | + |
| 32 | +### Visual Studio Code Development Container |
| 33 | + |
| 34 | +[VSCode](https://code.visualstudio.com/) supports development in a containerized environment through its [Remote - Container extension](https://code.visualstudio.com/docs/remote/containers). This folder provides a development container which encapsulates the dependencies specified in the [instructions to build and run copa](./installation.md). |
| 35 | + |
| 36 | +#### Prerequisites |
| 37 | + |
| 38 | +1. [Docker](https://docs.docker.com/get-docker/) |
| 39 | + > For Windows users, enabling [WSL2 back-end integration with Docker](https://docs.docker.com/docker-for-windows/wsl/) is recommended. |
| 40 | +2. [Visual Studio Code](https://code.visualstudio.com/) |
| 41 | +3. [Visual Studio Code Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) |
| 42 | + |
| 43 | +> **⚠ If running via Docker Desktop for Windows** |
| 44 | +> |
| 45 | +> Note that the [mounted workspace files appear owned by `root`](https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user) in the dev container, which will cause `git` commands to fail with a `fatal: detected dubious ownership in a repository` error due to [safe.directory](https://git-scm.com/docs/git-config/2.35.2#Documentation/git-config.txt-safedirectory) checks. This can be addressed by changing the mapped ownership of the workspace files in the dev container to the `vscode` user: |
| 46 | +> |
| 47 | +> ```bash |
| 48 | +> sudo chown -R vscode:vscode /workspace/copacetic |
| 49 | +> ``` |
| 50 | +
|
| 51 | +#### Personalizing user settings in a dev container |
| 52 | +
|
| 53 | +VSCode supports applying your user settings, such as your `.gitconfig`, to a dev container through the use of [dotfiles repositories](https://code.visualstudio.com/docs/remote/containers#_personalizing-with-dotfile-repositories). This can be done through your own VSCode `settings.json` file without changing the dev container image or configuration. |
| 54 | +
|
| 55 | +### Tests |
| 56 | +
|
| 57 | +Once you can successfully `make` the project, any code contributions should also successfully: |
| 58 | +
|
| 59 | +* Pass unit tests via `make test`. |
| 60 | +* Lint cleanly via `make lint`. |
| 61 | +
|
| 62 | +Pull requests will also be expected to pass the PR functional tests specified by `.github/workflows/build.yml`. |
| 63 | +
|
| 64 | +### Pull Requests |
| 65 | +
|
| 66 | +If you'd like to start contributing code to the project, you can search for [issues with the `good first issue` label](https://github.com/project-copacetic/copacetic/labels/good%20first%20issue). Other kinds of PR contributions we would look for include: |
| 67 | +
|
| 68 | +* Fixes for bugs and other correctness issues. |
| 69 | +* Docs and other content improvements (e.g. samples). |
| 70 | +* Extensions to support parsing new scanning report formats. |
| 71 | +* Extensions to support patching images based on new distros or using new package managers. |
| 72 | +
|
| 73 | +For any changes that may involve significant refactoring or development effort, we suggest that you file an issue to discuss the proposal with the maintainers first as it is unlikely that we will accept large PRs without prior discussion that have: |
| 74 | +
|
| 75 | +* Architectural changes (e.g. breaking interfaces or violations of [this project's design tenets](./design.md)). |
| 76 | +* Unsolicited features that significantly expand the functional scope of the tool. |
| 77 | +
|
| 78 | +Pull requests should be submitted from your fork of the project with the PR template filled out. This project uses the [Angular commit message format](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#-commit-message-format) for automated changelog generation, so it's helpful to be familiar with it as the maintainers will need to ensure adherence to it on accepting PRs. |
| 79 | +
|
| 80 | +We suggest: |
| 81 | +
|
| 82 | +* Use the standard header format of `"<type>: <short summary>"` where the `<type>` is one of the following: |
| 83 | + * **build:** Changes that affect the build system or external dependencies |
| 84 | + * **ci:** Changes to the GitHub workflows and configurations |
| 85 | + * **docs:** Documentation only changes |
| 86 | + * **feat:** A new feature |
| 87 | + * **fix:** A bug fix |
| 88 | + * **perf:** A code change that improves performance |
| 89 | + * **refactor:** A code change that neither fixes a bug nor adds a feature |
| 90 | + * **test:** Adding missing tests or correcting existing tests |
| 91 | +* Use a [concise, imperative description](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) of the changes included in the `<short summary>` of the header, the body of the PR, and generally in your commit messages. |
| 92 | +* Use [GitHub keywords](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) in the footer of your PR description, such as `closes` to automatically close issues the PR intends to address. |
| 93 | +
|
| 94 | +## Developer Certificate of Origin (DCO) |
| 95 | +
|
| 96 | +The [Developer Certificate of Origin](https://wiki.linuxfoundation.org/dco) (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the [full text of the DCO](https://developercertificate.org/), reformatted for readability: |
| 97 | +
|
| 98 | +> By making a contribution to this project, I certify that: |
| 99 | +> |
| 100 | +> (a) The contribution was created in whole or in part by me and I |
| 101 | +> have the right to submit it under the open source license |
| 102 | +> indicated in the file; or |
| 103 | +> |
| 104 | +> (b) The contribution is based upon previous work that, to the best |
| 105 | +> of my knowledge, is covered under an appropriate open source |
| 106 | +> license and I have the right under that license to submit that |
| 107 | +> work with modifications, whether created in whole or in part |
| 108 | +> by me, under the same open source license (unless I am |
| 109 | +> permitted to submit under a different license), as indicated |
| 110 | +> in the file; or |
| 111 | +> |
| 112 | +> (c) The contribution was provided directly to me by some other |
| 113 | +> person who certified (a), (b) or (c) and I have not modified |
| 114 | +> it. |
| 115 | +> |
| 116 | +> (d) I understand and agree that this project and the contribution |
| 117 | +> are public and that a record of the contribution (including all |
| 118 | +> personal information I submit with it, including my sign-off) is |
| 119 | +> maintained indefinitely and may be redistributed consistent with |
| 120 | +> this project or the open source license(s) involved. |
| 121 | +
|
| 122 | +Contributors _sign-off_ that they adhere to these requirements by adding a `Signed-off-by` line to commit messages. |
| 123 | +
|
| 124 | +```text |
| 125 | +This is my commit message |
| 126 | +
|
| 127 | +Signed-off-by: Random J Developer <[email protected]> |
| 128 | +``` |
| 129 | +
|
| 130 | +Git even has a `-s` command line option to append this automatically to your commit message: |
| 131 | +
|
| 132 | +```bash |
| 133 | +git commit -s -m 'This is my commit message' |
| 134 | +``` |
| 135 | +
|
| 136 | +Pull requests that do not contain a valid `Signed-off-by` line cannot be merged. |
| 137 | +
|
| 138 | +### I didn't sign my commit, now what? |
| 139 | +
|
| 140 | +No worries - You can easily amend your commit with a sign-off and force push the change to your submitting branch: |
| 141 | +
|
| 142 | +```bash |
| 143 | +git switch <branch-name> |
| 144 | +git commit --amend --no-edit --signoff |
| 145 | +git push --force-with-lease <remote-name> <branch-name> |
| 146 | +``` |
| 147 | +
|
| 148 | +## Code of Conduct |
| 149 | + |
| 150 | +This project has adopted the [Contributor Covenant Code of Conduct](./code-of-conduct.md). |
0 commit comments