Runner: a module's marks are checked once against all its bundles (A-398)
Live on novox every gitea tool was refused: each of gitea's eight bundles overwrote the gate's registered set, so the last one, which does not carry gitea_branch_protection_loosen, made the mark unserved.
This commit is contained in:
@@ -399,6 +399,7 @@ func (r *runner) claimed() map[string]bool {
|
||||
func (r *runner) load(s Served) *loadedModule {
|
||||
l := &loadedModule{served: s, seen: map[string]string{}}
|
||||
claimed := r.claimed()
|
||||
var all []launch.Registration // every bundle's registrations, the module's marks checked against them together (A-398)
|
||||
for _, entry := range s.Entrypoints {
|
||||
path, _ := filepath.Abs(entry)
|
||||
module := s.Module
|
||||
@@ -429,13 +430,7 @@ func (r *runner) load(s Served) *loadedModule {
|
||||
fail(clashed)
|
||||
continue
|
||||
}
|
||||
// A bundle whose marks name a tool it does not register is not loaded: no tool of its module is served here, rather
|
||||
// than one served unmarked that the manifest meant to mark (design 46 7-approval-mark §4).
|
||||
if unserved := r.unservedMarks(module, child.Registrations); len(unserved) > 0 {
|
||||
child.Stop()
|
||||
fail(fmt.Sprintf("its marks name %s, which it does not register (design 46 7-approval-mark §4)", strings.Join(unserved, ", ")))
|
||||
continue
|
||||
}
|
||||
all = append(all, child.Registrations...)
|
||||
l.children = append(l.children, child.Stop)
|
||||
for _, reg := range child.Registrations {
|
||||
got := registration{module: reg.Module, owner: module, tools: reg.Tools}
|
||||
@@ -449,6 +444,18 @@ func (r *runner) load(s Served) *loadedModule {
|
||||
}
|
||||
}
|
||||
}
|
||||
// A module whose marks name a tool none of its bundles registers is not loaded: no tool of it is served here, rather
|
||||
// than one served unmarked that the manifest meant to mark (design 46 7-approval-mark §4). Checked once, against every
|
||||
// bundle of the module together (lead answer A-398: gitea's eight bundles each overwrote the gate's set).
|
||||
if unserved := r.unservedMarks(s.Module, all); len(unserved) > 0 {
|
||||
for _, stop := range l.children {
|
||||
stop()
|
||||
}
|
||||
l.children, l.regs, l.own = nil, nil, nil
|
||||
l.failed = fmt.Sprintf("its marks name %s, which none of its bundles registers (design 46 7-approval-mark §4)", strings.Join(unserved, ", "))
|
||||
r.logf("[mesh-tools] %s is not loaded: %s; its tools are not served here", s.Module, l.failed)
|
||||
return l
|
||||
}
|
||||
if repairs := r.repairsOf(s.Module); repairs != nil {
|
||||
l.regs, l.own = append(l.regs, *repairs), append(l.own, *repairs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user