Attempt at making messages somewhat distinguishable

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-06-02 18:34:49 +02:00
parent 9bd430af4b
commit 3943ba0924
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -21,10 +21,10 @@ pub fn format_webhook(wh: &WebHook) -> Option<String> {
WebHook::Push(push) => { WebHook::Push(push) => {
if push.commits.len() != 0 { if push.commits.len() != 0 {
let mut text = format!( let mut text = format!(
"{} pushed {} commits to {} branch {}", "[{}] {} pushed {} commits branch {}",
push.project.name,
push.user_name, push.user_name,
push.commits.len(), push.commits.len(),
push.project.name,
push.ref_, push.ref_,
); );
for commit in &push.commits { for commit in &push.commits {
@ -38,10 +38,10 @@ pub fn format_webhook(wh: &WebHook) -> Option<String> {
text text
} else { } else {
format!( format!(
"{} deleted branch {} from {}", "[{}] {} deleted branch {}",
push.project.name,
push.user_name, push.user_name,
push.ref_, push.ref_,
push.project.name,
) )
} }
} }
@ -54,11 +54,11 @@ pub fn format_webhook(wh: &WebHook) -> Option<String> {
None => return None, None => return None,
}; };
format!( format!(
"{} {} issue {} in {}: {}{}", "[{}] {} {} issue {}: {}{}",
issue.project.name,
issue.user.name, issue.user.name,
action, action,
issue.object_attributes.iid, issue.object_attributes.iid,
issue.project.name,
issue.object_attributes.title, issue.object_attributes.title,
issue issue
.object_attributes .object_attributes
@ -79,11 +79,11 @@ pub fn format_webhook(wh: &WebHook) -> Option<String> {
_ => todo!(), _ => todo!(),
}; };
format!( format!(
"{} {} merge request {} in {}: {}{}", "[{}] {} {} merge request {}: {}{}",
merge_req.project.name,
merge_req.user.name, merge_req.user.name,
action, action,
merge_req.object_attributes.iid, merge_req.object_attributes.iid,
merge_req.project.name,
merge_req.object_attributes.title, merge_req.object_attributes.title,
merge_req merge_req
.object_attributes .object_attributes
@ -107,10 +107,10 @@ pub fn format_webhook(wh: &WebHook) -> Option<String> {
WikiPageAction::Create => "created", WikiPageAction::Create => "created",
}; };
format!( format!(
"{} {} {} wiki page {} <{}>", "[{}] {} {} wiki page {} <{}>",
page.project.name,
page.user.name, page.user.name,
action, action,
page.project.name,
page.object_attributes.title, page.object_attributes.title,
page.object_attributes.url, page.object_attributes.url,
) )