Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: git_forge read handlers take a forge-only sub-state

This commit is contained in:
atlas 2026-11-29 13:33:00 +01:00 • committed by mara
commit 52bfca85ad

View file

@ -10,8 +10,9 @@ use axum::{
};
use crate::forge;
use crate::git_forge::GitForgeState;
use crate::issue_report::issue_report_error_status;
use crate::routes::{AppState, error_problem};
use crate::routes::error_problem;
/// The 503 detail when the forge did not answer within
/// [`forge::FORGE_DEADLINE`].
@ -28,7 +29,7 @@ const DEADLINE_DETAIL: &str = "the forge did not answer within the deadline";
tag = "pulls"
)]
pub async fn get_pr_report_all(
State(state): State<AppState>,
State(state): State<GitForgeState>,
) -> Result<Json<Vec<forge::pr_report::PrReportRow>>, problem_details::ProblemDetails> {
let Some(client) = state.forge.get() else {
return Err(error_problem(
@ -74,7 +75,7 @@ pub async fn get_pr_report_all(
tag = "pulls"
)]
pub async fn get_pr_report(
State(state): State<AppState>,
State(state): State<GitForgeState>,
Path((org, repo)): Path<(String, String)>,
) -> Result<Json<Vec<forge::pr_report::PrReportRow>>, problem_details::ProblemDetails> {
let Some(client) = state.forge.get() else {