Review of issue 977: keep the plan's own order for its gates, hold a group only for a composed mesh-delivery, keep mark-ready one release, compare with the batch's start, fail a lone cycle (issue 977)

This commit is contained in:
2026-10-17 21:37:37 +02:00
parent aac4bae5a4
commit 07b050790e
14 changed files with 259 additions and 24 deletions
+27 -2
View File
@@ -13,6 +13,7 @@ import (
"time"
"github.com/novox/mesh-controller/internal/catalogue"
"github.com/novox/mesh-controller/internal/inventory"
"github.com/novox/mesh-controller/internal/link"
)
@@ -28,6 +29,9 @@ type changeSource struct {
Paths []string
Truncated bool
Removed []string
// Since is the first commit of the repository in the change, when the change is several merges: what it replaced
// is the first parent of that one, so a verb an earlier merge added is added by the change too.
Since string
}
// manifestAt reads a repository's module.json at a ref from the forge; the bool says it exists there. A variable so a
@@ -206,7 +210,11 @@ func changesOf(ctx context.Context, sources []changeSource) (map[string]moduleCh
}
old := s.Old
if old == "" {
if old, err = parentOf(ctx, s.Owner, s.Repo, s.New); err != nil {
first := s.Since
if first == "" {
first = s.New
}
if old, err = parentOf(ctx, s.Owner, s.Repo, first); err != nil {
return nil, err
}
}
@@ -230,11 +238,28 @@ func changesOf(ctx context.Context, sources []changeSource) (map[string]moduleCh
return out, nil
}
// truncatedPaths are the manifests a change that names only a beginning of its files is read as changing: those of the
// modules it moves that are built from its repository. Said, never skipped: no edge may be lost to a long list.
func truncatedPaths(entries []inventory.Entry, owner, repo string, moved []string) []string {
var out []string
for _, e := range entries {
if slices.Contains(moved, e.Manifest.Module) && sameRepository(e.Source.Repository, link.SourceMoved{Owner: owner, Repo: repo}) {
out = append(out, path.Join(strings.Trim(e.Source.Path, "/"), moduleManifestFile))
}
}
fmt.Printf(" %s/%s changed more files than were listed: the manifests of its modules (%s) are read as changed\n",
owner, repo, strings.Join(out, ", "))
return out
}
// changeSourcesOf are a group's members as changes to read: each head over what its pull request merges into.
func changeSourcesOf(members []orderMember) []changeSource {
func changeSourcesOf(members []orderMember, entries []inventory.Entry, reach map[string]orderReach) []changeSource {
var out []changeSource
for _, m := range members {
p := m.pull()
if p.PathsTruncated {
p.Paths, p.PathsTruncated = truncatedPaths(entries, p.Owner, p.Repo, reach[m.ID].Moved), false
}
old := p.BaseSHA
if old == "" {
old = p.Base