Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Enderlin <[email protected]>
Signed-off-by: Damir Jelić <[email protected]>
  • Loading branch information
poljar and Hywan authored Oct 9, 2024
1 parent e920b82 commit 04792d8
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 41 deletions.
23 changes: 12 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ Conventional Commits are structured as follows:

The type of changes which will be included in changelogs is one of the following:

feat: A new feature
fix: A bug fix
doc: Documentation changes
refactor: Code refactoring
perf: Performance improvements
ci: Changes to CI configuration files and scripts
* `feat`: A new feature
* `fix`: A bug fix
* `doc`: Documentation changes
* `refactor`: Code refactoring
* `perf`: Performance improvements
* `ci`: Changes to CI configuration files and scripts

The scope is optional and can specify the area of the codebase affected (e.g.,
olm, cipher).
Expand All @@ -70,14 +70,15 @@ leading line.


#### Example Commit Message

```
feat: Add a method to encode Ed25519 public keys to Base64
This patch adds the Ed25519PublicKey::to_base64() method, which allows us to
This patch adds the `Ed25519PublicKey::to_base64()` method, which allows us to
stringify Ed25519 and thus present them to users. It's also commonly used when
Ed25519 keys need to be inserted into JSON.
Changelog: Added the Ed25519PublicKey::to_base64() method which can be used to
Changelog: Added the `Ed25519PublicKey::to_base64()` method which can be used to
stringify the Ed25519 public key.
```

Expand All @@ -92,9 +93,9 @@ vulnerability metadata. These commits are required to include at least the

Security issues have some additional git-trailers:

Security-Impact: The magnitude of harm that can be expected, i.e. low/moderate/high/critical.
CVE: The CVE that was assigned to this issue.
GitHub-Advisory: The GitHub advisory identifier.
* `Security-Impact`: The magnitude of harm that can be expected, i.e. low/moderate/high/critical.
* `CVE`: The CVE that was assigned to this issue.
* `GitHub-Advisory`: The GitHub advisory identifier.

Example:

Expand Down
14 changes: 7 additions & 7 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Releasing and publishing the SDK

While the release process can be handled manually, cargo-release has been
While the release process can be handled manually, `cargo-release` has been
configured to make it more convenient.

By default, [`cargo-release`](https://github.com/crate-ci/cargo-release) assumes
that no pull request is required to cut a release. However, since the SDK
repo is set up so that each push requires a pull request, we need to slightly
deviate from the default workflow. A cargo-xtask has been created to make the
deviate from the default workflow. A `cargo-xtask` has been created to make the
process as smooth as possible.

The procedure is as follows:

1. Switch to a release branch:

```bash
git switch -c release-x.y.z
```
```bash
git switch -c release-x.y.z
  ```
2. Prepare the release. This will update the README.md, prepend the CHANGELOG.md
2. Prepare the release. This will update the `README.md`, prepend the `CHANGELOG.md`
file using `git cliff`, and bump the version in the `Cargo.toml` file.
```bash
cargo xtask release prepare --execute minor|patch|rc
```

3. Double-check and edit the changelog and README if necessary. Once you are
3. Double-check and edit the `CHANGELOG.md` and `README.md` if necessary. Once you are
satisfied, push the branch and open a PR.

```bash
Expand Down
20 changes: 10 additions & 10 deletions cliff-weekly-report.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/matrix-org/matrix-rust-sdk/pull/${2}))"},
]
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor", skip = true},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", skip = true},
{ message = "^style", group = "Styling", skip = true},
{ message = "^test", skip = true},
{ message = "^ci", skip = true},
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor", skip = true },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", skip = true },
{ message = "^style", group = "Styling", skip = true },
{ message = "^test", skip = true },
{ message = "^ci", skip = true },
]
filter_commits = true
tag_pattern = "[0-9]*"
Expand Down
22 changes: 11 additions & 11 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# configuration file for git-cliff (0.1.0)
# This git-cliff configuration file is used to generate release reports.

[changelog]
# changelog header
Expand Down Expand Up @@ -62,16 +62,16 @@ commit_parsers = [
{ footer = "Security-Impact:", group = "Security" },
{ footer = "CVE:", group = "Security" },
{ footer = "GitHub-Advisory:", group = "Security" },
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", skip = true},
{ message = "^style", group = "Styling", skip = true},
{ message = "^test", skip = true},
{ message = "^ci", skip = true},
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", skip = true },
{ message = "^style", group = "Styling", skip = true },
{ message = "^test", skip = true },
{ message = "^ci", skip = true },
]
# filter out the commits that are not matched by commit parsers
filter_commits = true
Expand Down
4 changes: 2 additions & 2 deletions xtask/src/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ fn prepare(version: ReleaseVersion, execute: bool) -> Result<()> {
if execute {
eprintln!(
"Please double check the changelogs and edit them if necessary, \
publish the PR and once it merged switch to main and pull the PR \
and run cargo xtask release publish"
publish the PR, and once it's merged, switch to `main` and pull the PR \
and run `cargo xtask release publish`"
);
}

Expand Down

0 comments on commit 04792d8

Please sign in to comment.