mirror of
https://github.com/Noratrieb/does-it-build.git
synced 2026-01-14 10:25:01 +01:00
Add notifications for target maintainers (#10)
This adds a feature where maintainers can add themselves to an array in the source to receive notifications whenever the target fails. The way this works is via GitHub, I created a new repository https://github.com/Noratrieb/does-it-build-notifications where an app will create issues that ping the respective users. This is the easiest option for me and also fits nicely into people's workflows on GitHub. Whenever a target fails, an issue is created for it. This issue is kept open (with a new comment every day that it continues to fail), and then closed when the target builds again.
This commit is contained in:
parent
112420d224
commit
e4c69f17be
12 changed files with 784 additions and 13 deletions
11
src/web.rs
11
src/web.rs
|
|
@ -11,7 +11,10 @@ use color_eyre::{eyre::Context, Result};
|
|||
use serde::Deserialize;
|
||||
use tracing::{error, info};
|
||||
|
||||
use crate::db::{BuildInfo, BuildMode, BuildStats, Db, Status};
|
||||
use crate::{
|
||||
db::{BuildInfo, BuildMode, BuildStats, Db, Status},
|
||||
notification,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
|
|
@ -138,6 +141,8 @@ async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQue
|
|||
version: &'static str,
|
||||
builds: Vec<(String, Option<BuildInfo>, Option<BuildInfo>)>,
|
||||
showing_failures: bool,
|
||||
notification_pr_url: String,
|
||||
maintainers: Option<&'static [&'static str]>,
|
||||
}
|
||||
|
||||
let filter_failures = query.failures.unwrap_or(false);
|
||||
|
|
@ -173,12 +178,16 @@ async fn web_target(State(state): State<AppState>, Query(query): Query<TargetQue
|
|||
.collect::<Vec<_>>();
|
||||
builds.sort_by_cached_key(|build| Reverse(build.0.clone()));
|
||||
|
||||
let maintainers = notification::maintainers_for_target(&query.target);
|
||||
|
||||
let page = TargetPage {
|
||||
status,
|
||||
target: query.target,
|
||||
version: crate::VERSION,
|
||||
builds,
|
||||
showing_failures: filter_failures,
|
||||
notification_pr_url: notification::notification_pr_url(),
|
||||
maintainers,
|
||||
};
|
||||
|
||||
Html(page.render().unwrap()).into_response()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue