Skip to content

Commit daed684

Browse files
committed
Fix; queue ordering and errors formatting
1 parent 00984b2 commit daed684

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

site/frontend/src/pages/status_new/page.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ function formatStatus(status: BenchmarkRequestStatus): string {
9797
}
9898
}
9999
100+
function formatErrors(errors: Dict<string>) {
101+
return Object.entries(errors).reduce(
102+
(acc, e) => (acc += `${e[0]}: ${e[1]}\n`),
103+
""
104+
);
105+
}
106+
100107
function PullRequestLink({request}: {request: BenchmarkRequest}) {
101108
if (request.requestType === "Release") {
102109
return "";
@@ -145,10 +152,10 @@ loadStatusData(loading);
145152
req.status === "Completed" && req.hasPendingJobs ? "*" : ""
146153
}}
147154
</td>
148-
<td v-html="req.createdAt"></td>
155+
<td v-html="req.completedAt"></td>
149156
<td v-html="getDuration(req)"></td>
150157
<td>
151-
<pre>{{ req.errors }}</pre>
158+
<pre>{{ formatErrors(req.errors) }}</pre>
152159
</td>
153160
</tr>
154161
</template>

site/src/request_handlers/status_page_new.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ pub async fn handle_status_page_new(ctxt: Arc<SiteCtxt>) -> anyhow::Result<statu
1515
let index = conn.load_benchmark_request_index().await?;
1616

1717
// The queue contains any in-progress request(s) and then the following requests in queue order
18-
// We reverse so that it starts with the request that will be benchmarked the latest
1918
let mut queue: Vec<status_new::BenchmarkRequest> = build_queue(&*conn, &index)
2019
.await?
2120
.into_iter()
2221
.map(|req| request_to_ui(&req, HashMap::new()))
2322
.collect();
24-
queue.reverse();
23+
2524
// And then we add N most recently completed requests to it
2625
let completed = conn.get_last_n_completed_benchmark_requests(10).await?;
2726
queue.extend(

0 commit comments

Comments
 (0)