Skip to content

Commit dde38ae

Browse files
committed
Do not show try commits in graphs
In a single graph, we want to also see try commits at the bounds (start/end), since sometimes we want to show a graph that ends in a try commit. For the graphs overview on the index page, we always want to see only master commits.
1 parent 572f22e commit dde38ae

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

site/src/request_handlers/graph.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ async fn create_graphs(
8080
request: graphs::Request,
8181
ctxt: &SiteCtxt,
8282
) -> ServerResult<Arc<graphs::Response>> {
83-
let artifact_ids = Arc::new(artifact_ids_for_range(ctxt, request.start, request.end));
83+
let artifact_ids = Arc::new(master_artifact_ids_for_range(
84+
ctxt,
85+
request.start,
86+
request.end,
87+
));
8488
let mut benchmarks = HashMap::new();
8589

8690
let create_selector = |filter: &Option<String>| -> Selector<String> {
@@ -153,6 +157,15 @@ fn artifact_ids_for_range(ctxt: &SiteCtxt, start: Bound, end: Bound) -> Vec<Arti
153157
.collect()
154158
}
155159

160+
/// Returns master commit artifact IDs for the given range.
161+
fn master_artifact_ids_for_range(ctxt: &SiteCtxt, start: Bound, end: Bound) -> Vec<ArtifactId> {
162+
ctxt.data_range(start..=end)
163+
.into_iter()
164+
.filter(|commit| commit.is_master())
165+
.map(|commit| commit.into())
166+
.collect()
167+
}
168+
156169
/// Creates a summary "benchmark" that averages the results of all other
157170
/// test cases per profile type
158171
fn create_summary(

0 commit comments

Comments
 (0)