|
| 1 | += UnifiedDB Contribution Guide |
| 2 | + |
| 3 | +Thank you for your interest in contributing to UnifiedDB! |
| 4 | +We welcome all contributions that meet our xref:CODE_OF_CONDUCT.adoc[code of conduct]. |
| 5 | + |
| 6 | +== Ways to contribute |
| 7 | + |
| 8 | +=== Bug Reports |
| 9 | + |
| 10 | +Bug reports should be filed as a https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] using the `Bug report` template. |
| 11 | + |
| 12 | +=== Feature Requests |
| 13 | + |
| 14 | +Bug reports should be filed as a https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] using the `Feature request` template. |
| 15 | + |
| 16 | +=== Bug Fixes |
| 17 | + |
| 18 | +Bug fixes should be submitted as a Pull Request. |
| 19 | + |
| 20 | +There should be a corresponding https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] for the PR. Ensure the two are linked by adding "closes #<issue number>" in the PR description. |
| 21 | + |
| 22 | +=== New data, tools, and features |
| 23 | + |
| 24 | +New data (for example, adding an extension), tools, or features should be submitted as a Pull Request. |
| 25 | + |
| 26 | +There should be a corresponding https://github.com/riscv-software-src/riscv-unified-db/issues[GitHub Issue] for the PR. Ensure the two are linked by adding "closes #<issue number>" in the PR description. |
| 27 | + |
| 28 | +== Submitting a Pull Request |
| 29 | + |
| 30 | +All patches must meet the UnifiedDB code standards. This includes: |
| 31 | + |
| 32 | +* Pass regression tests (run locally as `./do test:regress`) |
| 33 | +* Use appropriate commit messages |
| 34 | +* Go through code review as a Pull Request |
| 35 | + |
| 36 | +=== Regression tests |
| 37 | + |
| 38 | +All contributions must pass the full suite of regression tests. |
| 39 | +Regression tests are checked in GitHub for every PR, and they can also be run locally using `./do test:regress`. |
| 40 | + |
| 41 | +If a Pull Request adds a new feature that is not already covered by the regression test suite, it |
| 42 | +must add at least one new test. |
| 43 | + |
| 44 | +=== Commit messages |
| 45 | + |
| 46 | +UnifiedDB adheres to https://www.conventionalcommits.org/en/v1.0.0[Conventional Commits v1.0.0]. |
| 47 | + |
| 48 | +The guidelines below are adapted from https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md[the Angular commit message guidelines]. |
| 49 | + |
| 50 | +Every commit message consists of a mandatory *header*, a mandatory *body*, and an optional *footer*. |
| 51 | + |
| 52 | +``` |
| 53 | +<header> |
| 54 | +<BLANK LINE> |
| 55 | +<body> |
| 56 | +<BLANK LINE> |
| 57 | +<footer> |
| 58 | +``` |
| 59 | + |
| 60 | +A template for commit messages is stored in xref:.gitmessage[], and will be installed automatically through the standard UnifiedDB setup script so that it appears when executing `git commit`. |
| 61 | + |
| 62 | +==== Header |
| 63 | + |
| 64 | +.UnifiedDB commit header format |
| 65 | +``` |
| 66 | +<type>(<scope>): <short summary> |
| 67 | + │ │ │ |
| 68 | + │ │ └─⫸ Summary in present tense. Not capitalized. No period at the end. |
| 69 | + │ │ |
| 70 | + │ └─⫸ Optional Commit Scope: single word describing the component |
| 71 | + │ |
| 72 | + └─⫸ Commit Type: e.g., build|ci|docs|feat|fix|perf|refactor|revert|style|test |
| 73 | +``` |
| 74 | + |
| 75 | +The `<type>` and `<summary>` fields are mandatory. The `<scope>` field is optional. |
| 76 | + |
| 77 | +==== Body |
| 78 | + |
| 79 | +Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes". |
| 80 | + |
| 81 | +Explain the motivation for the change in the commit message body. This commit message should explain |
| 82 | +_why_ you are making the change. |
| 83 | +You can include a comparison of the previous behavior with the new behavior in order to illustrate |
| 84 | +the impact of the change. |
| 85 | + |
| 86 | +==== Footer |
| 87 | + |
| 88 | +A footer is required when the commit introduces a breaking change, closes a GitHub issue, |
| 89 | +or has relevant git trailers. |
| 90 | + |
| 91 | +===== Breaking change |
| 92 | + |
| 93 | +When a commit introduces a breaking change to _any_ component, the commit message *must* include |
| 94 | +a breaking change note in the footer: |
| 95 | + |
| 96 | +``` |
| 97 | +BREAKING CHANGE: <breaking change summary> |
| 98 | +<BLANK LINE> |
| 99 | +<breaking change description + migration instructions> |
| 100 | +``` |
| 101 | + |
| 102 | +==== Linked Issues and PRs |
| 103 | + |
| 104 | +When a commit will close a GitHub Issue, it should be noted in the footer: |
| 105 | + |
| 106 | +``` |
| 107 | +Fixes #<issue number> |
| 108 | +Closes #<issue numer> |
| 109 | +``` |
| 110 | + |
| 111 | +==== Git trailers |
| 112 | + |
| 113 | +When any of the extra information is relevant to a commit, it should be marked with a git trailer. |
| 114 | +Standard trailers for UnifiedDB include: |
| 115 | + |
| 116 | +[cols="1,2,3"] |
| 117 | +|=== |
| 118 | +| Key | Value format | Description |
| 119 | +| Co-authored-by | Firstname Lastname <email> | A person, other than the committer, that authored part of the patch |
| 120 | +|=== |
| 121 | + |
| 122 | +==== Examples |
| 123 | + |
| 124 | +The following are examples of good commit messages: |
| 125 | + |
| 126 | +``` |
| 127 | +data(ext): add Smclic extension |
| 128 | + |
| 129 | +Add metadata and IDL for Smclic (Core Local Interrupt Controller) v1.0. |
| 130 | + |
| 131 | +Closes #816 |
| 132 | +``` |
| 133 | + |
| 134 | +``` |
| 135 | +correct(ext): sctrclr belongs to Smctr/Sscntr extensions |
| 136 | + |
| 137 | +The sctrclr instruction was improperly `definedBy` Smdbltrp |
| 138 | + |
| 139 | +Closes #490 |
| 140 | +``` |
| 141 | + |
| 142 | +``` |
| 143 | +feat(ruby-db): add Sorbet type checking |
| 144 | + |
| 145 | +Add Sorbet type signatures to ruby-db code, and run Sorbet type check in CI. |
| 146 | + |
| 147 | +Closes #934 |
| 148 | +Co-authored-by: Frank the Tank <frank@oldschool.movie> |
| 149 | +``` |
| 150 | + |
| 151 | +=== Code review |
| 152 | + |
| 153 | +All Pull Requests must go through the code review process. |
| 154 | + |
| 155 | +All Pull Requests require approval by at least one Code Owner. |
| 156 | + |
| 157 | +Code Owners are maintained in `.github/CODEOWNERS`. |
| 158 | + |
| 159 | +== Finding tasks |
| 160 | + |
| 161 | +If you are looking to contribute but are unsure what to do, browse through the https://github.com/riscv-software-src/riscv-unified-db/issues[issues]. We try to keep them tagged by area and mark easier tasks with "good first issue". |
| 162 | + |
| 163 | +== Legal |
| 164 | + |
| 165 | +All contributions to UnifiedDB are by default made under the xref:LICENSE[BSD-3-clear license]. |
| 166 | +Copyrights are held by the specific contributors, and are not tracked by the UnifiedDB project other |
| 167 | +than what can be gleaned through git history. |
| 168 | + |
| 169 | +Under special circumstances code may be added under a different license. |
| 170 | +For example, code from an existing project may be integrated after careful deliberation. |
| 171 | +Any contributions under a different license will receive extra review. |
| 172 | +When any contribution is made under a different license, it must be tracked using |
| 173 | +https://reuse.software/tutorial/#step-2[a Reuse-compatible identifer]. |
| 174 | + |
| 175 | +To keep UnifiedDB open to both private and commercial interests, contributions under a |
| 176 | +https://en.wikipedia.org/wiki/copyleft[copyleft license] will never be accepted. |
| 177 | + |
| 178 | +== Maintainers |
| 179 | + |
| 180 | +The current maintainers for UnifiedDB are: |
| 181 | + |
| 182 | +* Derek Hower (@dhower-qc) |
| 183 | +* Paul Clarke (@ThinkOpenly) |
0 commit comments