From debb8af0ef0e72048b9df5fed40071745ea40c6b Mon Sep 17 00:00:00 2001 From: aur-build Date: Fri, 20 Nov 2026 23:39:07 +0000 Subject: sandbox,http,review,watch: keep six more test-only types out of the release build --- src/review/approve.rs | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'src/review/approve.rs') diff --git a/src/review/approve.rs b/src/review/approve.rs index 82812fb..f277ac5 100644 --- a/src/review/approve.rs +++ b/src/review/approve.rs @@ -151,20 +151,37 @@ pub enum BulkOutcome { Refused(BulkRefusal), } -#[derive(Debug, thiserror::Error)] -pub enum BulkRefusal { - #[error("high risk: confirm it individually")] - HighRiskUnconfirmed, - #[error("unknown decision `{0}`")] - UnknownDecision(String), - #[error("no such review")] - NotFound, - #[error(transparent)] - Stale(Stale), - #[error("{0}")] - System(Error), +/// The real definition. The module is private, so this `pub` +/// is not a nameable path from outside; the alias below is the +/// only way to reach it, and the alias is what carries the +/// feature-conditional visibility. +mod bulk_refusal { + #[derive(Debug, thiserror::Error)] + pub enum BulkRefusal { + #[error("high risk: confirm it individually")] + HighRiskUnconfirmed, + #[error("unknown decision `{0}`")] + UnknownDecision(String), + #[error("no such review")] + NotFound, + #[error(transparent)] + Stale(Stale), + #[error("{0}")] + System(Error), + } } +/// The payload of one `BulkOutcome::Refused` arm. The bulk tests construct it to assert which approval was refused. +/// +/// `pub` only under `test-support`. Production reaches the type +/// through its own module and never names it from outside; the +/// outside reader that needs the name is a test. +#[cfg(feature = "test-support")] +pub use bulk_refusal::BulkRefusal; + +#[cfg(not(feature = "test-support"))] +pub(crate) use bulk_refusal::BulkRefusal; + pub fn bulk( db: &Db, actor: &str, -- cgit v1.2.3