Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/rite-runtime/src/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ mod tests {
static EMPTY_MATERIALS: std::sync::LazyLock<HashMap<MaterialId, String>> =
std::sync::LazyLock::new(HashMap::new);
HandlerContext {
dry_run: false,
params: &EMPTY_PARAMS,
artifacts: &EMPTY_ARTIFACTS,
roles: &EMPTY_ROLES,
Expand All @@ -479,7 +478,6 @@ mod tests {
let params_box = Box::leak(Box::new(params));
let artifacts_box = Box::leak(Box::new(artifacts));
HandlerContext {
dry_run: false,
params: params_box,
artifacts: artifacts_box,
roles: &EMPTY_ROLES,
Expand Down
4 changes: 0 additions & 4 deletions crates/rite-runtime/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ impl ExecutionState {
#[must_use]
pub fn handler_context(&self) -> HandlerContext<'_> {
HandlerContext {
dry_run: self.dry_run,
params: &self.params,
artifacts: &self.artifacts,
roles: &self.roles,
Expand Down Expand Up @@ -98,8 +97,6 @@ impl ExecutionState {
/// return a [`StepResult`], which the executor folds into the next state.
#[derive(Debug, Clone, Copy)]
pub struct HandlerContext<'a> {
/// Whether this is a dry run.
pub dry_run: bool,
/// Instance parameters.
pub params: &'a HashMap<ParamId, serde_json::Value>,
/// Artifacts produced so far.
Expand Down Expand Up @@ -207,7 +204,6 @@ mod tests {

let ctx = state.handler_context();

assert!(ctx.dry_run);
assert!(ctx.get_artifact(&ArtifactId::new("test")).is_some());
assert!(ctx.get_artifact(&ArtifactId::new("missing")).is_none());
}
Expand Down
20 changes: 8 additions & 12 deletions crates/rite-stdlib/src/attestation/attest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,14 @@ impl Action for AttestAction {

reporter.log(Icon::Info, format!("Statement: \"{statement}\""))?;

if ctx.dry_run {
reporter.log(Icon::Info, "[dry run, auto-attesting]")?;
} else {
reporter.log(
Icon::Info,
"By typing 'attest', you confirm the above statement.",
)?;
reporter.prompt(&Prompt::Literal {
label: "Type 'attest' to confirm".to_string(),
expected: "attest".to_string(),
})?;
}
reporter.log(
Icon::Info,
"By typing 'attest', you confirm the above statement.",
)?;
reporter.prompt(&Prompt::Literal {
label: "Type 'attest' to confirm".to_string(),
expected: "attest".to_string(),
})?;

let role = step
.role_str()
Expand Down
Loading