Say why each module is in a plan: its build source's changed files, or why it is read whole (hq ADR 0267, issue 363)
A what-if named the build seat's holder as packaging the controller's source, "rebuilt without their own source moving", while it was in the plan because an open plan had not built it yet. The what-if and the merge log now say, per module, which changed files of its build source moved it, or that it is read whole and why: no build source recorded, a newer build failed, or a plan has not built it yet.
This commit is contained in:
@@ -1602,6 +1602,15 @@ func planWhatIf(ctx context.Context, inv *inventory.Inventory, repository string
|
||||
}
|
||||
p := planOfMerge(m, names, edges)
|
||||
fmt.Printf("a merge of %s would build %d module(s) in %d tier(s):\n", repository, len(p.Modules), len(p.Tiers))
|
||||
why := map[string]string{}
|
||||
for _, e := range packaging {
|
||||
why[e.Manifest.Module] = whyMoved(e, read[e.Manifest.Module], m)
|
||||
}
|
||||
if len(named) == 0 {
|
||||
for _, e := range from {
|
||||
why[e.Manifest.Module] = whyMoved(e, read[e.Manifest.Module], m)
|
||||
}
|
||||
}
|
||||
rolls := map[string]string{}
|
||||
for i, tier := range p.Tiers {
|
||||
fmt.Printf(" tier %d\n", i)
|
||||
@@ -1619,19 +1628,19 @@ func planWhatIf(ctx context.Context, inv *inventory.Inventory, repository string
|
||||
rolls[name] = how
|
||||
}
|
||||
fmt.Printf(" %-22s %s\n", name, how)
|
||||
reason := why[name]
|
||||
switch {
|
||||
case reason == "" && len(named) > 0 && named[name]:
|
||||
reason = "named"
|
||||
case reason == "":
|
||||
reason = "it stands on a module the merge moves"
|
||||
}
|
||||
fmt.Printf(" %-22s why: %s\n", "", reason)
|
||||
}
|
||||
}
|
||||
if hasCycle(p.Tiers, edges) {
|
||||
fmt.Println(" the last tier depends on itself and would be built together, in no order")
|
||||
}
|
||||
if len(packaging) > 0 {
|
||||
var also []string
|
||||
for _, e := range packaging {
|
||||
also = append(also, e.Manifest.Module)
|
||||
}
|
||||
fmt.Printf(" %s package source from %s, so they are rebuilt without their own source moving\n",
|
||||
strings.Join(also, ", "), repository)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user