pub fn module() -> ModuleDescriptorExpand description
The gates module: the CI model every clone shares, and the completion state only this
checkout can answer.
Neither has a command-line projection of its own, for the reason super::obligations
states about the local half: majordomus check and majordomus finish are already the
command line’s answer to this question, and they read this module rather than deriving a
second one. What is new is that they now have a gate half to read.
use majordomus_cli::capability::builtin::gates::module;
let m = module();
assert_eq!(m.id.as_str(), "gates");
// every projection is derived from the declaration and written nowhere else
let routes: Vec<&str> = m
.capabilities
.iter()
.filter_map(|e| e.capability.exposure.http.as_ref().map(|h| h.path.as_str()))
.collect();
assert_eq!(routes, ["/api/v1/gates", "/api/v1/gates/completion"]);