Manifests of the builder, the view and the forge bridge: the package artifacts are read by their tests; the merge's duplicate keys (tools, invokes) joined into one (D-10, D-0; issue 1966)

This commit is contained in:
2026-11-05 14:35:45 +01:00
parent 830e265bd0
commit 530a4ddfde
5 changed files with 27 additions and 11 deletions
@@ -33,6 +33,8 @@ type artifact struct {
From string `json:"from"`
Binary string `json:"binary"`
Loads []string `json:"loads"`
Paths []string `json:"paths"`
Series string `json:"series"`
}
type manifest struct {
@@ -196,8 +198,12 @@ func TestManifestProcess(t *testing.T) { // 1607/AC1
if _, bus := p["bus"]; bus {
t.Errorf("the process declares a bus: it runs on its own broker credential")
}
if len(m.Build.Artifacts) != 2 {
t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts)
if len(m.Build.Artifacts) != 3 {
t.Fatalf("artifacts = %+v, want the program, the tools and the package builds", m.Build.Artifacts)
}
// ADR 0634 §1, ADR 0606 §4: the module's own package is published, so a module of another repository imports it by version.
if a := m.Build.Artifacts[2]; a.Name != "builds" || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{"builds"}) || a.Series != "0.1" {
t.Errorf("package artifact = %+v", a)
}
if a := m.Build.Artifacts[1]; a.Name != "tools" || a.Kind != "bundle" || a.Binary != "mesh-delivery-builder-tools" || !reflect.DeepEqual(a.Loads, []string{"mesh-delivery-builder-tools"}) {
t.Errorf("tools artifact = %+v", a) // 1945
@@ -35,6 +35,8 @@ type artifact struct {
From string `json:"from"`
Binary string `json:"binary"`
Loads []string `json:"loads"`
Paths []string `json:"paths"`
Series string `json:"series"`
}
type manifest struct {
@@ -150,8 +152,12 @@ func TestManifestProcess(t *testing.T) { // 1235/AC1
if _, bus := p["bus"]; bus {
t.Errorf("the process declares a bus: it runs on its own broker credential")
}
if len(m.Build.Artifacts) != 2 || m.Build.Artifacts[1].Name != "tools" || m.Build.Artifacts[1].From != "cmd/mesh-delivery-forge-bridge-tools" {
t.Fatalf("artifacts = %+v, want the program and the tools bundle", m.Build.Artifacts)
if len(m.Build.Artifacts) != 3 || m.Build.Artifacts[1].Name != "tools" || m.Build.Artifacts[1].From != "cmd/mesh-delivery-forge-bridge-tools" {
t.Fatalf("artifacts = %+v, want the program, the tools bundle and the package forgemsg", m.Build.Artifacts)
}
// ADR 0573 §1: the gate requires forgemsg by a published version, so the module declares it as a package.
if a := m.Build.Artifacts[2]; a.Name != "forgemsg" || a.Kind != "package" || a.Language != "go" || len(a.Paths) != 1 || a.Paths[0] != "forgemsg" || a.Series != "0.1" {
t.Errorf("package artifact = %+v", a)
}
a := m.Build.Artifacts[0]
if st, err := os.Stat(a.From); err != nil || !st.IsDir() || a.Binary != "mesh-delivery-forge-bridge" || !strings.HasSuffix(a.From, a.Binary) {
@@ -2,9 +2,6 @@
"module": "mesh-delivery-forge-bridge",
"version": "1",
"slug": "forge-bridge",
"tools": [
"bridge_tags"
],
"consumes": [
"gitea.pull.updated",
"gitea.pull.merged",
@@ -21,6 +18,7 @@
{ "name": "end-asks", "history": 1 }
],
"tools": [
"bridge_tags",
"bridge_groups",
"bridge_group_end_again",
"bridge_merged_message"
+9 -1
View File
@@ -29,6 +29,8 @@ type artifact struct {
From string `json:"from"`
Binary string `json:"binary"`
Loads []string `json:"loads"`
Paths []string `json:"paths"`
Series string `json:"series"`
Context *struct {
Repository string `json:"repository"`
} `json:"context"`
@@ -150,13 +152,19 @@ func TestManifestIsTakenAndReadsOnly(t *testing.T) { // 1134/AC7
func TestManifestIsWholeInItsRepository(t *testing.T) { // 1134/AC7
m, _ := load(t)
if len(m.Build.Artifacts) != 4 {
if len(m.Build.Artifacts) != 5 {
t.Fatalf("artifacts = %+v", m.Build.Artifacts)
}
for _, a := range m.Build.Artifacts {
if a.Name == "files" {
continue
}
if a.Name == "viewstate" { // ADR 0634 §1: the module's own package, published for the gate
if a.Kind != "package" || a.Language != "go" || len(a.Paths) != 1 || a.Paths[0] != "viewstate" || a.Series != "0.1" {
t.Errorf("package artifact = %+v", a)
}
continue
}
if a.Context != nil {
t.Errorf("artifact %s names a context of another repository", a.Name)
}
+1 -3
View File
@@ -29,9 +29,6 @@
"view_first_view_again",
"node_manifest_reads"
],
"invokes": [
"mesh-delivery-indexer.indexer_pending"
],
"emits": [
"delivered",
"moving",
@@ -61,6 +58,7 @@
"mesh-delivery-indexer.indexer_read_config_candidates",
"mesh-delivery-indexer.indexer_read_graph",
"mesh-delivery-indexer.indexer_read_heard",
"mesh-delivery-indexer.indexer_pending",
"mesh-delivery-indexer.indexer_read_modules",
"mesh-delivery-indexer.indexer_read_packages",
"mesh-delivery-indexer.indexer_read_predefined",