Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c062d24dfb |
@@ -119,13 +119,6 @@ func TestManifest(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// H-A-186 (design 47 G §370): asks, which the gate, the teller and the view import, is a declared Go package of the
|
||||
// module, so every release publishes it; H-A-188: in the module's version series, 0.3.
|
||||
if !slices.ContainsFunc(m.Build.Artifacts, func(a catalogue.Artifact) bool {
|
||||
return a.Name == "asks" && a.Kind == catalogue.ArtifactPackage && a.Language == "go" && slices.Equal(a.Paths, []string{"asks"}) && a.Series == m.Version && m.Version == "0.3"
|
||||
}) {
|
||||
t.Errorf("artifacts = %+v, want the Go package asks of series 0.3, the module's", m.Build.Artifacts)
|
||||
}
|
||||
// ADR 0635 §5: its views family is its ordinary events, `views.<state>` among its emits, on no stream of its own.
|
||||
// The seat's four events are said on the seat's own subject (the seat's family), so the module keeps no stream for them
|
||||
// and lists none among its emits.
|
||||
|
||||
@@ -370,15 +370,6 @@
|
||||
"loads": [
|
||||
"mesh-delivery-assigner"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "asks",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"asks"
|
||||
],
|
||||
"series": "0.3"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// new-form fingerprint the indexer writes, dark, into its own build keys (builds.<module>.<fingerprint>), through the build
|
||||
// modules' fetch and build tools. Nothing reads its keys to deliver until release R4e. It serves no request subject and
|
||||
// holds no timer: every reaction is a watch or a bus event (ADR 0437 §8).
|
||||
// Design 47 H1, proof 2 once more: the importer half of the edge mesh-delivery-sdk to mesh-delivery-builder.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
||||
@@ -266,16 +266,10 @@ 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")
|
||||
}
|
||||
// H-A-186, design 47 G §370: a Go package another module imports is a declared package artifact of its module, so every
|
||||
// release publishes it: builds (ADR 0634 §1, ADR 0606 §4), imported by the build modules and the node-engine, and
|
||||
// buildrun, imported by the indexer, the view and the watchman.
|
||||
if len(m.Build.Artifacts) != 4 {
|
||||
t.Fatalf("artifacts = %+v, want the program, the tools and the packages builds and buildrun", m.Build.Artifacts)
|
||||
}
|
||||
for i, name := range []string{"builds", "buildrun"} {
|
||||
if a := m.Build.Artifacts[2+i]; a.Name != name || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{name}) || a.Series != "0.1" {
|
||||
t.Errorf("package artifact = %+v, want the Go package %s of series 0.1", a, name)
|
||||
}
|
||||
// Issue 1966's bootstrap: the package artifact builds is out of the manifest until the new builder runs; the follow-up
|
||||
// puts it back with its assertion (ADR 0634 §1, ADR 0606 §4: three artifacts, the third the package builds).
|
||||
if len(m.Build.Artifacts) != 2 {
|
||||
t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts)
|
||||
}
|
||||
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
|
||||
|
||||
@@ -334,24 +334,6 @@
|
||||
"loads": [
|
||||
"mesh-delivery-builder-tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "builds",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"builds"
|
||||
],
|
||||
"series": "0.1"
|
||||
},
|
||||
{
|
||||
"name": "buildrun",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"buildrun"
|
||||
],
|
||||
"series": "0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -187,13 +187,10 @@ 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) != 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, H-A-186 (design 47 G §370): the gate, the builder and the indexer import forgemsg, so the module declares
|
||||
// it as a package and every release publishes it.
|
||||
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)
|
||||
// Issue 1966's bootstrap: the package artifact forgemsg is out of the manifest until the new builder runs; the follow-up
|
||||
// puts it back with its assertion (ADR 0573 §1: three artifacts, the third the package forgemsg).
|
||||
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)
|
||||
}
|
||||
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) {
|
||||
|
||||
@@ -101,15 +101,6 @@
|
||||
"loads": [
|
||||
"mesh-delivery-forge-bridge-tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "forgemsg",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"forgemsg"
|
||||
],
|
||||
"series": "0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ type artifact struct {
|
||||
Binary string `json:"binary"`
|
||||
Loads []string `json:"loads"`
|
||||
Env map[string]string `json:"env"`
|
||||
Paths []string `json:"paths"`
|
||||
Series string `json:"series"`
|
||||
}
|
||||
|
||||
type stream struct {
|
||||
@@ -346,12 +344,8 @@ func TestManifestProcess(t *testing.T) { // 1238/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) != 3 {
|
||||
t.Fatalf("artifacts = %+v, want the program, the tools and the package takein", m.Build.Artifacts)
|
||||
}
|
||||
// H-A-186 (design 47 G §370): takein, which the gate, the view and the watchman import, is a declared package.
|
||||
if a := m.Build.Artifacts[2]; a.Name != "takein" || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{"takein"}) || a.Series != "0.1" {
|
||||
t.Errorf("package artifact = %+v", a)
|
||||
if len(m.Build.Artifacts) != 2 {
|
||||
t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts)
|
||||
}
|
||||
if a := m.Build.Artifacts[1]; a.Name != "tools" || a.Kind != "bundle" || a.Binary != "mesh-delivery-indexer-tools" || !reflect.DeepEqual(a.Loads, []string{"mesh-delivery-indexer-tools"}) {
|
||||
t.Errorf("tools artifact = %+v", a) // 1945
|
||||
|
||||
@@ -223,15 +223,6 @@
|
||||
"loads": [
|
||||
"mesh-delivery-indexer-tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "takein",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"takein"
|
||||
],
|
||||
"series": "0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -38,12 +38,9 @@ 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 {
|
||||
Packages map[string]string `json:"packages"`
|
||||
Module string `json:"module"`
|
||||
Version string `json:"version"`
|
||||
Slug string `json:"slug"`
|
||||
@@ -179,16 +176,8 @@ func TestManifestProcess(t *testing.T) { // 1240/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) != 3 {
|
||||
t.Fatalf("artifacts = %+v, want the program, the tools and the package tellerevents", m.Build.Artifacts)
|
||||
}
|
||||
// H-A-188: the assigner is at 0.3, so its package asks, which this module imports, is accepted in that series.
|
||||
if got := m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks"]; got != "0.3" || len(m.Packages) != 1 {
|
||||
t.Errorf("packages = %v, want asks accepted in the assigner's series 0.3", m.Packages)
|
||||
}
|
||||
// H-A-186 (design 47 G §370): tellerevents, which the assigner imports, is a declared package.
|
||||
if a := m.Build.Artifacts[2]; a.Name != "tellerevents" || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{"tellerevents"}) || a.Series != "0.1" {
|
||||
t.Errorf("package artifact = %+v", a)
|
||||
if len(m.Build.Artifacts) != 2 {
|
||||
t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts)
|
||||
}
|
||||
a := m.Build.Artifacts[0]
|
||||
if st, err := os.Stat(a.From); err != nil || !st.IsDir() || a.Binary != "mesh-delivery-teller" || !strings.HasSuffix(a.From, a.Binary) {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"module": "mesh-delivery-teller",
|
||||
"version": "0.1",
|
||||
"packages": {
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks": "0.3"
|
||||
},
|
||||
"slug": "teller",
|
||||
"tools": [
|
||||
"teller_end_ask",
|
||||
@@ -126,15 +123,6 @@
|
||||
"loads": [
|
||||
"mesh-delivery-teller-tools"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tellerevents",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"tellerevents"
|
||||
],
|
||||
"series": "0.1"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -70,7 +70,6 @@ type claim struct {
|
||||
}
|
||||
|
||||
type manifest struct {
|
||||
Packages map[string]string `json:"packages"`
|
||||
Claims []claim `json:"claims"`
|
||||
State []state `json:"state"`
|
||||
Module string `json:"module"`
|
||||
@@ -314,12 +313,9 @@ func TestManifestIsTakenAndReadsOnly(t *testing.T) { // 1134/AC7
|
||||
|
||||
func TestManifestIsWholeInItsRepository(t *testing.T) { // 1134/AC7
|
||||
m, _ := load(t)
|
||||
// H-A-188: the assigner is at 0.3, so its package asks, which this module imports, is accepted in that series.
|
||||
if got := m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks"]; got != "0.3" || len(m.Packages) != 1 {
|
||||
t.Errorf("packages = %v, want asks accepted in the assigner's series 0.3", m.Packages)
|
||||
}
|
||||
// H-A-186 (design 47 G §370): viewstate, which the gate, the assigner and the teller import, is a declared package.
|
||||
if len(m.Build.Artifacts) != 5 || m.Build.Artifacts[4].Name != "viewstate" {
|
||||
// Issue 1966's bootstrap: the package artifact viewstate is out of the manifest until the new builder runs; the
|
||||
// follow-up puts the count back at 5.
|
||||
if len(m.Build.Artifacts) != 4 {
|
||||
t.Fatalf("artifacts = %+v", m.Build.Artifacts)
|
||||
}
|
||||
for _, a := range m.Build.Artifacts {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"module": "mesh-delivery-view",
|
||||
"version": "0.1",
|
||||
"packages": {
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks": "0.3"
|
||||
},
|
||||
"moved": true,
|
||||
"slug": "view",
|
||||
"tools": [
|
||||
@@ -237,15 +234,6 @@
|
||||
"name": "files",
|
||||
"kind": "archive",
|
||||
"from": "files"
|
||||
},
|
||||
{
|
||||
"name": "viewstate",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"viewstate"
|
||||
],
|
||||
"series": "0.1"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -648,17 +648,6 @@ func TestGrants(t *testing.T) {
|
||||
if _, ok := m.OwnSecrets["broker"]; !ok || len(m.OwnSecrets) != 1 || m.SecretsOwner != "mesh-grants" {
|
||||
t.Errorf("own-secrets %v owner %q: a credential of its own, broker", m.OwnSecrets, m.SecretsOwner)
|
||||
}
|
||||
// H-A-186 (design 47 G §370): grantsstate (imported by the assigner, the vault and the node-engine) and busgrants
|
||||
// (imported by the bus module and the watchman) are declared Go packages of the module, so every release publishes them.
|
||||
var packages []string
|
||||
for _, a := range m.Build.Artifacts {
|
||||
if a.Kind == catalogue.ArtifactPackage && a.Language == "go" && len(a.Paths) == 1 && a.Paths[0] == a.Name && a.Series == "0.1" {
|
||||
packages = append(packages, a.Name)
|
||||
}
|
||||
}
|
||||
if !slices.Equal(packages, []string{"grantsstate", "busgrants"}) {
|
||||
t.Errorf("Go packages %v, want grantsstate and busgrants of series 0.1", packages)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("no timer, no update or delete, a publish only of conditions, a create only of declared streams", func(t *testing.T) {
|
||||
|
||||
@@ -185,24 +185,6 @@
|
||||
"loads": [
|
||||
"mesh-grants"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "grantsstate",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"grantsstate"
|
||||
],
|
||||
"series": "0.1"
|
||||
},
|
||||
{
|
||||
"name": "busgrants",
|
||||
"kind": "package",
|
||||
"language": "go",
|
||||
"paths": [
|
||||
"busgrants"
|
||||
],
|
||||
"series": "0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user