Executor¶
The executor applies a planned upgrade to the project directory.
Function¶
execute_upgrade(plan, project_dir, dotfile, render_template, *, skip_conflicts=False, force=False) → ExecutionResult¶
Applies all operations in the plan to the project directory.
| Parameter | Type | Description |
|---|---|---|
plan | UpgradePlan | The plan from plan_upgrade() |
project_dir | Path | Root of the project |
dotfile | DotBluefox | Current project state |
render_template | Callable[[str], str] | Template renderer |
skip_conflicts | bool | Skip operations that conflict (default: False) |
force | bool | Backup and overwrite conflicts (default: False) |
Conflict modes¶
| Mode | Behavior |
|---|---|
| Default | Abort on first conflict (UpgradeError) |
skip_conflicts=True | Skip conflicting operations, apply the rest |
force=True | Backup modified files to .bluefox-backups/, then overwrite |
Side effects¶
After execution, the executor:
- Updates hashes in
dotfile.filesfor modifiedfullandsectionsfiles - Adds new entries to
dotfile.filesforCreateFileoperations - Removes entries from
dotfile.filesforRemoveFileoperations - Updates
dotfile.cli_versionto the plan's target version
Model¶
ExecutionResult¶
class ExecutionResult(BaseModel):
applied: list[AnyOperation]
skipped: list[tuple[AnyOperation, ConflictResult]]
backed_up: list[tuple[str, Path]]
| Field | Description |
|---|---|
applied | Operations that were successfully applied |
skipped | Operations skipped due to conflicts (with reason) |
backed_up | Files backed up in force mode (path, backup_path) |