Skip to main content

PlanValidationError

Enum PlanValidationError 

Source
pub enum PlanValidationError {
Show 20 variants NotObject, SchemaVersionMissing, SchemaVersionNotInt, UnsupportedSchemaVersion { found: u64, supported: Vec<u32>, }, Malformed { message: String, }, UnknownField { path: String, field: String, }, EmptyString { path: String, }, AcceptanceEmpty, AcceptanceNoCheck, ChunksEmpty, InvalidChunkId { id: String, expected: &'static str, }, DuplicateChunkId { id: String, }, UnknownDep { chunk: String, dep: String, }, DuplicateDep { chunk: String, dep: String, }, DependencyCycle { cycle: Vec<String>, }, ChunkNoCheck { chunk: String, }, ChunkNoFiles { chunk: String, }, UnsafePath { chunk: String, path: String, }, UnsafeCwd { location: String, path: String, }, ExpectExitOutOfRange { location: String, value: i64, },
}
Expand description

A plan.json document failed schema validation.

Every variant names one violation. The CLI renders these as a schema_violation error; PlanValidationError::expected supplies the machine-readable expected hint for the variants that carry one, mirroring crate::report::ReportValidationError.

Variants§

§

NotObject

The document root was not a JSON object.

§

SchemaVersionMissing

The required schema_version field was absent.

§

SchemaVersionNotInt

schema_version was present but not a non-negative integer.

§

UnsupportedSchemaVersion

schema_version declared a major this build does not support.

Fields

§found: u64

The schema_version value read from the document.

§supported: Vec<u32>

The majors this build accepts (see SUPPORTED_PLAN_SCHEMAS).

§

Malformed

The document is a supported version but does not match the v3 shape (missing required field, wrong type, unknown acceptance kind, unknown tier, …). Carries the underlying serde message.

Fields

§message: String

The serde deserialization message.

§

UnknownField

An undeclared field appeared and is not in TOLERATED_OPTIONAL_FIELDS.

Fields

§path: String

Dotted path to the object carrying the unknown key.

§field: String

The offending field name.

§

EmptyString

A required string field was empty (or whitespace-only).

Fields

§path: String

Dotted path to the offending field.

§

AcceptanceEmpty

acceptance[] was empty.

§

AcceptanceNoCheck

acceptance[] contained no executable check (only assertions).

§

ChunksEmpty

chunks[] was empty.

§

InvalidChunkId

A chunk id was empty or used characters outside [A-Za-z0-9_.-] (with a leading alphanumeric). Chunk ids must be safe to reference and log.

Fields

§id: String

The offending id.

§expected: &'static str

Accepted-shape hint.

§

DuplicateChunkId

Two chunks shared an id.

Fields

§id: String

The repeated id.

§

UnknownDep

A chunk’s deps referenced an id that no chunk defines.

Fields

§chunk: String

The depending chunk.

§dep: String

The dangling dependency id.

§

DuplicateDep

A chunk listed the same dependency more than once.

Fields

§chunk: String

The depending chunk.

§dep: String

The repeated dependency id.

§

DependencyCycle

The dependency graph contained a cycle.

Fields

§cycle: Vec<String>

The chunk ids forming the cycle, in order, with the entry id repeated at the end (e.g. ["c1", "c2", "c1"]).

§

ChunkNoCheck

A chunk declared no executable check.

Fields

§chunk: String

The offending chunk id.

§

ChunkNoFiles

A chunk declared no files_touched entries.

Fields

§chunk: String

The offending chunk id.

§

UnsafePath

A files_touched entry was not a safe repo-relative path.

Fields

§chunk: String

The offending chunk id.

§path: String

The offending path.

§

UnsafeCwd

A check’s optional cwd was not a safe repo-relative directory. Held to the same lexical guard as files_touched (is_safe_repo_relative) — cwd controls where a shell command executes, so an absolute path (/etc) or a ../~ traversal would let a check escape the worktree the floor gates. Absence already means “the worktree root”, so a bare . is rejected too — there is one spelling for root, not two.

Fields

§location: String

Dotted path to the offending cwd (e.g. chunks[c1].checks[0].cwd).

§path: String

The offending path.

§

ExpectExitOutOfRange

A check’s optional expect_exit was outside the range a sh -c process can actually report. A shell exit status is 0..=255; a value outside it (negative, or > 255) could never match code() and would make the check permanently un-passable, so it is rejected at validation rather than silently failing every run.

Fields

§location: String

Dotted path to the offending expect_exit.

§value: i64

The offending value.

Implementations§

Source§

impl PlanValidationError

Source

pub fn expected(&self) -> Option<Value>

The machine-readable expected hint for this error, if any — mirrors crate::report::ReportValidationError::expected so the CLI can attach the same structured payload.

Trait Implementations§

Source§

impl Debug for PlanValidationError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PlanValidationError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PlanValidationError

Source§

impl Error for PlanValidationError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for PlanValidationError

Source§

fn eq(&self, other: &PlanValidationError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PlanValidationError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more