node: validate production in debug mode

Ensure that the production repository is validated after fetching and
performing deletions. This is to highlight any inconsistencies that
may show up between fetching and deleting references.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
Fintan Halpenny
2023-04-28 14:26:47 +02:00
committed by Alexis Sellier
parent 024218014b
commit 3bfea69642
+10
View File
@@ -398,6 +398,16 @@ impl<'a> StagingPhaseFinal<'a> {
let head = production.set_identity_head()?;
log::debug!(target: "worker", "'refs/rad/id' for {} set to {head}", production.id);
#[cfg(test)]
// N.b. This is to prevent us from shooting ourselves in the
// foot with storage inconsistencies.
radicle::debug_assert_matches!(
production.validate(),
Ok(()),
"repository {} is not valid",
production.id,
);
Ok((updates, remotes))
}