Sanity check reporting products

This commit is contained in:
RunasSudo 2025-05-27 16:16:15 +10:00
parent 148390f030
commit 0518163c3e
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -42,6 +42,31 @@ pub async fn execute_steps(
.execute(context, &steps, &dependencies, &products)
.await?;
// Sanity check the new products
for (product_id, _product) in new_products.map().iter() {
if product_id.name != step.id().name {
panic!(
"Unexpected product name {} from step {}",
product_id,
step.id()
);
}
if !step.id().product_kinds.contains(&product_id.kind) {
panic!(
"Unexpected product kind {} from step {}",
product_id,
step.id()
);
}
if product_id.args != step.id().args {
panic!(
"Unexpected product args {} from step {}",
product_id,
step.id()
);
}
}
// Insert the new products
products.write().await.append(&mut new_products);
}