Skip to content

Commit

Permalink
feat: add extra space in build result
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Mar 23, 2024
1 parent c63e73b commit 8ccddd9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn to_html_build_result(
String::new()
},
job.arch,
job.packages,
job.packages.replace(",", ", "),
&successful_packages.join(", "),
&failed_package.clone().unwrap_or(String::from("None")),
&skipped_packages.join(", "),
Expand Down Expand Up @@ -139,7 +139,7 @@ pub fn to_markdown_build_result(
format!("**Git commit**: [{}](https://github.com/AOSC-Dev/aosc-os-abbs/commit/{})\n", &pipeline.git_sha[..8], pipeline.git_sha),
format!("**Git branch**: [{}](https://github.com/AOSC-Dev/aosc-os-abbs/tree/{})\n", &pipeline.git_branch, pipeline.git_branch),
job.arch,
teloxide::utils::markdown::escape(&job.packages),
teloxide::utils::markdown::escape(&job.packages.replace(",", ", ")),
teloxide::utils::markdown::escape(&successful_packages.join(", ")),
teloxide::utils::markdown::escape(&failed_package.clone().unwrap_or(String::from("None"))),
teloxide::utils::markdown::escape(&skipped_packages.join(", ")),
Expand Down Expand Up @@ -182,7 +182,7 @@ fn test_format_html_build_result() {
let job = Job {
id: 1,
pipeline_id: 1,
packages: "fd".to_string(),
packages: "fd,fd2".to_string(),
arch: "amd64".to_string(),
creation_time: DateTime::from_timestamp(61, 0).unwrap(),
status: "success".to_string(),
Expand Down Expand Up @@ -219,5 +219,5 @@ fn test_format_html_build_result() {

let s = to_html_build_result(&pipeline, &job, &job_ok, worker_hostname, worker_arch, true);

assert_eq!(s, "✅\u{fe0f} Job completed on Yerus (amd64)\n\n<b>Job</b>: <a href=\"https://buildit.aosc.io/jobs/1\">#1</a>\n<b>Pipeline</b>: <a href=\"https://buildit.aosc.io/pipelines/1\">#1</a>\n<b>Enqueue time</b>: 1970-01-01 00:01:01 UTC\n<b>Time elapsed</b>: 888s\n<b>Git commit</b>: <a href=\"https://github.com/AOSC-Dev/aosc-os-abbs/commit/34acef168fc5ec454d3825fc864964951b130b49\">34acef16</a>\n<b>Git branch</b>: <a href=\"https://github.com/AOSC-Dev/aosc-os-abbs/tree/fd-9.0.0\">fd-9.0.0</a>\n<b>GitHub PR</b>: <a href=\"https://github.com/AOSC-Dev/aosc-os-abbs/pull/4992\">#4992</a>\n<b>Architecture</b>: amd64\n<b>Package(s) to build</b>: fd\n<b>Package(s) successfully built</b>: fd\n<b>Package(s) failed to build</b>: None\n<b>Package(s) not built due to previous build failure</b>: \n\n<a href=\"https://pastebin.aosc.io/paste/c0rWzj4EsSC~CVXs2qXtFw\">Build Log >></a>")
assert_eq!(s, "✅\u{fe0f} Job completed on Yerus (amd64)\n\n<b>Job</b>: <a href=\"https://buildit.aosc.io/jobs/1\">#1</a>\n<b>Pipeline</b>: <a href=\"https://buildit.aosc.io/pipelines/1\">#1</a>\n<b>Enqueue time</b>: 1970-01-01 00:01:01 UTC\n<b>Time elapsed</b>: 888s\n<b>Git commit</b>: <a href=\"https://github.com/AOSC-Dev/aosc-os-abbs/commit/34acef168fc5ec454d3825fc864964951b130b49\">34acef16</a>\n<b>Git branch</b>: <a href=\"https://github.com/AOSC-Dev/aosc-os-abbs/tree/fd-9.0.0\">fd-9.0.0</a>\n<b>GitHub PR</b>: <a href=\"https://github.com/AOSC-Dev/aosc-os-abbs/pull/4992\">#4992</a>\n<b>Architecture</b>: amd64\n<b>Package(s) to build</b>: fd, fd2\n<b>Package(s) successfully built</b>: fd\n<b>Package(s) failed to build</b>: None\n<b>Package(s) not built due to previous build failure</b>: \n\n<a href=\"https://pastebin.aosc.io/paste/c0rWzj4EsSC~CVXs2qXtFw\">Build Log >></a>")
}

0 comments on commit 8ccddd9

Please sign in to comment.