refactor(#3255): a constant, not a module with an essay
Review call: 46 lines of documentation around a single constant, part of it already stale. The worst paragraph explained why the earlier per-hive shape had been justified wrongly — history of a design that never shipped, written into the file within an hour of that design being dropped. A file is not a changelog; why it was wrong belongs in the PR. The constant moves to lib.rs beside the status bucket name, keeping only the rationale that stays true: three crates must agree on the string, and the one that agrees hardest speaks neither jetstream nor kv, which is why it cannot sit behind a feature gate. status earns a module of its own because it holds a bucket name AND the functions that open it. This held a constant.
This commit is contained in:
parent
9b939f4626
commit
33958d78ae
5 changed files with 12 additions and 62 deletions
|
|
@ -246,7 +246,7 @@ impl Policy {
|
|||
// a **timeout**, so the visible failure is a hive that never hears
|
||||
// about a change, with nothing in the controller's log to say a
|
||||
// permission was the reason.
|
||||
swarm_queue_client::knowledge::SUBJECT.to_owned(),
|
||||
swarm_queue_client::KNOWLEDGE_SUBJECT.to_owned(),
|
||||
]);
|
||||
subjects
|
||||
}
|
||||
|
|
@ -313,7 +313,7 @@ mod tests {
|
|||
let p = policy().permissions("swarm-controller").expect("a reader");
|
||||
assert!(
|
||||
p.publish
|
||||
.contains(&swarm_queue_client::knowledge::SUBJECT.to_owned()),
|
||||
.contains(&swarm_queue_client::KNOWLEDGE_SUBJECT.to_owned()),
|
||||
"the controller is the only publisher of this event; without the \
|
||||
grant its publish is refused, and a refusal arrives as a timeout"
|
||||
);
|
||||
|
|
@ -336,7 +336,7 @@ mod tests {
|
|||
assert!(
|
||||
!p.publish
|
||||
.iter()
|
||||
.any(|s| s == swarm_queue_client::knowledge::SUBJECT),
|
||||
.any(|s| s == swarm_queue_client::KNOWLEDGE_SUBJECT),
|
||||
"a hive must not publish the knowledge event: {:?}",
|
||||
p.publish
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue