diff --git a/src/main.rs b/src/main.rs index 3a512a8..d8bd3b5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,8 +53,10 @@ async fn main_inner() -> Result<()> { ) .await?; + let notification_repo = format!("https://github.com/{github_owner}/{github_repo}"); + let builder = build::background_builder(db.clone(), github_client); - let server = web::webserver(db); + let server = web::webserver(db, notification_repo); tokio::select! { result = builder => { diff --git a/src/web.rs b/src/web.rs index fdb5f37..a667a51 100644 --- a/src/web.rs +++ b/src/web.rs @@ -19,9 +19,10 @@ use crate::{ #[derive(Clone)] pub struct AppState { pub db: Db, + notification_repo: String, } -pub async fn webserver(db: Db) -> Result<()> { +pub async fn webserver(db: Db, notification_repo: String) -> Result<()> { let app = Router::new() .route("/", get(web_root)) .route("/build", get(web_build)) @@ -29,7 +30,10 @@ pub async fn webserver(db: Db) -> Result<()> { .route("/nightly", get(web_nightly)) .route("/index.css", get(index_css)) .route("/index.js", get(index_js)) - .with_state(AppState { db }); + .with_state(AppState { + db, + notification_repo, + }); info!("Serving website on port 3000 (commit {})", crate::VERSION); @@ -80,6 +84,7 @@ async fn web_build(State(state): State, Query(query): Query, build_duration_s: Option, + notification_pr_url: String, does_it_build_version: Option, } @@ -109,6 +114,7 @@ async fn web_build(State(state): State, Query(query): Query, Query(query): Query, + open_notification_issue_number: Option, + notification_repo: String, } let filter_failures = query.failures.unwrap_or(false); @@ -176,6 +184,14 @@ async fn web_target(State(state): State, Query(query): Query, Query(query): Query{{target}} ({{mode}}) Home +

+ 🔔 does-it-build supports sending notifications to target maintainers via + GitHub issues. You can add yourself with + a PR. 🔔 +

{{status}}
{% if let Some(rustflags) = rustflags %}

diff --git a/templates/target.html b/templates/target.html index c5678ce..e83b13b 100644 --- a/templates/target.html +++ b/templates/target.html @@ -38,6 +38,12 @@ {% endfor %}

{% endif %} + {% if let Some(issue) = open_notification_issue_number %} +

+ There is currently an open issue with a maintainer ping: + {{notification_repo}}/issues/{{issue}} +

+ {% endif %} {% if showing_failures %}

show all