Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ serde_json = { workspace = true }
sqlx = { workspace = true }
uuid = { workspace = true }
chrono = { workspace = true }
chrono-tz = "0.10"
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
async-trait = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/auto_deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ pub(crate) async fn deploy_project(

async fn tick(state: &AppState, ensure_webhooks: bool) {
crate::github_app_events::purge_old_deliveries(&state.pool).await;
crate::pr_previews::sweep(state).await;
let projects = sqlx::query_as::<_, Project>(
r#"SELECT * FROM projects
WHERE auto_deploy != 0
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ pub async fn migrate(pool: &PgPool) -> Result<(), sqlx::Error> {

// GitHub App (P0) : schéma + scellement des PAT existants.
migrate_github_app(pool).await?;
// Previews de PR (P5) : branche de tête, deployment GitHub, portée « preview » des env.
crate::pr_previews::migrate(pool).await?;

Ok(())
}
Expand Down
6 changes: 4 additions & 2 deletions apps/server/src/github_app_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ async fn route(state: &AppState, acc: &Accepted) -> Result<&'static str, String>
.map(|_| "processed")
.map_err(|(_, j)| j.0.to_string())
}
// Previews de PR : phase P5.
"pull_request" => Ok("ignored_until_p5"),
"pull_request" => {
let id = acc.installation_id.ok_or("installation absente")?;
crate::pr_previews::handle_pull_request(state, id, &acc.action, &acc.payload).await
}
_ => Ok("ignored"),
}
}
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ mod platform_sso;
#[cfg(test)]
mod platform_sso_tests;
mod pocket_id;
mod pr_previews;
mod project_oidc;
mod project_oidc_routes;
mod project_pg;
Expand Down Expand Up @@ -370,6 +371,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.merge(actions_routes::router())
.merge(git_routes::router())
.merge(github_app_routes::router())
.merge(pr_previews::router())
.merge(github_app_events::router())
.merge(draft_routes::router())
.merge(correction::router())
Expand Down
Loading
Loading