Drop the plan state from the store and the assignments: migration 0108 and placement-only assignments (release 6, issue 1945 B9, B4)

This commit is contained in:
2026-10-24 16:42:02 +02:00
parent 96d7784bce
commit 788fb681ec
110 changed files with 512 additions and 10584 deletions
+2 -22
View File
@@ -458,7 +458,7 @@ func keptLately(builds []Build, planned map[string]bool, now time.Time, within t
return out
}
// keptLatelyOrPlanned is keptLately of every build the records hold, against the plans that have not ended.
// keptLatelyOrPlanned is keptLately of every build the records hold, (no plan names a build any more, ADR 0539 §17).
func (i *Inventory) keptLatelyOrPlanned(ctx context.Context) (map[string][]string, error) {
c, err := i.theChain(ctx)
if err != nil {
@@ -468,27 +468,7 @@ func (i *Inventory) keptLatelyOrPlanned(ctx context.Context) (map[string][]strin
if err != nil {
return nil, err
}
plans, err := i.OpenPlans(ctx)
if err != nil {
return nil, err
}
return keptLately(all, plannedBuilds(plans), time.Now().UTC(), i.lately()), nil
}
// plannedBuilds is every build id these plans name: a module's build, and the builds a rollout carried.
func plannedBuilds(plans []Plan) map[string]bool {
out := map[string]bool{}
for _, p := range plans {
for _, m := range p.Modules {
if m != nil && m.Build != "" {
out[m.Build] = true
}
}
for _, id := range p.Builds {
out[id] = true
}
}
return out
return keptLately(all, nil, time.Now().UTC(), i.lately()), nil
}
// digestIn is the `sha256:<hex>` a reference names, empty when it names none.