Say why assign finds no module, and keep an assignment pending on its build

A merge asks for a new module's build, and assign answered "no module of that
name" until the build registered it, which read as a module nobody registered
(hq issue 325). Keep every build request, tell a build in flight, a module
known and not built, and an unknown name apart, and make an assignment made
while the build runs when the build registers the module.
This commit is contained in:
jochen
2026-10-08 16:38:11 +02:00
parent fe00fec52c
commit 7d63d2e68c
15 changed files with 1303 additions and 9 deletions
+9 -2
View File
@@ -337,8 +337,15 @@ func askTier(ctx context.Context, inv *inventory.Inventory, p *inventory.Plan) e
// askABuild is how a plan asks for one build, not waited for, and learns the id it asked under. A
// variable so a test of what a plan does around an ask needs no build machine.
var askABuild = func(ctx context.Context, source buildSource, path, ref string) (string, error) {
return buildOneAsked(ctx, source, path, ref, 0, false)
//
// Set in init, not where it is declared: an assignment pending on a build asks for one too (novox/hq issue
// 325), and a build's outcome makes pending assignments, so the two refer to each other.
var askABuild func(ctx context.Context, source buildSource, path, ref string) (string, error)
func init() {
askABuild = func(ctx context.Context, source buildSource, path, ref string) (string, error) {
return buildOneAsked(ctx, source, path, ref, 0, false)
}
}
// askModule asks the build machine for one module of a plan and marks it asked, with the id it was