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