From 04792d8701d2e5c59206621988c86098a676eed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 9 Oct 2024 16:31:41 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ivan Enderlin Signed-off-by: Damir Jelić --- CONTRIBUTING.md | 23 ++++++++++++----------- RELEASING.md | 14 +++++++------- cliff-weekly-report.toml | 20 ++++++++++---------- cliff.toml | 22 +++++++++++----------- xtask/src/release.rs | 4 ++-- 5 files changed, 42 insertions(+), 41 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5bf01af758a..e68cbff3751 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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). @@ -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. ``` @@ -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: diff --git a/RELEASING.md b/RELEASING.md index 3c55b37ddfa..fadd5b76aae 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -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 diff --git a/cliff-weekly-report.toml b/cliff-weekly-report.toml index a22dd429bcd..bfc955a743f 100644 --- a/cliff-weekly-report.toml +++ b/cliff-weekly-report.toml @@ -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]*" diff --git a/cliff.toml b/cliff.toml index be4c88621c9..25d521fece9 100644 --- a/cliff.toml +++ b/cliff.toml @@ -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 @@ -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 diff --git a/xtask/src/release.rs b/xtask/src/release.rs index 74bead13e93..82a8c894c38 100644 --- a/xtask/src/release.rs +++ b/xtask/src/release.rs @@ -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`" ); }