Skip to main content

canic_host/deployment_truth/promotion/error/
artifact_plan.rs

1use super::identity::PromotionArtifactIdentityReportError;
2use super::readiness::PromotionReadinessError;
3use super::transform::{PromotionPlanTransformError, PromotionTargetExecutionLineageError};
4use crate::deployment_truth::PromotionReadinessStatusV1;
5use crate::deployment_truth::executor::DeploymentExecutionPreflightError;
6use thiserror::Error as ThisError;
7
8///
9/// ArtifactPromotionPlanError
10///
11#[derive(Debug, ThisError)]
12pub enum ArtifactPromotionPlanError {
13    #[error("artifact promotion plan schema mismatch: expected {expected}, found {found}")]
14    SchemaVersionMismatch { expected: u32, found: u32 },
15    #[error("artifact promotion plan is missing required field: {field}")]
16    MissingRequiredField { field: &'static str },
17    #[error(
18        "artifact promotion plan status {status:?} does not match blocker count {blocker_count}"
19    )]
20    StatusBlockerMismatch {
21        status: PromotionReadinessStatusV1,
22        blocker_count: usize,
23    },
24    #[error("artifact promotion plan field {field} is inconsistent")]
25    LinkageMismatch { field: &'static str },
26    #[error("artifact promotion plan field {field} must be a lowercase sha256 hex digest")]
27    InvalidSha256Digest { field: &'static str },
28    #[error("artifact promotion plan readiness is invalid: {0}")]
29    Readiness(#[from] PromotionReadinessError),
30    #[error("artifact promotion plan artifact identity report is invalid: {0}")]
31    ArtifactIdentityReport(#[from] PromotionArtifactIdentityReportError),
32    #[error("artifact promotion plan transform is invalid: {0}")]
33    Transform(#[from] PromotionPlanTransformError),
34    #[error("artifact promotion plan target execution lineage is invalid: {0}")]
35    TargetExecutionLineage(#[from] PromotionTargetExecutionLineageError),
36    #[error(
37        "artifact promotion plan requires target execution lineage for deployment check validation"
38    )]
39    MissingTargetExecutionLineage,
40    #[error("artifact promotion plan target deployment check is invalid: {0}")]
41    TargetCheck(#[source] DeploymentExecutionPreflightError),
42}