Documentation
¶
Overview ¶
Package upgrade regenerates deployed copied files (templates, secrets, copies) from their current sources (phase-8 step 47 slice 2).
Upgrade is a pure readback consumer: the copied inventory comes from the store fold (symlinks are never touched — a link already reflects its source). Each candidate is classified before anything runs:
- missing — the target is gone; regenerating is safe and needs no flag.
- up-to-date — the target's content equals a fresh in-process render/copy of the current source; nothing to do.
- stale — the target is unchanged since deployment (its digest equals the run's recorded as-deployed identity, step 48) and the source moved; regenerates freely.
- modified — the target was edited locally (digest differs from the recorded identity); skipped with a warning, regenerates only under --force.
- differing / unverifiable — runs traced before the step-48 capture (or encrypted chains without a cataloged source) cannot attribute; they skip and follow the --force rule.
Regeneration re-plans the same chains deploy plans (deploy.PlanFileChain) into one graph per scope; plans and traces persist to the store, so the fold reflects the regeneration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
Execute runs the full upgrade operation.
Fold the copied inventory, classify each entry, and regenerate what the classification allows.
Parameters:
- `ctx`: the cancellation context for the fold, planning, and execution.
- `cfg`: the resolved upgrade configuration.
Returns:
- `graphs`: the plan, under --dry-run; nil when the run executed (or there was nothing to do).
- `err`: non-nil when the fold fails, planning fails, or a regeneration run fails.
Types ¶
type Config ¶
type Config struct {
// Projects filters the copied inventory; empty upgrades every project.
Projects []string
// Force regenerates locally-modified and indeterminate targets (without it they skip with a warning;
// stale targets — source moved, target untouched per the recorded identity — regenerate freely).
Force bool
// Segments are the platform/custom segments for the render data.
Segments segment.Segments
// Vars are the user-configured template variables, merged over the builtin render data.
Vars map[string]any
// DryRun serializes the planned regeneration graphs to stdout instead of executing them.
DryRun bool
// Verbose narrates classifications and per-run receipts via [cli.Note].
Verbose bool
}
Config carries the resolved settings for one upgrade operation.