From e91dcdf1bd86ccd83a601c296a3790550d1a1728 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Sun, 21 Sep 2025 13:17:21 +0200 Subject: [PATCH 1/3] fix: fixed wrong key in execute_admin_add_solver function removed from cliff.toml the redundant part of first committer --- cliff.toml | 28 +++++++++++++++++++++++----- src/cli/take_dispute.rs | 2 +- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/cliff.toml b/cliff.toml index 277ae18..ee8d55b 100644 --- a/cliff.toml +++ b/cliff.toml @@ -4,7 +4,6 @@ [remote.github] owner = "MostroP2P" repo = "mostro-cli" -token = "${GITHUB_TOKEN}" [changelog] # A Tera template to be rendered for each release in the changelog. @@ -43,12 +42,12 @@ That will verify the signature of the manifest file, which ensures integrity and {%- endfor -%} {%- if github -%} -{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} +{% if github.contributors | length != 0 %} {% raw %}\n{% endraw -%} - ## New Contributors + ## Contributors {%- endif %}\ -{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} - * @{{ contributor.username }} made their first contribution +{% for contributor in github.contributors %} + * @{{ contributor.username }} made their contribution {%- if contributor.pr_number %} in \ [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ {%- endif %} @@ -78,6 +77,25 @@ footer = """ # Replace the placeholder `` with a URL. postprocessors = [] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "๐Ÿš€ Features" }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^doc", group = "๐Ÿ“š Documentation" }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor", group = "๐Ÿšœ Refactor" }, + { message = "^style", group = "๐ŸŽจ Styling" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore|^ci", group = "โš™๏ธ Miscellaneous Tasks" }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, + { message = ".*", group = "๐Ÿ’ผ Other" }, +] + [git] # Parse commits according to the conventional commits specification. # See https://www.conventionalcommits.org diff --git a/src/cli/take_dispute.rs b/src/cli/take_dispute.rs index d22712b..a051929 100644 --- a/src/cli/take_dispute.rs +++ b/src/cli/take_dispute.rs @@ -22,7 +22,7 @@ pub async fn execute_admin_add_solver(npubkey: &str, ctx: &Context) -> Result<() send_dm( &ctx.client, - Some(&ctx.identity_keys), + Some(&ctx.context_keys), &ctx.trade_keys, &ctx.mostro_pubkey, take_dispute_message, From 45e538585b20aa6c9ea06d810f4b68412035edcb Mon Sep 17 00:00:00 2001 From: arkanoider Date: Sun, 21 Sep 2025 13:37:28 +0200 Subject: [PATCH 2/3] refactor: added helper for all admin disputes commands --- src/cli/take_dispute.rs | 49 +++++------------------------------------ src/util.rs | 15 +++++++++++++ 2 files changed, 20 insertions(+), 44 deletions(-) diff --git a/src/cli/take_dispute.rs b/src/cli/take_dispute.rs index a051929..694b847 100644 --- a/src/cli/take_dispute.rs +++ b/src/cli/take_dispute.rs @@ -2,7 +2,7 @@ use anyhow::Result; use mostro_core::prelude::*; use uuid::Uuid; -use crate::{cli::Context, util::send_dm}; +use crate::{cli::Context, util::admin_send_dm}; pub async fn execute_admin_add_solver(npubkey: &str, ctx: &Context) -> Result<()> { println!( @@ -20,16 +20,7 @@ pub async fn execute_admin_add_solver(npubkey: &str, ctx: &Context) -> Result<() .as_json() .map_err(|_| anyhow::anyhow!("Failed to serialize message"))?; - send_dm( - &ctx.client, - Some(&ctx.context_keys), - &ctx.trade_keys, - &ctx.mostro_pubkey, - take_dispute_message, - None, - false, - ) - .await?; + admin_send_dm(ctx, take_dispute_message).await?; Ok(()) } @@ -48,16 +39,7 @@ pub async fn execute_admin_cancel_dispute(dispute_id: &Uuid, ctx: &Context) -> R println!("Admin keys: {:?}", ctx.context_keys.public_key.to_string()); - send_dm( - &ctx.client, - Some(&ctx.context_keys), - &ctx.trade_keys, - &ctx.mostro_pubkey, - take_dispute_message, - None, - false, - ) - .await?; + admin_send_dm(ctx, take_dispute_message).await?; Ok(()) } @@ -75,18 +57,7 @@ pub async fn execute_admin_settle_dispute(dispute_id: &Uuid, ctx: &Context) -> R .map_err(|_| anyhow::anyhow!("Failed to serialize message"))?; println!("Admin keys: {:?}", ctx.context_keys.public_key.to_string()); - - send_dm( - &ctx.client, - Some(&ctx.context_keys), - &ctx.trade_keys, - &ctx.mostro_pubkey, - take_dispute_message, - None, - false, - ) - .await?; - + admin_send_dm(ctx, take_dispute_message).await?; Ok(()) } @@ -109,16 +80,6 @@ pub async fn execute_take_dispute(dispute_id: &Uuid, ctx: &Context) -> Result<() println!("Admin keys: {:?}", ctx.context_keys.public_key.to_string()); - send_dm( - &ctx.client, - Some(&ctx.context_keys), - &ctx.trade_keys, - &ctx.mostro_pubkey, - take_dispute_message, - None, - false, - ) - .await?; - + admin_send_dm(ctx, take_dispute_message).await?; Ok(()) } diff --git a/src/util.rs b/src/util.rs index 0d50db1..1f4fe50 100644 --- a/src/util.rs +++ b/src/util.rs @@ -662,5 +662,20 @@ pub async fn run_simple_order_msg(command: Commands, order_id: &Uuid, ctx: &Cont execute_send_msg(command, Some(*order_id), ctx, None).await } +// helper (place near other CLI utils) +pub async fn admin_send_dm(ctx: &Context, msg: String) -> anyhow::Result<()> { + send_dm( + &ctx.client, + Some(&ctx.context_keys), + &ctx.trade_keys, + &ctx.mostro_pubkey, + msg, + None, + false, + ) + .await?; + Ok(()) +} + #[cfg(test)] mod tests {} From 8871a4a03fc0e178a71748b8af42015a95ebf8ef Mon Sep 17 00:00:00 2001 From: arkanoider Date: Sun, 21 Sep 2025 13:58:19 +0200 Subject: [PATCH 3/3] feat: improved changelog.md --- cliff.toml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/cliff.toml b/cliff.toml index ee8d55b..bbd735c 100644 --- a/cliff.toml +++ b/cliff.toml @@ -28,6 +28,10 @@ That will verify the signature of the manifest file, which ensures integrity and ## What's Changed {%- if version %} in {{ version }}{%- endif -%} +{% for group, commits in commits | group_by(attribute="group") %} +{% if group != "" %} +### {{ group }} +{% endif %} {% for commit in commits %} {% if commit.remote.pr_title -%} {%- set commit_message = commit.remote.pr_title -%} @@ -39,6 +43,7 @@ That will verify the signature of the manifest file, which ensures integrity and {% if commit.remote.pr_number %} in \ [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ {%- endif %} +{%- endfor %} {%- endfor -%} {%- if github -%} @@ -75,25 +80,26 @@ footer = """ """ # An array of regex based postprocessors to modify the changelog. # Replace the placeholder `` with a URL. -postprocessors = [] - +postprocessors = [{ pattern = "", replace = "" }] # regex for parsing and grouping commits commit_parsers = [ - { message = "^feat", group = "๐Ÿš€ Features" }, - { message = "^fix", group = "๐Ÿ› Bug Fixes" }, - { message = "^doc", group = "๐Ÿ“š Documentation" }, - { message = "^perf", group = "โšก Performance" }, - { message = "^refactor", group = "๐Ÿšœ Refactor" }, - { message = "^style", group = "๐ŸŽจ Styling" }, - { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^feat(\\(.+\\))?!?:", group = "๐Ÿš€ Features" }, + { message = "^fix(\\(.+\\))?!?:", group = "๐Ÿ› Bug Fixes" }, + { message = "^docs(\\(.+\\))?!?:", group = "๐Ÿ“š Documentation" }, + { message = "^perf(\\(.+\\))?!?:", group = "โšก Performance" }, + { message = "^refactor(\\(.+\\))?!?:", group = "๐Ÿšœ Refactor" }, + { message = "^style(\\(.+\\))?!?:", group = "๐ŸŽจ Styling" }, + { message = "^test(\\(.+\\))?!?:", group = "๐Ÿงช Testing" }, + { message = "^ci(\\(.+\\))?!?:", group = "โš™๏ธ CI/CD" }, + { message = "^build(\\(.+\\))?!?:", group = "๐Ÿ”จ Build" }, { message = "^chore\\(release\\): prepare for", skip = true }, { message = "^chore\\(deps.*\\)", skip = true }, { message = "^chore\\(pr\\)", skip = true }, { message = "^chore\\(pull\\)", skip = true }, - { message = "^chore|^ci", group = "โš™๏ธ Miscellaneous Tasks" }, - { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, - { message = "^revert", group = "โ—€๏ธ Revert" }, - { message = ".*", group = "๐Ÿ’ผ Other" }, + { message = "^chore(\\(.+\\))?!?:", group = "โš™๏ธ Miscellaneous Tasks" }, + { body = "(?i)security", group = "๐Ÿ›ก๏ธ Security" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, + { message = ".*", group = "๐Ÿ’ผ Other" }, ] [git]