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-26 17:01:34 +01:00 committed by Alexis Sellier
parent 024218014b
commit 3bfea69642
No known key found for this signature in database
1 changed files with 10 additions and 0 deletions

View File

@ -398,6 +398,16 @@ impl<'a> StagingPhaseFinal<'a> {
let head = production.set_identity_head()?; let head = production.set_identity_head()?;
log::debug!(target: "worker", "'refs/rad/id' for {} set to {head}", production.id); 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)) Ok((updates, remotes))
} }