The indexer gives a candidate's touched module the fingerprint its merge preview gives it, and wakes on the checker's preview.written without a restart; pin mesh-sdk to the R4c-5a head (issues 1445, 1681)
This commit is contained in:
@@ -23,12 +23,13 @@ type judgeDeps struct {
|
||||
kept check.KV
|
||||
previews check.KV
|
||||
repos *repoModules
|
||||
announce func(ctx context.Context, key string)
|
||||
logf func(format string, args ...any)
|
||||
}
|
||||
|
||||
func newJudge(d judgeDeps) check.Judge {
|
||||
return &check.Examiner{Steps: d.runner, Toolchains: d.tools, Presence: d.presence, Health: d.have, Places: d.places,
|
||||
Kept: check.Kept{Store: d.kept}, Previews: d.previews, Modules: d.repos, Trunks: d.trunks, Logf: d.logf}
|
||||
Kept: check.Kept{Store: d.kept}, Previews: d.previews, Modules: d.repos, Announce: d.announce, Trunks: d.trunks, Logf: d.logf}
|
||||
}
|
||||
|
||||
// manifestKV reads a manifest by its digest.
|
||||
|
||||
@@ -32,6 +32,10 @@ import (
|
||||
"mesh-delivery-checker/internal/check"
|
||||
)
|
||||
|
||||
// previewWrittenSubject is the subject of the checker's preview.written event, on its stream previews (the bus names the
|
||||
// stream PREVIEWS); the indexer's watch of the previews bucket is woken by it.
|
||||
const previewWrittenSubject = "mesh.stream." + delivery.CheckerModule + ".event.preview.written"
|
||||
|
||||
const (
|
||||
// defaultStepBound is how long the checker waits for one step of a build module (a fetch downloads the Go modules, a
|
||||
// test level runs a repository's tests).
|
||||
@@ -197,6 +201,12 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
runner: runner, tools: tools, presence: presence, have: have, places: places, trunks: trunks,
|
||||
kept: kvStore{buckets[delivery.CheckerKeptBucket]}, previews: kvStore{buckets[delivery.PreviewsBucket]},
|
||||
repos: repos, logf: logger.Printf,
|
||||
announce: func(ctx context.Context, key string) {
|
||||
body, _ := json.Marshal(map[string]string{"key": key})
|
||||
if _, err := js.Publish(ctx, previewWrittenSubject, body); err != nil {
|
||||
logger.Printf("previews.%s was written and the indexer could not be told: %v", key, err)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
// The toolchains first, so a check that starts from the first candidate finds the nodes.
|
||||
|
||||
Reference in New Issue
Block a user