Catalog versions: fill the tag floor per module with no version, from the forge's Go tags
mesh-catalog.versions answered [] for mesh-sdk although the forge holds go/v0.1.12..v0.1.16: the first fill read only builder_versions, so a module the builder held nothing of was filled with nothing, and the once-only key closed it. The indexer now reads, for every module of the newest trunk revision the versions hold none of, every tag of its Go package from the seat git's verb tags (repository of its catalog entry, prefix the package's directory + "/v", "v" at the root), fills the highest as its version, at each start and each catalog revision kept, and raises call-unanswered after five minutes when the forge does not answer. Builds: design 47 G §412, A-490b, A-490c, A-490d, A-490e Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -491,7 +491,7 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
ix.Registry = registry
|
||||
named.Changed = ix.RemoveUnlisted
|
||||
// The first fill of the versions (design 47 G §372): at the start, and again at each catalog revision kept until it is made.
|
||||
fill := &versionsFill{ix: ix, ctx: ctx, ask: versionsVia(calls.CallKeptWhileOpen, ix.ModuleInNewestView, logger.Printf), logf: logger.Printf}
|
||||
fill := &versionsFill{ix: ix, ctx: ctx, ask: versionsVia(calls.CallKeptWhileOpen, ix.ModuleInNewestView, logger.Printf), tags: tagsVia(calls.CallKept), logf: logger.Printf}
|
||||
fillFollow.Store(fill)
|
||||
fill.kick()
|
||||
ix.SeedModules = func(ctx context.Context) ([]index.SeedModule, error) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@@ -12,10 +13,12 @@ import (
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/go/seats/meshmoduleassigner"
|
||||
"git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/git"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshbuilds"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildgo"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/trunk"
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
|
||||
"mesh-delivery-indexer/internal/index"
|
||||
@@ -190,6 +193,7 @@ type versionsFill struct {
|
||||
ix *index.Indexer
|
||||
ctx context.Context
|
||||
ask index.VersionsAsker
|
||||
tags index.TagsReader // the tag floor's reader (A-490d); nil fills none
|
||||
logf func(string, ...any)
|
||||
}
|
||||
|
||||
@@ -197,6 +201,14 @@ func (f *versionsFill) kick() {
|
||||
go func() {
|
||||
if err := f.ix.FillVersions(f.ctx, f.ask); err != nil {
|
||||
f.logf("versions: the first fill waits: %v", err)
|
||||
return
|
||||
}
|
||||
// The tag floor, per module the versions hold none of, at every start and every revision (A-490d): the builder's half
|
||||
// is done once; this half is not.
|
||||
if f.tags != nil {
|
||||
if err := f.ix.FillTagFloors(f.ctx, f.tags); err != nil {
|
||||
f.logf("versions: the tag floor waits: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
@@ -266,3 +278,25 @@ func runningWholeVia(js jetstream.JetStream) index.RunningReader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// tagsVia reads every tag of a repository that starts with a prefix from the seat git's verb tags as a kept call, page by
|
||||
// page until none is more (design 47 G §412, A-490c: protected or not).
|
||||
func tagsVia(call toolCaller) index.TagsReader {
|
||||
return func(_ context.Context, repository, prefix string) ([]string, error) {
|
||||
var out []string
|
||||
for page := int64(1); ; page++ {
|
||||
var a git.TagsAnswer
|
||||
in := git.TagsInput{Repository: trunk.RepositoryName(repository), Prefix: prefix, Page: page}
|
||||
if !strings.Contains(in.Repository, "/") {
|
||||
return nil, fmt.Errorf("%q is not <owner>/<name>", repository)
|
||||
}
|
||||
if err := askGit(call, git.VerbTags, in, &a); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, a.Tags...)
|
||||
if !a.More {
|
||||
return out, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user