swarm-controller: split main.rs into jobq, routes and startup modules
no behaviour change: a pure move of items and tests into new modules, plus visibility edits (pub(crate)) and path updates in sibling modules that named crate-root items. same routes, same OpenAPI, 561 tests before and after. why: #5470, new features stop landing in one 6.4k-line file by default. files outside swarm-controller/src: docs/agent-lifecycle/agent-roster.md, swarm-ui JobsPage.tsx and AgentsPage.tsx, nix/host-modules/swarm-controller.nix and swarm-grafana.nix hold comments that named main.rs for items that moved.
This commit is contained in:
parent
f0a6d6c042
commit
738dd1c95b
42 changed files with 6854 additions and 6680 deletions
|
|
@ -12,8 +12,8 @@ use axum::{
|
|||
extract::{Path, State},
|
||||
};
|
||||
|
||||
use super::{AppState, StatusUnavailable, error_problem};
|
||||
use crate::forge;
|
||||
use crate::routes::{AppState, StatusUnavailable, error_problem};
|
||||
|
||||
/// The 503 detail when the forge did not answer within
|
||||
/// [`forge::FORGE_DEADLINE`].
|
||||
|
|
@ -21,7 +21,7 @@ const DEADLINE_DETAIL: &str = "the forge did not answer within the deadline";
|
|||
|
||||
/// Repos with at least one open issue, as `owner/name` full names — the
|
||||
/// data source for swarm-ui's repo-filter dropdown. Not scoped to
|
||||
/// `forge::CONFIG_ORG` the way `main.rs`'s `get_config_prs` is: this
|
||||
/// `forge::CONFIG_ORG` the way `routes/config_prs.rs`'s `get_config_prs` is: this
|
||||
/// report deliberately covers the whole forge instance, not one org, since
|
||||
/// the report itself is a general-purpose browsing tool rather than
|
||||
/// something agent-config-specific.
|
||||
|
|
@ -156,7 +156,7 @@ pub async fn get_issue_report(
|
|||
///
|
||||
/// `Client::issue_report` propagates through `anyhow`, so the concrete
|
||||
/// [`forgejo_api::ForgejoError`] survives underneath but is not the type in
|
||||
/// hand — downcasting back to it, same pattern `main.rs`'s
|
||||
/// hand — downcasting back to it, same pattern `routes`'s
|
||||
/// `wanted_error_status` uses for `swarm_queue_client::Error`. A 404 there
|
||||
/// (`forge::is_repo_not_found`) means the repo itself doesn't exist;
|
||||
/// anything else — including a 404 on some *other* call this function
|
||||
|
|
@ -257,7 +257,7 @@ mod tests {
|
|||
"/api/issue-report",
|
||||
"/api/repos/o/r/issue-report",
|
||||
] {
|
||||
let (state, _) = crate::tests::state_with_roster();
|
||||
let (state, _) = crate::routes::tests::state_with_roster();
|
||||
assert!(
|
||||
state
|
||||
.forge
|
||||
|
|
@ -268,7 +268,7 @@ mod tests {
|
|||
);
|
||||
let start = tokio::time::Instant::now();
|
||||
let req = Request::get(uri).body(Body::empty()).expect("a request");
|
||||
let res = crate::build_app(state)
|
||||
let res = crate::startup::build_app(state)
|
||||
.oneshot(req)
|
||||
.await
|
||||
.expect("infallible");
|
||||
|
|
|
|||
Loading…
Reference in a new issue