Skip to content

Improve message for no CI builds found and various cleanup #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ pub struct Commit {
/// however, it does limit the amount of commits somewhat.
const EPOCH_COMMIT: &str = "927c55d86b0be44337f37cf5b0a76fb8ba86e06c";

const REPORT_HEADER: &str = "\
==================================================================================
= Please file this regression report on the rust-lang/rust GitHub repository =
= New issue: https://github.com/rust-lang/rust/issues/new =
= Known issues: https://github.com/rust-lang/rust/issues =
= Copy and paste the text below into the issue report thread. Thanks! =
==================================================================================";

#[derive(Debug, StructOpt)]
#[structopt(after_help = "EXAMPLES:
Run a fully automatic nightly bisect doing `cargo check`:
Expand Down Expand Up @@ -679,12 +687,12 @@ fn print_results(cfg: &Config, client: &Client, bisection_result: &BisectionResu
}

let tc_found = format!("Regression in {}", toolchains[*found]);
eprintln!("");
eprintln!("");
eprintln!();
eprintln!();
eprintln!("{}", "*".repeat(80).dimmed().bold());
eprintln!("{}", tc_found.red());
eprintln!("{}", "*".repeat(80).dimmed().bold());
eprintln!("");
eprintln!();
}

fn print_final_report(
Expand All @@ -704,20 +712,8 @@ fn print_final_report(
..
} = ci_bisection_result;

#[rustfmt::skip]
eprintln!("{}", "==================================================================================".dimmed());
#[rustfmt::skip]
eprintln!("{}", "= Please file this regression report on the rust-lang/rust GitHub repository =".dimmed());
#[rustfmt::skip]
eprintln!("{}", "= New issue: https://github.com/rust-lang/rust/issues/new =".dimmed());
#[rustfmt::skip]
eprintln!("{}", "= Known issues: https://github.com/rust-lang/rust/issues =".dimmed());
#[rustfmt::skip]
eprintln!("{}", "= Copy and paste the text below into the issue report thread. Thanks! =".dimmed());
#[rustfmt::skip]
eprintln!("{}", "==================================================================================".dimmed());

eprintln!("");
eprintln!("{}", REPORT_HEADER.dimmed());
eprintln!();

let (start, end) = searched_range(cfg, nightly_toolchains);

Expand All @@ -726,7 +722,7 @@ fn print_final_report(
eprintln!("regressed nightly: {}", nightly_toolchains[*nightly_found],);

eprintln!(
"searched commits: from https://github.com/rust-lang/rust/commit/{} to https://github.com/rust-lang/rust/commit/{1}",
"searched commits: from https://github.com/rust-lang/rust/commit/{0} to https://github.com/rust-lang/rust/commit/{1}",
ci_toolchains.first().unwrap(),
ci_toolchains.last().unwrap(),
);
Expand All @@ -736,15 +732,15 @@ fn print_final_report(
ci_toolchains[*ci_found],
);

eprintln!("");
eprintln!();
eprintln!("<details>");
eprintln!(
"<summary>bisected with <a href='{}'>cargo-bisect-rustc</a> v{}</summary>",
env!("CARGO_PKG_REPOSITORY"),
env!("CARGO_PKG_VERSION"),
);
eprintln!("");
eprintln!("");
eprintln!();
eprintln!();
if let Some(host) = option_env!("HOST") {
eprintln!("Host triple: {}", host);
}
Expand All @@ -757,7 +753,7 @@ fn print_final_report(
eprint!("{} ", arg.to_string_lossy());
}
}
eprintln!("");
eprintln!();
eprintln!("```");
eprintln!("</details>");
}
Expand Down Expand Up @@ -1146,7 +1142,7 @@ fn bisect_ci_in_commits(

if commits.is_empty() {
bail!(
"no commits between {} and {} within last 167 days",
"no CI builds available between {} and {} within last 167 days",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message confuses me: What does it mean by "within last 167 days"?

Copy link
Member

@spastorino spastorino Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after 167 days artifacts are removed from the CI, so you can't install nightlies older than 167 days ago.

start,
end
);
Expand All @@ -1159,7 +1155,7 @@ fn bisect_ci_in_commits(
}

eprintln!("validated commits found, specifying toolchains");
eprintln!("");
eprintln!();

let toolchains = commits
.into_iter()
Expand Down