Skip to content

Commit

Permalink
Merge pull request #943 from googlefonts/crater-diff-link
Browse files Browse the repository at this point in the history
[crater] Make git sha a link to github diff
  • Loading branch information
cmyr authored Sep 5, 2024
2 parents 34c3419 + a9c96ee commit 4ffc3a2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fontc_crater/src/ci/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,18 @@ fn make_table_body(runs: &[RunSummary]) -> Markup {
true,
);
let diff_fmt = format!("{:.3}", run.stats.diff_perc_including_failures);
let diff_url = format!(
"https://github.com/googlefonts/fontc/compare/{}...{}/",
prev.as_ref()
.map(|p| p.fontc_rev.as_str())
.unwrap_or(run.fontc_rev.as_str()),
run.fontc_rev,
);
let short_rev = run.fontc_rev.get(..16).unwrap_or(run.fontc_rev.as_str());
html! {
tr.run {
td.date { (run.began.format("%Y-%m-%d %H:%M:%S")) }
td.rev { ( run.fontc_rev.get(..16).unwrap_or(run.fontc_rev.as_str()) ) }
td.rev { a href=(diff_url) { (short_rev) } }
td.total { ( run.stats.total_targets) " " (total_diff) }
td.identical { (run.stats.identical) " " (identical_diff) }
td.fontc_err { (run.stats.fontc_failed) " " (fontc_err_diff) }
Expand Down

0 comments on commit 4ffc3a2

Please sign in to comment.