Skip to content

Commit 566baa1

Browse files
committed
Return an actual commit from the next_commit endpoint
The `BenchNext` command will no longer use fake commits, but use the actual commit returned from `next_commit`.
1 parent 74cc697 commit 566baa1

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

collector/src/api.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
pub mod next_commit {
2+
use database::Commit;
3+
24
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
3-
pub struct Commit {
4-
pub sha: String,
5+
pub struct NextCommit {
6+
pub commit: Commit,
57
pub include: Option<String>,
68
pub exclude: Option<String>,
79
pub runs: Option<i32>,
810
}
911

1012
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1113
pub struct Response {
12-
pub commit: Option<Commit>,
14+
pub commit: Option<NextCommit>,
1315
}
1416
}

collector/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,12 +1008,11 @@ fn main_result() -> anyhow::Result<i32> {
10081008
// no missing commits
10091009
return Ok(0);
10101010
};
1011-
let commit = get_commit_or_fake_it(&next.sha)?;
10121011

10131012
let pool = database::Pool::open(&db.db);
10141013

1015-
let sysroot = Sysroot::install(commit.sha.to_string(), &target_triple)
1016-
.with_context(|| format!("failed to install sysroot for {:?}", commit))?;
1014+
let sysroot = Sysroot::install(next.commit.sha.to_string(), &target_triple)
1015+
.with_context(|| format!("failed to install sysroot for {:?}", next.commit))?;
10171016

10181017
let mut benchmarks = get_benchmarks(
10191018
&benchmark_dir,
@@ -1025,7 +1024,7 @@ fn main_result() -> anyhow::Result<i32> {
10251024
let res = bench(
10261025
&mut rt,
10271026
pool,
1028-
&ArtifactId::Commit(commit),
1027+
&ArtifactId::Commit(next.commit),
10291028
&Profile::all(),
10301029
&Scenario::all(),
10311030
bench_rustc.bench_rustc,

site/src/request_handlers/next_commit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ pub async fn handle_next_commit(ctxt: Arc<SiteCtxt>) -> next_commit::Response {
4949
commit.sha,
5050
missing_reason_dbg
5151
);
52-
Some(next_commit::Commit {
53-
sha: commit.sha,
52+
Some(next_commit::NextCommit {
53+
commit,
5454
include,
5555
exclude,
5656
runs,

0 commit comments

Comments
 (0)