summaryrefslogtreecommitdiffstats
path: root/src/usecase/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/usecase/mod.rs')
-rw-r--r--src/usecase/mod.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/usecase/mod.rs b/src/usecase/mod.rs
new file mode 100644
index 0000000..4a7a0a9
--- /dev/null
+++ b/src/usecase/mod.rs
@@ -0,0 +1,35 @@
+//! The workflows themselves — the thing between a front end and the modules.
+//!
+//! Before this module existed, a workflow had one implementation per front end.
+//! `main` opened the repository inline before its command match; `serve` opened
+//! it again; the web routes wrote subscriptions and retried builds with their
+//! own `db::` calls, so the CLI and the UI could drift and nothing would notice
+//! until a reviewer saw one behaviour in the browser and another in the
+//! terminal.
+//!
+//! A function here is a workflow only if more than one step has to happen in a
+//! particular order. `subscribe` is a workflow because the repo row has to be
+//! resolved first and a first detection may have to follow. `candidate_by_id`
+//! is not, and stays where it is.
+//!
+//! Nothing in here formats output or knows a terminal, a form or a status code
+//! exists. Results carry enough structure for each front end to say the same
+//! facts in its own voice — which is why `Approved` reports the queueing
+//! outcome rather than deciding whether a failed enqueue is fatal.
+
+mod bootstrap;
+mod builds;
+mod detect;
+mod maintenance;
+mod reviews;
+mod subscriptions;
+
+pub use bootstrap::{init, open, serve};
+pub use builds::{cancel, enqueue_candidate, manual_rebuild, retry, withdraw_package};
+pub use maintenance::{acknowledge_notice, backup, plan_gc, run_gc, GcPlan};
+pub use reviews::{
+ approve, bulk, prepare_review, reject, view_review, Approval, Approved, Decision,
+ Prepared,
+};
+pub use subscriptions::{subscribe, toggle_pause, unsubscribe, Pause, Subscribe};
+pub use detect::{check, detect, Checked};