atagen

matrix-rust-sdk

public
Star0
Watch0
ssh://brewery@pls.lobotomise.me:33/atagen/matrix-rust-sdk.git

Blame: CONTRIBUTING.md

7ff8adafe9e4atagen2026-10-22 12:30 UTC1
# Contributing to `matrix-rust-sdk`
7ff8adafe9e4atagen2026-10-22 12:30 UTC2
7ff8adafe9e4atagen2026-10-22 12:30 UTC3
## Chat rooms
7ff8adafe9e4atagen2026-10-22 12:30 UTC4
7ff8adafe9e4atagen2026-10-22 12:30 UTC5
In addition to our [main Matrix room], we have a development room at
7ff8adafe9e4atagen2026-10-22 12:30 UTC6
[#matrix-rust-sdk-dev:flipdot.org]. Please use it to discuss potential changes,
7ff8adafe9e4atagen2026-10-22 12:30 UTC7
the overall direction of development and related topics.
7ff8adafe9e4atagen2026-10-22 12:30 UTC8
7ff8adafe9e4atagen2026-10-22 12:30 UTC9
[main Matrix room]: https://matrix.to/#/#matrix-rust-sdk:matrix.org
7ff8adafe9e4atagen2026-10-22 12:30 UTC10
[#matrix-rust-sdk-dev:flipdot.org]: https://matrix.to/#/#matrix-rust-sdk-dev:flipdot.org
7ff8adafe9e4atagen2026-10-22 12:30 UTC11
7ff8adafe9e4atagen2026-10-22 12:30 UTC12
## Testing
7ff8adafe9e4atagen2026-10-22 12:30 UTC13
7ff8adafe9e4atagen2026-10-22 12:30 UTC14
You can run most of the tests that also happen in CI also using
7ff8adafe9e4atagen2026-10-22 12:30 UTC15
`cargo xtask ci`. This needs a few dependencies to be installed, as it also runs
7ff8adafe9e4atagen2026-10-22 12:30 UTC16
automatic WASM tests:
7ff8adafe9e4atagen2026-10-22 12:30 UTC17
7ff8adafe9e4atagen2026-10-22 12:30 UTC18
```bash
7ff8adafe9e4atagen2026-10-22 12:30 UTC19
rustup component add clippy
7ff8adafe9e4atagen2026-10-22 12:30 UTC20
cargo install cargo-nextest typos-cli wasm-pack
7ff8adafe9e4atagen2026-10-22 12:30 UTC21
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC22
7ff8adafe9e4atagen2026-10-22 12:30 UTC23
If you want to execute only one part of CI, there are a few sub-commands (see
7ff8adafe9e4atagen2026-10-22 12:30 UTC24
`cargo xtask ci --help`).
7ff8adafe9e4atagen2026-10-22 12:30 UTC25
7ff8adafe9e4atagen2026-10-22 12:30 UTC26
Some tests are not automatically run in `cargo xtask ci`, for example the
7ff8adafe9e4atagen2026-10-22 12:30 UTC27
integration tests that need a running synapse instance. These tests reside in
7ff8adafe9e4atagen2026-10-22 12:30 UTC28
`./testing/matrix-sdk-integration-testing`. See its
7ff8adafe9e4atagen2026-10-22 12:30 UTC29
[README](./testing/matrix-sdk-integration-testing/README.md) to easily set up a
7ff8adafe9e4atagen2026-10-22 12:30 UTC30
synapse for testing purposes.
7ff8adafe9e4atagen2026-10-22 12:30 UTC31
7ff8adafe9e4atagen2026-10-22 12:30 UTC32
### Snapshot testing
7ff8adafe9e4atagen2026-10-22 12:30 UTC33
7ff8adafe9e4atagen2026-10-22 12:30 UTC34
You can add/review snapshot tests using [insta.rs](https://insta.rs)
7ff8adafe9e4atagen2026-10-22 12:30 UTC35
7ff8adafe9e4atagen2026-10-22 12:30 UTC36
Every new struct/enum that derives `Serialize` `Deserialise` should have a
7ff8adafe9e4atagen2026-10-22 12:30 UTC37
snapshot test for it. Any code change that breaks serialisation will then break
7ff8adafe9e4atagen2026-10-22 12:30 UTC38
a test, the author will then have to decide how to handle migration and test it
7ff8adafe9e4atagen2026-10-22 12:30 UTC39
if needed.
7ff8adafe9e4atagen2026-10-22 12:30 UTC40
7ff8adafe9e4atagen2026-10-22 12:30 UTC41
And for an improved review experience it's recommended (but not necessary) to
7ff8adafe9e4atagen2026-10-22 12:30 UTC42
install the `cargo-insta` tool:
7ff8adafe9e4atagen2026-10-22 12:30 UTC43
7ff8adafe9e4atagen2026-10-22 12:30 UTC44
Unix:
7ff8adafe9e4atagen2026-10-22 12:30 UTC45
7ff8adafe9e4atagen2026-10-22 12:30 UTC46
```shell
7ff8adafe9e4atagen2026-10-22 12:30 UTC47
curl -LsSf https://insta.rs/install.sh | sh
7ff8adafe9e4atagen2026-10-22 12:30 UTC48
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC49
7ff8adafe9e4atagen2026-10-22 12:30 UTC50
Windows:
7ff8adafe9e4atagen2026-10-22 12:30 UTC51
7ff8adafe9e4atagen2026-10-22 12:30 UTC52
```shell
7ff8adafe9e4atagen2026-10-22 12:30 UTC53
powershell -c "irm https://insta.rs/install.ps1 | iex"
7ff8adafe9e4atagen2026-10-22 12:30 UTC54
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC55
7ff8adafe9e4atagen2026-10-22 12:30 UTC56
Usual flow is to first run the test, then review them.
7ff8adafe9e4atagen2026-10-22 12:30 UTC57
7ff8adafe9e4atagen2026-10-22 12:30 UTC58
```shell
7ff8adafe9e4atagen2026-10-22 12:30 UTC59
cargo insta test
7ff8adafe9e4atagen2026-10-22 12:30 UTC60
cargo insta review
7ff8adafe9e4atagen2026-10-22 12:30 UTC61
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC62
7ff8adafe9e4atagen2026-10-22 12:30 UTC63
### Intermittent failure policy
7ff8adafe9e4atagen2026-10-22 12:30 UTC64
7ff8adafe9e4atagen2026-10-22 12:30 UTC65
While we strive to add test coverage for as many features as we can, it
7ff8adafe9e4atagen2026-10-22 12:30 UTC66
sometimes happens that the tests will be intermittently failing in CI (such
7ff8adafe9e4atagen2026-10-22 12:30 UTC67
tests are sometimes called "flaky"). This can be caused by race conditions
7ff8adafe9e4atagen2026-10-22 12:30 UTC68
of all sorts, either in the test code itself, but sometimes in the underlying
7ff8adafe9e4atagen2026-10-22 12:30 UTC69
feature being tested too, and as such, it requires some investigation, usually
7ff8adafe9e4atagen2026-10-22 12:30 UTC70
from the original author of the test.
7ff8adafe9e4atagen2026-10-22 12:30 UTC71
7ff8adafe9e4atagen2026-10-22 12:30 UTC72
Whenever such an intermittent failure happens, we try to open an issue to track
7ff8adafe9e4atagen2026-10-22 12:30 UTC73
the failures, adding the
7ff8adafe9e4atagen2026-10-22 12:30 UTC74
[`intermittent-failure`](https://github.com/matrix-org/matrix-rust-sdk/issues?q=is%3Aissue%20state%3Aopen%20label%3Aintermittent-failure)
7ff8adafe9e4atagen2026-10-22 12:30 UTC75
label to it, and commenting with links to CI runs where the failure happened.
7ff8adafe9e4atagen2026-10-22 12:30 UTC76
7ff8adafe9e4atagen2026-10-22 12:30 UTC77
If a test has been intermittently failing for **two weeks** or more, and no one
7ff8adafe9e4atagen2026-10-22 12:30 UTC78
is actively working on fixing it, then we might decide to mark the test as
7ff8adafe9e4atagen2026-10-22 12:30 UTC79
`ignored` until it is fixed, to not cause unrelated failures in other
7ff8adafe9e4atagen2026-10-22 12:30 UTC80
contributors' pull requests and pushes.
7ff8adafe9e4atagen2026-10-22 12:30 UTC81
7ff8adafe9e4atagen2026-10-22 12:30 UTC82
## Pull requests
7ff8adafe9e4atagen2026-10-22 12:30 UTC83
7ff8adafe9e4atagen2026-10-22 12:30 UTC84
Ideally, a PR should have a _proper title_, with _atomic logical commits_, and
7ff8adafe9e4atagen2026-10-22 12:30 UTC85
each commit should have a _good commit message_.
7ff8adafe9e4atagen2026-10-22 12:30 UTC86
7ff8adafe9e4atagen2026-10-22 12:30 UTC87
A _proper PR title_ would be a one-liner summary of the changes in the PR,
7ff8adafe9e4atagen2026-10-22 12:30 UTC88
following the same guidelines of a good commit message, including the
7ff8adafe9e4atagen2026-10-22 12:30 UTC89
area/feature prefix. Something like `FFI: Allow logs files to be pruned.` would
7ff8adafe9e4atagen2026-10-22 12:30 UTC90
be a good PR title.
7ff8adafe9e4atagen2026-10-22 12:30 UTC91
7ff8adafe9e4atagen2026-10-22 12:30 UTC92
(An additional bad example of a bad PR title would be `mynickname/branch name`,
7ff8adafe9e4atagen2026-10-22 12:30 UTC93
that is, just the branch name.)
7ff8adafe9e4atagen2026-10-22 12:30 UTC94
7ff8adafe9e4atagen2026-10-22 12:30 UTC95
## Writing changelog entries
7ff8adafe9e4atagen2026-10-22 12:30 UTC96
7ff8adafe9e4atagen2026-10-22 12:30 UTC97
We use towncrier to generate changelogs from individual fragment files. Each
7ff8adafe9e4atagen2026-10-22 12:30 UTC98
change must be documented as a changelog fragment in the appropriate crate:
7ff8adafe9e4atagen2026-10-22 12:30 UTC99
7ff8adafe9e4atagen2026-10-22 12:30 UTC100
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC101
/crates/<crate-name>/changelog.d/
7ff8adafe9e4atagen2026-10-22 12:30 UTC102
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC103
7ff8adafe9e4atagen2026-10-22 12:30 UTC104
Each changelog fragment must include **both the pull request number and the
7ff8adafe9e4atagen2026-10-22 12:30 UTC105
fragment type** in its filename:
7ff8adafe9e4atagen2026-10-22 12:30 UTC106
7ff8adafe9e4atagen2026-10-22 12:30 UTC107
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC108
<PR number>.<fragment type>.md
7ff8adafe9e4atagen2026-10-22 12:30 UTC109
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC110
7ff8adafe9e4atagen2026-10-22 12:30 UTC111
For example:
7ff8adafe9e4atagen2026-10-22 12:30 UTC112
7ff8adafe9e4atagen2026-10-22 12:30 UTC113
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC114
4357.added.md
7ff8adafe9e4atagen2026-10-22 12:30 UTC115
4357.fixed.md
7ff8adafe9e4atagen2026-10-22 12:30 UTC116
4357.changed.md
7ff8adafe9e4atagen2026-10-22 12:30 UTC117
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC118
7ff8adafe9e4atagen2026-10-22 12:30 UTC119
The pull request link is automatically added during changelog generation, so it
7ff8adafe9e4atagen2026-10-22 12:30 UTC120
must not be included manually.
7ff8adafe9e4atagen2026-10-22 12:30 UTC121
7ff8adafe9e4atagen2026-10-22 12:30 UTC122
We use standard towncrier fragment types to categorize changes. Common types
7ff8adafe9e4atagen2026-10-22 12:30 UTC123
include:
7ff8adafe9e4atagen2026-10-22 12:30 UTC124
7ff8adafe9e4atagen2026-10-22 12:30 UTC125
- `added` – new features or functionality
7ff8adafe9e4atagen2026-10-22 12:30 UTC126
- `changed` – changes in existing behavior
7ff8adafe9e4atagen2026-10-22 12:30 UTC127
- `fixed` – bug fixes
7ff8adafe9e4atagen2026-10-22 12:30 UTC128
- `removed` – removed features or APIs
7ff8adafe9e4atagen2026-10-22 12:30 UTC129
- `security` – security-related fixes
7ff8adafe9e4atagen2026-10-22 12:30 UTC130
- `internal` – changes that do not affect users (refactoring, CI, tooling)
7ff8adafe9e4atagen2026-10-22 12:30 UTC131
7ff8adafe9e4atagen2026-10-22 12:30 UTC132
Choose the type that best matches the nature of the change.
7ff8adafe9e4atagen2026-10-22 12:30 UTC133
7ff8adafe9e4atagen2026-10-22 12:30 UTC134
A well-written changelog entry should be understandable even to those who may
7ff8adafe9e4atagen2026-10-22 12:30 UTC135
not be deeply familiar with the project. Provide enough context to ensure
7ff8adafe9e4atagen2026-10-22 12:30 UTC136
clarity and ease of understanding.
7ff8adafe9e4atagen2026-10-22 12:30 UTC137
7ff8adafe9e4atagen2026-10-22 12:30 UTC138
A couple of examples of bad changelog entry would look like:
7ff8adafe9e4atagen2026-10-22 12:30 UTC139
7ff8adafe9e4atagen2026-10-22 12:30 UTC140
```markdown
7ff8adafe9e4atagen2026-10-22 12:30 UTC141
- Fixed a panic.
7ff8adafe9e4atagen2026-10-22 12:30 UTC142
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC143
7ff8adafe9e4atagen2026-10-22 12:30 UTC144
```markdown
7ff8adafe9e4atagen2026-10-22 12:30 UTC145
Added the Bar function to Foo.
7ff8adafe9e4atagen2026-10-22 12:30 UTC146
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC147
7ff8adafe9e4atagen2026-10-22 12:30 UTC148
A good example of a changelog entry could look like the following:
7ff8adafe9e4atagen2026-10-22 12:30 UTC149
7ff8adafe9e4atagen2026-10-22 12:30 UTC150
```markdown
7ff8adafe9e4atagen2026-10-22 12:30 UTC151
Use the inviter's server name and the server name from the room alias as
7ff8adafe9e4atagen2026-10-22 12:30 UTC152
fallback values for the via parameter when requesting the room summary from the
7ff8adafe9e4atagen2026-10-22 12:30 UTC153
homeserver. This ensures requests succeed even when the room being previewed is
7ff8adafe9e4atagen2026-10-22 12:30 UTC154
hosted on a federated server.
7ff8adafe9e4atagen2026-10-22 12:30 UTC155
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC156
7ff8adafe9e4atagen2026-10-22 12:30 UTC157
For security-related changelog entries, please include the following additional
7ff8adafe9e4atagen2026-10-22 12:30 UTC158
details alongside the pull request number:
7ff8adafe9e4atagen2026-10-22 12:30 UTC159
7ff8adafe9e4atagen2026-10-22 12:30 UTC160
- Impact: Clearly describe the issue's potential impact on users or systems.
7ff8adafe9e4atagen2026-10-22 12:30 UTC161
- CVE Number: If available, include the CVE (Common Vulnerabilities and
7ff8adafe9e4atagen2026-10-22 12:30 UTC162
  Exposures) identifier.
7ff8adafe9e4atagen2026-10-22 12:30 UTC163
- GitHub Advisory Link: Provide a link to the corresponding GitHub security
7ff8adafe9e4atagen2026-10-22 12:30 UTC164
  advisory for further context.
7ff8adafe9e4atagen2026-10-22 12:30 UTC165
7ff8adafe9e4atagen2026-10-22 12:30 UTC166
```markdown
7ff8adafe9e4atagen2026-10-22 12:30 UTC167
Use a constant-time Base64 encoder for secret key material to mitigate
7ff8adafe9e4atagen2026-10-22 12:30 UTC168
side-channel attacks leaking secret key material
7ff8adafe9e4atagen2026-10-22 12:30 UTC169
[CVE-2024-40640](https://www.cve.org/CVERecord?id=CVE-2024-40640),
7ff8adafe9e4atagen2026-10-22 12:30 UTC170
[GHSA-j8cm-g7r6-hfpq](https://github.com/matrix-org/vodozemac/security/advisories/GHSA-j8cm-g7r6-hfpq)).
7ff8adafe9e4atagen2026-10-22 12:30 UTC171
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC172
7ff8adafe9e4atagen2026-10-22 12:30 UTC173
## Commit message format
7ff8adafe9e4atagen2026-10-22 12:30 UTC174
7ff8adafe9e4atagen2026-10-22 12:30 UTC175
Commit messages should be formatted as Conventional Commits. In addition, some
7ff8adafe9e4atagen2026-10-22 12:30 UTC176
git trailers are supported and have special meaning (see below).
7ff8adafe9e4atagen2026-10-22 12:30 UTC177
7ff8adafe9e4atagen2026-10-22 12:30 UTC178
### Conventional commits
7ff8adafe9e4atagen2026-10-22 12:30 UTC179
7ff8adafe9e4atagen2026-10-22 12:30 UTC180
Conventional Commits are structured as follows:
7ff8adafe9e4atagen2026-10-22 12:30 UTC181
7ff8adafe9e4atagen2026-10-22 12:30 UTC182
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC183
<type>(<scope>): <short summary>
7ff8adafe9e4atagen2026-10-22 12:30 UTC184
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC185
7ff8adafe9e4atagen2026-10-22 12:30 UTC186
The type of changes which will be included in changelogs is one of the
7ff8adafe9e4atagen2026-10-22 12:30 UTC187
following:
7ff8adafe9e4atagen2026-10-22 12:30 UTC188
7ff8adafe9e4atagen2026-10-22 12:30 UTC189
- `feat`: A new feature
7ff8adafe9e4atagen2026-10-22 12:30 UTC190
- `fix`: A bugfix
7ff8adafe9e4atagen2026-10-22 12:30 UTC191
- `doc`: Documentation changes
7ff8adafe9e4atagen2026-10-22 12:30 UTC192
- `refactor`: Code refactoring
7ff8adafe9e4atagen2026-10-22 12:30 UTC193
- `perf`: Performance improvements
7ff8adafe9e4atagen2026-10-22 12:30 UTC194
- `ci`: Changes to CI configuration files and scripts
7ff8adafe9e4atagen2026-10-22 12:30 UTC195
7ff8adafe9e4atagen2026-10-22 12:30 UTC196
The scope is optional and can specify the area of the codebase affected (e.g.,
7ff8adafe9e4atagen2026-10-22 12:30 UTC197
olm, cipher).
7ff8adafe9e4atagen2026-10-22 12:30 UTC198
7ff8adafe9e4atagen2026-10-22 12:30 UTC199
### Security fixes
7ff8adafe9e4atagen2026-10-22 12:30 UTC200
7ff8adafe9e4atagen2026-10-22 12:30 UTC201
Commits addressing security vulnerabilities must include specific trailers for
7ff8adafe9e4atagen2026-10-22 12:30 UTC202
vulnerability metadata, which should also be reflected in the corresponding
7ff8adafe9e4atagen2026-10-22 12:30 UTC203
changelog entry.
7ff8adafe9e4atagen2026-10-22 12:30 UTC204
7ff8adafe9e4atagen2026-10-22 12:30 UTC205
The metadata must be included in the following git-trailers:
7ff8adafe9e4atagen2026-10-22 12:30 UTC206
7ff8adafe9e4atagen2026-10-22 12:30 UTC207
- `Security-Impact`: The magnitude of harm that can be expected, i.e.
7ff8adafe9e4atagen2026-10-22 12:30 UTC208
  low/moderate/high/critical.
7ff8adafe9e4atagen2026-10-22 12:30 UTC209
- `CVE`: The CVE that was assigned to this issue.
7ff8adafe9e4atagen2026-10-22 12:30 UTC210
- `GitHub-Advisory`: The GitHub advisory identifier.
7ff8adafe9e4atagen2026-10-22 12:30 UTC211
7ff8adafe9e4atagen2026-10-22 12:30 UTC212
Please include all the fields that are available.
7ff8adafe9e4atagen2026-10-22 12:30 UTC213
7ff8adafe9e4atagen2026-10-22 12:30 UTC214
Example:
7ff8adafe9e4atagen2026-10-22 12:30 UTC215
7ff8adafe9e4atagen2026-10-22 12:30 UTC216
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC217
fix(crypto): Use a constant-time Base64 encoder for secret key material
7ff8adafe9e4atagen2026-10-22 12:30 UTC218
7ff8adafe9e4atagen2026-10-22 12:30 UTC219
This patch fixes a security issue around a side-channel vulnerability[1]
7ff8adafe9e4atagen2026-10-22 12:30 UTC220
when decoding secret key material using Base64.
7ff8adafe9e4atagen2026-10-22 12:30 UTC221
7ff8adafe9e4atagen2026-10-22 12:30 UTC222
In some circumstances an attacker can obtain information about secret
7ff8adafe9e4atagen2026-10-22 12:30 UTC223
secret key material via a controlled-channel and side-channel attack.
7ff8adafe9e4atagen2026-10-22 12:30 UTC224
7ff8adafe9e4atagen2026-10-22 12:30 UTC225
This patch avoids the side-channel by switching to the base64ct crate
7ff8adafe9e4atagen2026-10-22 12:30 UTC226
for the encoding, and more importantly, the decoding of secret key
7ff8adafe9e4atagen2026-10-22 12:30 UTC227
material.
7ff8adafe9e4atagen2026-10-22 12:30 UTC228
7ff8adafe9e4atagen2026-10-22 12:30 UTC229
Security-Impact: Low
7ff8adafe9e4atagen2026-10-22 12:30 UTC230
CVE: CVE-2024-40640
7ff8adafe9e4atagen2026-10-22 12:30 UTC231
GitHub-Advisory: GHSA-j8cm-g7r6-hfpq
7ff8adafe9e4atagen2026-10-22 12:30 UTC232
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC233
7ff8adafe9e4atagen2026-10-22 12:30 UTC234
## Review process
7ff8adafe9e4atagen2026-10-22 12:30 UTC235
7ff8adafe9e4atagen2026-10-22 12:30 UTC236
To streamline the review process and make it easier for maintainers to review
7ff8adafe9e4atagen2026-10-22 12:30 UTC237
your contributions, follow these basic rules:
7ff8adafe9e4atagen2026-10-22 12:30 UTC238
7ff8adafe9e4atagen2026-10-22 12:30 UTC239
1. Do not force push after a review has started. This helps maintainers track
7ff8adafe9e4atagen2026-10-22 12:30 UTC240
   incremental changes without confusion and makes it easier to follow the
7ff8adafe9e4atagen2026-10-22 12:30 UTC241
   evolution of the code.
7ff8adafe9e4atagen2026-10-22 12:30 UTC242
7ff8adafe9e4atagen2026-10-22 12:30 UTC243
2. Do not mix moves and refactoring with functional changes. Keep these in
7ff8adafe9e4atagen2026-10-22 12:30 UTC244
   separate commits for clarity. This ensures that the purpose of each commit is
7ff8adafe9e4atagen2026-10-22 12:30 UTC245
   clear and easy to review.
7ff8adafe9e4atagen2026-10-22 12:30 UTC246
7ff8adafe9e4atagen2026-10-22 12:30 UTC247
3. Each commit must compile. If commits don’t compile, git bisect becomes
7ff8adafe9e4atagen2026-10-22 12:30 UTC248
   unusable, which hampers the debugging process and makes it harder to identify
7ff8adafe9e4atagen2026-10-22 12:30 UTC249
   the source of issues.
7ff8adafe9e4atagen2026-10-22 12:30 UTC250
7ff8adafe9e4atagen2026-10-22 12:30 UTC251
4. Commits should only introduce test failures if they are proving that a bug
7ff8adafe9e4atagen2026-10-22 12:30 UTC252
   exists. New features should never introduce test failures. Test failures
7ff8adafe9e4atagen2026-10-22 12:30 UTC253
   should only be used to demonstrate existing bugs, not as part of adding new
7ff8adafe9e4atagen2026-10-22 12:30 UTC254
   functionality.
7ff8adafe9e4atagen2026-10-22 12:30 UTC255
7ff8adafe9e4atagen2026-10-22 12:30 UTC256
5. Keep PRs on topic and small. Large PRs are harder to review and more prone to
7ff8adafe9e4atagen2026-10-22 12:30 UTC257
   delays. Create small, focused commits that address a single topic. Use a
7ff8adafe9e4atagen2026-10-22 12:30 UTC258
   combination of [git add] -p or [git checkout] -p to split changes into
7ff8adafe9e4atagen2026-10-22 12:30 UTC259
   logical units. This makes your work easier to review and reduces the chance
7ff8adafe9e4atagen2026-10-22 12:30 UTC260
   of introducing unrelated changes.
7ff8adafe9e4atagen2026-10-22 12:30 UTC261
7ff8adafe9e4atagen2026-10-22 12:30 UTC262
[git add]: https://git-scm.com/docs/git-add#Documentation/git-add.txt---patch
7ff8adafe9e4atagen2026-10-22 12:30 UTC263
[git checkout]: https://git-scm.com/docs/git-checkout#Documentation/git-checkout.txt---patch
7ff8adafe9e4atagen2026-10-22 12:30 UTC264
7ff8adafe9e4atagen2026-10-22 12:30 UTC265
### Addressing review comments using fixup commits
7ff8adafe9e4atagen2026-10-22 12:30 UTC266
7ff8adafe9e4atagen2026-10-22 12:30 UTC267
So you posted a PR and the maintainers aren't quite happy with it. Here are some
7ff8adafe9e4atagen2026-10-22 12:30 UTC268
guidelines to make the maintainers life easier and increase the chances that
7ff8adafe9e4atagen2026-10-22 12:30 UTC269
your PR will be reviewed swiftly.
7ff8adafe9e4atagen2026-10-22 12:30 UTC270
7ff8adafe9e4atagen2026-10-22 12:30 UTC271
1. Use [fixup] commits. When addressing reviewer feedback, you can create fixup
7ff8adafe9e4atagen2026-10-22 12:30 UTC272
   commits. These commits mark your changes as corrections of specific previous
7ff8adafe9e4atagen2026-10-22 12:30 UTC273
   commits in the PR.
7ff8adafe9e4atagen2026-10-22 12:30 UTC274
7ff8adafe9e4atagen2026-10-22 12:30 UTC275
Example:
7ff8adafe9e4atagen2026-10-22 12:30 UTC276
7ff8adafe9e4atagen2026-10-22 12:30 UTC277
```shell
7ff8adafe9e4atagen2026-10-22 12:30 UTC278
git commit --fixup=<commit-hash>
7ff8adafe9e4atagen2026-10-22 12:30 UTC279
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC280
7ff8adafe9e4atagen2026-10-22 12:30 UTC281
This command creates a new commit that refers to an existing one, making it
7ff8adafe9e4atagen2026-10-22 12:30 UTC282
easier to rebase and squash later while showing reviewers the history of fixes.
7ff8adafe9e4atagen2026-10-22 12:30 UTC283
For extra points, link to the fixup commit in the thread where the change was
7ff8adafe9e4atagen2026-10-22 12:30 UTC284
requested.
7ff8adafe9e4atagen2026-10-22 12:30 UTC285
7ff8adafe9e4atagen2026-10-22 12:30 UTC286
2. After all requested changes were addressed, feel free to re-request a review.
7ff8adafe9e4atagen2026-10-22 12:30 UTC287
   People might not notice that all changes were addressed.
7ff8adafe9e4atagen2026-10-22 12:30 UTC288
7ff8adafe9e4atagen2026-10-22 12:30 UTC289
3. Once the PR has been approved, rebase your PR to squash all the fixup
7ff8adafe9e4atagen2026-10-22 12:30 UTC290
   commits, the [autosquash] option can help with this.
7ff8adafe9e4atagen2026-10-22 12:30 UTC291
7ff8adafe9e4atagen2026-10-22 12:30 UTC292
```shell
7ff8adafe9e4atagen2026-10-22 12:30 UTC293
git rebase main --interactive --autosquash
7ff8adafe9e4atagen2026-10-22 12:30 UTC294
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC295
7ff8adafe9e4atagen2026-10-22 12:30 UTC296
[fixup]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---fixupamendrewordltcommitgt
7ff8adafe9e4atagen2026-10-22 12:30 UTC297
[autosquash]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash
7ff8adafe9e4atagen2026-10-22 12:30 UTC298
7ff8adafe9e4atagen2026-10-22 12:30 UTC299
## Sign off
7ff8adafe9e4atagen2026-10-22 12:30 UTC300
7ff8adafe9e4atagen2026-10-22 12:30 UTC301
In order to have a concrete record that your contribution is intentional
7ff8adafe9e4atagen2026-10-22 12:30 UTC302
and you agree to license it under the same terms as the project's
7ff8adafe9e4atagen2026-10-22 12:30 UTC303
license, we've adopted the same lightweight approach that the [Linux
7ff8adafe9e4atagen2026-10-22 12:30 UTC304
Kernel](https://www.kernel.org/doc/Documentation/SubmittingPatches),
7ff8adafe9e4atagen2026-10-22 12:30 UTC305
[Docker](https://github.com/docker/docker/blob/master/CONTRIBUTING.md),
7ff8adafe9e4atagen2026-10-22 12:30 UTC306
and many other projects use: the DCO ([Developer Certificate of
7ff8adafe9e4atagen2026-10-22 12:30 UTC307
Origin](http://developercertificate.org/)). This is a simple declaration that
7ff8adafe9e4atagen2026-10-22 12:30 UTC308
you wrote the contribution or otherwise have the right to contribute it to
7ff8adafe9e4atagen2026-10-22 12:30 UTC309
Matrix:
7ff8adafe9e4atagen2026-10-22 12:30 UTC310
7ff8adafe9e4atagen2026-10-22 12:30 UTC311
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC312
Developer Certificate of Origin
7ff8adafe9e4atagen2026-10-22 12:30 UTC313
Version 1.1
7ff8adafe9e4atagen2026-10-22 12:30 UTC314
7ff8adafe9e4atagen2026-10-22 12:30 UTC315
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
7ff8adafe9e4atagen2026-10-22 12:30 UTC316
660 York Street, Suite 102,
7ff8adafe9e4atagen2026-10-22 12:30 UTC317
San Francisco, CA 94110 USA
7ff8adafe9e4atagen2026-10-22 12:30 UTC318
7ff8adafe9e4atagen2026-10-22 12:30 UTC319
Everyone is permitted to copy and distribute verbatim copies of this
7ff8adafe9e4atagen2026-10-22 12:30 UTC320
license document, but changing it is not allowed.
7ff8adafe9e4atagen2026-10-22 12:30 UTC321
7ff8adafe9e4atagen2026-10-22 12:30 UTC322
Developer's Certificate of Origin 1.1
7ff8adafe9e4atagen2026-10-22 12:30 UTC323
7ff8adafe9e4atagen2026-10-22 12:30 UTC324
By making a contribution to this project, I certify that:
7ff8adafe9e4atagen2026-10-22 12:30 UTC325
7ff8adafe9e4atagen2026-10-22 12:30 UTC326
(a) The contribution was created in whole or in part by me and I
7ff8adafe9e4atagen2026-10-22 12:30 UTC327
    have the right to submit it under the open source license
7ff8adafe9e4atagen2026-10-22 12:30 UTC328
    indicated in the file; or
7ff8adafe9e4atagen2026-10-22 12:30 UTC329
7ff8adafe9e4atagen2026-10-22 12:30 UTC330
(b) The contribution is based upon previous work that, to the best
7ff8adafe9e4atagen2026-10-22 12:30 UTC331
    of my knowledge, is covered under an appropriate open source
7ff8adafe9e4atagen2026-10-22 12:30 UTC332
    license and I have the right under that license to submit that
7ff8adafe9e4atagen2026-10-22 12:30 UTC333
    work with modifications, whether created in whole or in part
7ff8adafe9e4atagen2026-10-22 12:30 UTC334
    by me, under the same open source license (unless I am
7ff8adafe9e4atagen2026-10-22 12:30 UTC335
    permitted to submit under a different license), as indicated
7ff8adafe9e4atagen2026-10-22 12:30 UTC336
    in the file; or
7ff8adafe9e4atagen2026-10-22 12:30 UTC337
7ff8adafe9e4atagen2026-10-22 12:30 UTC338
(c) The contribution was provided directly to me by some other
7ff8adafe9e4atagen2026-10-22 12:30 UTC339
    person who certified (a), (b) or (c) and I have not modified
7ff8adafe9e4atagen2026-10-22 12:30 UTC340
    it.
7ff8adafe9e4atagen2026-10-22 12:30 UTC341
7ff8adafe9e4atagen2026-10-22 12:30 UTC342
(d) I understand and agree that this project and the contribution
7ff8adafe9e4atagen2026-10-22 12:30 UTC343
    are public and that a record of the contribution (including all
7ff8adafe9e4atagen2026-10-22 12:30 UTC344
    personal information I submit with it, including my sign-off) is
7ff8adafe9e4atagen2026-10-22 12:30 UTC345
    maintained indefinitely and may be redistributed consistent with
7ff8adafe9e4atagen2026-10-22 12:30 UTC346
    this project or the open source license(s) involved.
7ff8adafe9e4atagen2026-10-22 12:30 UTC347
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC348
7ff8adafe9e4atagen2026-10-22 12:30 UTC349
If you agree to this for your contribution, then all that's needed is to
7ff8adafe9e4atagen2026-10-22 12:30 UTC350
include the line in your commit or pull request comment:
7ff8adafe9e4atagen2026-10-22 12:30 UTC351
7ff8adafe9e4atagen2026-10-22 12:30 UTC352
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC353
Signed-off-by: Your Name <your@email.example.org>
7ff8adafe9e4atagen2026-10-22 12:30 UTC354
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC355
7ff8adafe9e4atagen2026-10-22 12:30 UTC356
Git allows you to add this signoff automatically when using the `-s` flag to
7ff8adafe9e4atagen2026-10-22 12:30 UTC357
`git commit`, which uses the name and email set in your `user.name` and
7ff8adafe9e4atagen2026-10-22 12:30 UTC358
`user.email` git configs.
7ff8adafe9e4atagen2026-10-22 12:30 UTC359
7ff8adafe9e4atagen2026-10-22 12:30 UTC360
If you forgot to sign off your commits before making your pull request and are
7ff8adafe9e4atagen2026-10-22 12:30 UTC361
on Git 2.17+ you can mass signoff using rebase:
7ff8adafe9e4atagen2026-10-22 12:30 UTC362
7ff8adafe9e4atagen2026-10-22 12:30 UTC363
```text
7ff8adafe9e4atagen2026-10-22 12:30 UTC364
git rebase --signoff origin/main
7ff8adafe9e4atagen2026-10-22 12:30 UTC365
```
7ff8adafe9e4atagen2026-10-22 12:30 UTC366
7ff8adafe9e4atagen2026-10-22 12:30 UTC367
## AI policy
7ff8adafe9e4atagen2026-10-22 12:30 UTC368
7ff8adafe9e4atagen2026-10-22 12:30 UTC369
This policy is a copy of the [Forgejo's AI agreement][Forgejo].
7ff8adafe9e4atagen2026-10-22 12:30 UTC370
7ff8adafe9e4atagen2026-10-22 12:30 UTC371
### Terminology
7ff8adafe9e4atagen2026-10-22 12:30 UTC372
7ff8adafe9e4atagen2026-10-22 12:30 UTC373
This does not necessarily reflect the official or commonly used terminology.
7ff8adafe9e4atagen2026-10-22 12:30 UTC374
7ff8adafe9e4atagen2026-10-22 12:30 UTC375
Software and services that heavily rely on large language model technology to
7ff8adafe9e4atagen2026-10-22 12:30 UTC376
generate their outcomes are referred to as _Artificial Intelligence_ (AI).
7ff8adafe9e4atagen2026-10-22 12:30 UTC377
Examples of products that fit this definition: GitHub Copilot, ChatGPT, Claude
7ff8adafe9e4atagen2026-10-22 12:30 UTC378
Sonnet, DeepSeek, Llama and Gemini.
7ff8adafe9e4atagen2026-10-22 12:30 UTC379
7ff8adafe9e4atagen2026-10-22 12:30 UTC380
There is a distinction between _general_ and _narrow_ AI, all the aforementioned
7ff8adafe9e4atagen2026-10-22 12:30 UTC381
examples fall under general AI as they were not trained to execute a specific
7ff8adafe9e4atagen2026-10-22 12:30 UTC382
well-defined task. Narrow AI is trained to be used for specific well-defined
7ff8adafe9e4atagen2026-10-22 12:30 UTC383
tasks where the problem space is known in advance.
7ff8adafe9e4atagen2026-10-22 12:30 UTC384
7ff8adafe9e4atagen2026-10-22 12:30 UTC385
_Vibe coding_ is the practice where AI creates a code change (feature, bugfix,
7ff8adafe9e4atagen2026-10-22 12:30 UTC386
tests, refactor) with a human that describes what needs to be implemented.
7ff8adafe9e4atagen2026-10-22 12:30 UTC387
7ff8adafe9e4atagen2026-10-22 12:30 UTC388
_AI agents_ are AIs that are configured to perform interactions or make changes
7ff8adafe9e4atagen2026-10-22 12:30 UTC389
with little to no human supervision.
7ff8adafe9e4atagen2026-10-22 12:30 UTC390
7ff8adafe9e4atagen2026-10-22 12:30 UTC391
### Agreement
7ff8adafe9e4atagen2026-10-22 12:30 UTC392
7ff8adafe9e4atagen2026-10-22 12:30 UTC393
1. If content was made with the help of AI, you **must** convey that this is
7ff8adafe9e4atagen2026-10-22 12:30 UTC394
   the case. This includes content that you authored but was motivated by a
7ff8adafe9e4atagen2026-10-22 12:30 UTC395
   suggestion of AI.
7ff8adafe9e4atagen2026-10-22 12:30 UTC396
2. If at any point you used AI's work in your contribution you should make
7ff8adafe9e4atagen2026-10-22 12:30 UTC397
   an effort to **verify** that you can submit this under the license of the
7ff8adafe9e4atagen2026-10-22 12:30 UTC398
   repository.
7ff8adafe9e4atagen2026-10-22 12:30 UTC399
3. The **accountability** of using AI in a contribution lies with the person
7ff8adafe9e4atagen2026-10-22 12:30 UTC400
   that makes that contribution.
7ff8adafe9e4atagen2026-10-22 12:30 UTC401
4. All communication, that includes: commit messages, pull request messages,
7ff8adafe9e4atagen2026-10-22 12:30 UTC402
   documentation, code comments and issues (and comments on issues/pull
7ff8adafe9e4atagen2026-10-22 12:30 UTC403
   requests), that is intended to be read by people to understand your thoughts
7ff8adafe9e4atagen2026-10-22 12:30 UTC404
   and work **must not** have been generated with AI. We exclude machine
7ff8adafe9e4atagen2026-10-22 12:30 UTC405
   translation and tooling that helps with grammar and spelling check.
7ff8adafe9e4atagen2026-10-22 12:30 UTC406
5. Using general AI for review is **forbidden**. If the change contains changes
7ff8adafe9e4atagen2026-10-22 12:30 UTC407
   to the user experience it has to be approved by a human reviewer.
7ff8adafe9e4atagen2026-10-22 12:30 UTC408
6. It is **not allowed** to use AI in an autonomous-looking way to contribute to
7ff8adafe9e4atagen2026-10-22 12:30 UTC409
   the Matrix Rust SDK. This also applies when someone engages in _vibe coding_
7ff8adafe9e4atagen2026-10-22 12:30 UTC410
   or uses so-called _agent mode_.
7ff8adafe9e4atagen2026-10-22 12:30 UTC411
7ff8adafe9e4atagen2026-10-22 12:30 UTC412
[Forgejo]: https://codeberg.org/forgejo/governance/src/branch/main/AIAgreement.md