Skip to content

Commit

Permalink
Merge pull request #1089 from googlefonts/crater-fix-repro
Browse files Browse the repository at this point in the history
[crater] Add repro links to failures too
  • Loading branch information
rsheeter authored Nov 1, 2024
2 parents 810ec56 + 41b9ecb commit 2b75047
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions fontc_crater/src/ci/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,14 +600,25 @@ fn make_error_report_group_items<'a>(
.map(String::as_str)
.unwrap_or("#")
};
let make_repro_command = |target: &Target| {
let url = get_repo_url(target);
let ttx_command = target.repro_command(url);
format!("event.preventDefault(); copyText('{ttx_command}');",)
};
html! {
@for (path, is_new) in paths_and_if_is_new_error {
details.report_group_item {
summary {
a href = ({ get_repo_url(path) }) { (path) }
@if is_new { " 🆕" }
}
(details(path))
@for (path, is_new) in paths_and_if_is_new_error {
details.report_group_item {
summary {
(path)
@if is_new { " 🆕" }
}
div.diff_info {
a href = (get_repo_url(path)) { "view source repository" }
" "
a href = "" onclick = (make_repro_command(path)) { "copy reproduction command" }
}

(details(path))
}
}
}
Expand Down

0 comments on commit 2b75047

Please sign in to comment.