fix: add --all to cargo fmt in script/test and autoformat codebase
cargo fmt without --all fails with "Failed to find targets" in workspace repos. This was blocking every story's gates. Also ran cargo fmt --all to fix all existing formatting issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -226,10 +226,7 @@ pub enum PipelineEvent {
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum TransitionError {
|
||||
/// The current stage doesn't accept this event.
|
||||
InvalidTransition {
|
||||
from_stage: String,
|
||||
event: String,
|
||||
},
|
||||
InvalidTransition { from_stage: String, event: String },
|
||||
}
|
||||
|
||||
// ── The transition function ──────────────────────────────────────────────────
|
||||
@@ -260,11 +257,23 @@ pub fn transition(state: Stage, event: PipelineEvent) -> Result<Stage, Transitio
|
||||
// ── Forward path: backlog → current → (qa →) merge → done ──────────
|
||||
(Backlog, DepsMet) => Ok(Coding),
|
||||
(Coding, GatesStarted) => Ok(Qa),
|
||||
(Coding, QaSkipped { feature_branch, commits_ahead }) => Ok(Merge {
|
||||
(
|
||||
Coding,
|
||||
QaSkipped {
|
||||
feature_branch,
|
||||
commits_ahead,
|
||||
},
|
||||
) => Ok(Merge {
|
||||
feature_branch,
|
||||
commits_ahead,
|
||||
}),
|
||||
(Qa, GatesPassed { feature_branch, commits_ahead }) => Ok(Merge {
|
||||
(
|
||||
Qa,
|
||||
GatesPassed {
|
||||
feature_branch,
|
||||
commits_ahead,
|
||||
},
|
||||
) => Ok(Merge {
|
||||
feature_branch,
|
||||
commits_ahead,
|
||||
}),
|
||||
@@ -414,7 +423,9 @@ pub fn execution_transition(
|
||||
}),
|
||||
|
||||
(Running { agent, .. }, HitRateLimit { resume_at })
|
||||
| (Pending { agent, .. }, HitRateLimit { resume_at }) => Ok(RateLimited { agent, resume_at }),
|
||||
| (Pending { agent, .. }, HitRateLimit { resume_at }) => {
|
||||
Ok(RateLimited { agent, resume_at })
|
||||
}
|
||||
|
||||
(RateLimited { agent, .. }, SpawnedSuccessfully) => Ok(Running {
|
||||
agent,
|
||||
@@ -747,10 +758,7 @@ mod tests {
|
||||
assert!(matches!(e, ExecutionState::Running { .. }));
|
||||
|
||||
let e = execution_transition(e, ExecutionEvent::Exited { exit_code: 0 }).unwrap();
|
||||
assert!(matches!(
|
||||
e,
|
||||
ExecutionState::Completed { exit_code: 0, .. }
|
||||
));
|
||||
assert!(matches!(e, ExecutionState::Completed { exit_code: 0, .. }));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -800,22 +808,20 @@ fn main() {
|
||||
|
||||
// Helper to apply a transition + fire the bus.
|
||||
let mut current_stage = Stage::Backlog;
|
||||
let step = |bus: &EventBus,
|
||||
stage: &mut Stage,
|
||||
event: PipelineEvent|
|
||||
-> Result<(), TransitionError> {
|
||||
let before = stage.clone();
|
||||
let after = transition(stage.clone(), event.clone())?;
|
||||
bus.fire(TransitionFired {
|
||||
story_id: story_id.clone(),
|
||||
before,
|
||||
after: after.clone(),
|
||||
event,
|
||||
at: Utc::now(),
|
||||
});
|
||||
*stage = after;
|
||||
Ok(())
|
||||
};
|
||||
let step =
|
||||
|bus: &EventBus, stage: &mut Stage, event: PipelineEvent| -> Result<(), TransitionError> {
|
||||
let before = stage.clone();
|
||||
let after = transition(stage.clone(), event.clone())?;
|
||||
bus.fire(TransitionFired {
|
||||
story_id: story_id.clone(),
|
||||
before,
|
||||
after: after.clone(),
|
||||
event,
|
||||
at: Utc::now(),
|
||||
});
|
||||
*stage = after;
|
||||
Ok(())
|
||||
};
|
||||
|
||||
println!("Initial: {current_stage:?}\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user