mirror of
https://github.com/Noratrieb/does-it-build.git
synced 2026-01-14 18:35:01 +01:00
Add filtering for failures
This commit is contained in:
parent
abb83f24b2
commit
42cd9fda83
5 changed files with 53 additions and 8 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
/target
|
/target
|
||||||
/targets
|
/targets
|
||||||
/results
|
/results
|
||||||
/db.sqlite
|
/db.sqlite*
|
||||||
|
|
|
||||||
22
src/web.rs
22
src/web.rs
|
|
@ -72,6 +72,7 @@ async fn web_build(State(state): State<AppState>, Query(query): Query<BuildQuery
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct TargetQuery {
|
struct TargetQuery {
|
||||||
target: String,
|
target: String,
|
||||||
|
failures: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQuery>) -> Response {
|
async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQuery>) -> Response {
|
||||||
|
|
@ -83,8 +84,11 @@ async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQue
|
||||||
status: String,
|
status: String,
|
||||||
version: &'static str,
|
version: &'static str,
|
||||||
builds: Vec<(String, Option<BuildInfo>, Option<BuildInfo>)>,
|
builds: Vec<(String, Option<BuildInfo>, Option<BuildInfo>)>,
|
||||||
|
showing_failures: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let filter_failures = query.failures.unwrap_or(false);
|
||||||
|
|
||||||
match state.db.history_for_target(&query.target).await {
|
match state.db.history_for_target(&query.target).await {
|
||||||
Ok(builds) => {
|
Ok(builds) => {
|
||||||
let latest_core = builds
|
let latest_core = builds
|
||||||
|
|
@ -122,6 +126,12 @@ async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQue
|
||||||
let mut builds = builds_grouped
|
let mut builds = builds_grouped
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(k, (v1, v2))| (k, v1, v2))
|
.map(|(k, (v1, v2))| (k, v1, v2))
|
||||||
|
.filter(|(_, build, _)| {
|
||||||
|
!filter_failures
|
||||||
|
|| build
|
||||||
|
.as_ref()
|
||||||
|
.is_some_and(|build| build.status == Status::Error)
|
||||||
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
builds.sort_by_cached_key(|build| Reverse(build.0.clone()));
|
builds.sort_by_cached_key(|build| Reverse(build.0.clone()));
|
||||||
|
|
||||||
|
|
@ -130,6 +140,7 @@ async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQue
|
||||||
target: query.target,
|
target: query.target,
|
||||||
version: crate::VERSION,
|
version: crate::VERSION,
|
||||||
builds,
|
builds,
|
||||||
|
showing_failures: filter_failures,
|
||||||
};
|
};
|
||||||
|
|
||||||
Html(page.render().unwrap()).into_response()
|
Html(page.render().unwrap()).into_response()
|
||||||
|
|
@ -144,6 +155,7 @@ async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQue
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct NightlyQuery {
|
struct NightlyQuery {
|
||||||
nightly: String,
|
nightly: String,
|
||||||
|
failures: Option<bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn web_nightly(State(state): State<AppState>, Query(query): Query<NightlyQuery>) -> Response {
|
async fn web_nightly(State(state): State<AppState>, Query(query): Query<NightlyQuery>) -> Response {
|
||||||
|
|
@ -158,8 +170,11 @@ async fn web_nightly(State(state): State<AppState>, Query(query): Query<NightlyQ
|
||||||
std_failures: usize,
|
std_failures: usize,
|
||||||
core_broken: Option<String>,
|
core_broken: Option<String>,
|
||||||
std_broken: Option<String>,
|
std_broken: Option<String>,
|
||||||
|
showing_failures: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let filter_failures = query.failures.unwrap_or(false);
|
||||||
|
|
||||||
match state.db.history_for_nightly(&query.nightly).await {
|
match state.db.history_for_nightly(&query.nightly).await {
|
||||||
Ok(builds) => match state.db.nightly_info(&query.nightly).await {
|
Ok(builds) => match state.db.nightly_info(&query.nightly).await {
|
||||||
Ok(info) => {
|
Ok(info) => {
|
||||||
|
|
@ -187,6 +202,12 @@ async fn web_nightly(State(state): State<AppState>, Query(query): Query<NightlyQ
|
||||||
let mut builds = builds_grouped
|
let mut builds = builds_grouped
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(k, (v1, v2))| (k, v1, v2))
|
.map(|(k, (v1, v2))| (k, v1, v2))
|
||||||
|
.filter(|(_, build, _)| {
|
||||||
|
!filter_failures
|
||||||
|
|| build
|
||||||
|
.as_ref()
|
||||||
|
.is_some_and(|build| build.status == Status::Error)
|
||||||
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
builds.sort_by_cached_key(|build| build.0.clone());
|
builds.sort_by_cached_key(|build| build.0.clone());
|
||||||
|
|
||||||
|
|
@ -207,6 +228,7 @@ async fn web_nightly(State(state): State<AppState>, Query(query): Query<NightlyQ
|
||||||
core_failures,
|
core_failures,
|
||||||
core_broken,
|
core_broken,
|
||||||
std_broken,
|
std_broken,
|
||||||
|
showing_failures: filter_failures,
|
||||||
};
|
};
|
||||||
|
|
||||||
Html(page.render().unwrap()).into_response()
|
Html(page.render().unwrap()).into_response()
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Build results for nightly-{{nightly}} target {{target}} {{mode}}</h1>
|
<h1>Build results for nightly-{{nightly}} target {{target}} {{mode}}</h1>
|
||||||
|
<a href="/">Home</a>
|
||||||
<div style="margin-top: 20px" class="{{status}} build-indicator-big">
|
<div style="margin-top: 20px" class="{{status}} build-indicator-big">
|
||||||
{{status}}
|
{{status}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -20,10 +21,14 @@
|
||||||
{{stderr}}
|
{{stderr}}
|
||||||
</pre>
|
</pre>
|
||||||
<p>
|
<p>
|
||||||
<a href="/target?target={{target}}">Build history for target {{target}}</a>
|
<a href="/target?target={{target}}"
|
||||||
|
>Build history for target {{target}}</a
|
||||||
|
>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="/nightly?nightly={{nightly}}">Build state for nightly {{nightly}}</a>
|
<a href="/nightly?nightly={{nightly}}"
|
||||||
|
>Build state for nightly {{nightly}}</a
|
||||||
|
>
|
||||||
</p>
|
</p>
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<span>does-it-build {{version}}</span>
|
<span>does-it-build {{version}}</span>
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Nightly build state for {{nightly}}</h1>
|
<h1>Nightly build state for {{nightly}}</h1>
|
||||||
<a href="/">Back</a>
|
<a href="/">Home</a>
|
||||||
<p>
|
<p>
|
||||||
This contains the status of this nightly. Core is built with
|
This contains the status of this nightly. Core is built with
|
||||||
<code>cargo build --release -Zbuild-std=core</code>. This checks that
|
<code>cargo build --release -Zbuild-std=core</code>. This checks that
|
||||||
|
|
@ -47,6 +47,15 @@
|
||||||
<dd>{{std_failures}}</dd>
|
<dd>{{std_failures}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</p>
|
</p>
|
||||||
|
{% if showing_failures %}
|
||||||
|
<p>
|
||||||
|
<a href="/nightly?nightly={{nightly}}">show all</a>
|
||||||
|
</p>
|
||||||
|
{% else %}
|
||||||
|
<p>
|
||||||
|
<a href="/nightly?nightly={{nightly}}&failures=true">filter failures</a>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>nightly</th>
|
<th>nightly</th>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Target build history for {{target}}</h1>
|
<h1>Target build history for {{target}}</h1>
|
||||||
<a href="/">Back</a>
|
<a href="/">Home</a>
|
||||||
<div style="margin-top: 20px" class="{{status}} build-indicator-big">
|
<div style="margin-top: 20px" class="{{status}} build-indicator-big">
|
||||||
{{status}}
|
{{status}}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -28,11 +28,20 @@
|
||||||
std builds (on targets that have it) but does not check whether
|
std builds (on targets that have it) but does not check whether
|
||||||
codegen/linking works.
|
codegen/linking works.
|
||||||
</p>
|
</p>
|
||||||
|
{% if showing_failures %}
|
||||||
|
<p>
|
||||||
|
<a href="/target?target={{target}}">show all</a>
|
||||||
|
</p>
|
||||||
|
{% else %}
|
||||||
|
<p>
|
||||||
|
<a href="/target?target={{target}}&failures=true">filter failures</a>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>nightly</th>
|
<th>nightly</th>
|
||||||
<th>core<br>codegen</th>
|
<th>core<br />codegen</th>
|
||||||
<th>std<br>check</th>
|
<th>std<br />check</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for build in builds %}
|
{% for build in builds %}
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue