swarm-controller: move the accounts concern into its own module
Refs #6897
This commit is contained in:
parent
237cdaffaa
commit
9b2ba275d8
13 changed files with 22 additions and 15 deletions
|
|
@ -706,7 +706,7 @@ in
|
|||
Also the swarm-wide default homeserver for `PUT
|
||||
.../matrix-accounts/{account}` requests that omit their own
|
||||
`homeserver` — see that route's own doc comment
|
||||
(`swarm-controller/src/matrix_account.rs`) for why the field is
|
||||
(`swarm-controller/src/accounts/matrix_account.rs`) for why the field is
|
||||
optional in token mode and what omitting it currently resolves to.
|
||||
That route does not consult it yet.
|
||||
'';
|
||||
|
|
@ -1083,7 +1083,7 @@ in
|
|||
SWARM_CONTROLLER_STALE_AFTER_SECS = toString cfg.staleAfterSeconds;
|
||||
# The accounts the operator admin sync never revokes. Whitespace-
|
||||
# separated: a matrix user id cannot contain a space. Consumed by
|
||||
# swarm-controller/src/matrix_account/operator_admin.rs.
|
||||
# swarm-controller/src/accounts/matrix_account/operator_admin.rs.
|
||||
SWARM_CONTROLLER_MATRIX_ADMIN_SYNC_IGNORE_USERS = lib.concatStringsSep " " deployCfg.swarm-controller.matrixAdminSync.ignoreUsers;
|
||||
# Where `GET /api/alerts` reads alerts (swarm-controller/src/alerts.rs).
|
||||
# Every swarm has one Grafana, reached by name wherever it runs. The
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ swarm-queue-client = { workspace = true, features = [
|
|||
"agent-term",
|
||||
"forge-events",
|
||||
] }
|
||||
# `matrix_account.rs` writes the credential this daemon's route accepts. Same
|
||||
# `accounts/matrix_account.rs` writes the credential this daemon's route accepts. Same
|
||||
# crate the hive reads it back with, which is the point: the path, the field
|
||||
# name and the object's shape are agreements between the two ends, and a
|
||||
# second spelling here would be a store this hive could not read.
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ mod tests {
|
|||
forge: std::sync::Arc::default(),
|
||||
create_gate: std::sync::Arc::default(),
|
||||
accounts: Accounts::Fake(Arc::clone(store)),
|
||||
try_outs: super::super::review_classifier::TryOuts::default(),
|
||||
try_outs: crate::review_classifier::TryOuts::default(),
|
||||
reviews: std::sync::Arc::default(),
|
||||
runs: crate::review_classifier::runs::Runs::Live(None),
|
||||
builds: crate::builder::runs::Builds::Live(None),
|
||||
|
|
@ -139,7 +139,7 @@ mod tests {
|
|||
forge: std::sync::Arc::default(),
|
||||
create_gate: std::sync::Arc::default(),
|
||||
accounts: Accounts::Fake(Arc::clone(store)),
|
||||
try_outs: super::super::review_classifier::TryOuts::default(),
|
||||
try_outs: crate::review_classifier::TryOuts::default(),
|
||||
reviews: std::sync::Arc::default(),
|
||||
runs: crate::review_classifier::runs::Runs::Live(None),
|
||||
builds: crate::builder::runs::Builds::Live(None),
|
||||
|
|
@ -230,7 +230,7 @@ mod tests {
|
|||
forge: std::sync::Arc::default(),
|
||||
create_gate: std::sync::Arc::default(),
|
||||
accounts: Accounts::Fake(Arc::clone(store)),
|
||||
try_outs: super::super::review_classifier::TryOuts::default(),
|
||||
try_outs: crate::review_classifier::TryOuts::default(),
|
||||
reviews: std::sync::Arc::default(),
|
||||
runs: crate::review_classifier::runs::Runs::Live(None),
|
||||
builds: crate::builder::runs::Builds::Live(None),
|
||||
|
|
@ -1255,7 +1255,7 @@ pub(crate) mod tests {
|
|||
forge: std::sync::Arc::default(),
|
||||
create_gate: std::sync::Arc::default(),
|
||||
accounts: super::Accounts::Fake(Arc::clone(store)),
|
||||
try_outs: super::super::review_classifier::TryOuts::default(),
|
||||
try_outs: crate::review_classifier::TryOuts::default(),
|
||||
reviews: std::sync::Arc::default(),
|
||||
runs: crate::review_classifier::runs::Runs::Live(None),
|
||||
builds: crate::builder::runs::Builds::Live(None),
|
||||
|
|
@ -479,7 +479,7 @@ mod tests {
|
|||
forge: std::sync::Arc::default(),
|
||||
create_gate: std::sync::Arc::default(),
|
||||
accounts: Accounts::Fake(Arc::clone(store)),
|
||||
try_outs: super::super::review_classifier::TryOuts::default(),
|
||||
try_outs: crate::review_classifier::TryOuts::default(),
|
||||
reviews: std::sync::Arc::default(),
|
||||
runs: crate::review_classifier::runs::Runs::Live(None),
|
||||
builds: crate::builder::runs::Builds::Live(None),
|
||||
9
swarm-controller/src/accounts/mod.rs
Normal file
9
swarm-controller/src/accounts/mod.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//! The accounts concern: the swarm's matrix accounts and the external accounts
|
||||
//! linked to it (forge, github, gitlab), with their egress and routes.
|
||||
|
||||
pub(crate) mod forge_account;
|
||||
pub(crate) mod github_account;
|
||||
pub(crate) mod gitlab_account;
|
||||
pub(crate) mod link_egress;
|
||||
pub(crate) mod linked_accounts;
|
||||
pub(crate) mod matrix_account;
|
||||
|
|
@ -23,6 +23,7 @@ use std::sync::{Arc, Mutex};
|
|||
|
||||
use anyhow::{Context, Result};
|
||||
|
||||
mod accounts;
|
||||
mod agent_archetype;
|
||||
mod agent_commands;
|
||||
mod agent_config_repo;
|
||||
|
|
@ -61,17 +62,11 @@ mod config_pr;
|
|||
mod egress_allow;
|
||||
mod egress_deny;
|
||||
mod forge;
|
||||
mod forge_account;
|
||||
mod forge_events;
|
||||
mod github_account;
|
||||
mod gitlab_account;
|
||||
mod held_deploys;
|
||||
mod inference;
|
||||
mod issue_report;
|
||||
mod jobq;
|
||||
mod link_egress;
|
||||
mod linked_accounts;
|
||||
mod matrix_account;
|
||||
mod message_stream;
|
||||
mod meta_build;
|
||||
mod meta_fanout;
|
||||
|
|
@ -101,8 +96,11 @@ mod vcs_metrics;
|
|||
mod wanted;
|
||||
mod webhook;
|
||||
|
||||
// The accounts and review modules keep their crate-root paths (`crate::matrix_account::…`).
|
||||
use accounts::{
|
||||
forge_account, github_account, gitlab_account, link_egress, linked_accounts, matrix_account,
|
||||
};
|
||||
use jobq::{Late, WorkerDeps, spawn_jobq_worker};
|
||||
// The review modules keep their crate-root paths (`crate::review_classifier::…`).
|
||||
use review::{notify_flows, notify_router_api, request_reviewer, review_classifier};
|
||||
use routes::AppState;
|
||||
use startup::{
|
||||
|
|
|
|||
Loading…
Reference in a new issue