A module value carries the source revision at which its fingerprint last changed, a have says what the node keeps as it runs for a manifest that does not yet say it, and a want names a release only beside the yes it gave (ADR 0601 §1, §4; review round 1)
This commit is contained in:
@@ -234,6 +234,8 @@ func (w Want) check() error {
|
||||
if err := checkDigest(w.Yes, "the digest a want's yes allows"); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if w.Release != "" {
|
||||
return fmt.Errorf("delivery: the want of %s names the release %s and no yes it gave", w.FP, w.Release)
|
||||
}
|
||||
switch w.Backup {
|
||||
case "", BackupAgain, BackupSkip:
|
||||
|
||||
@@ -356,6 +356,10 @@ type Have struct {
|
||||
// release that carries the new build answers the yes. False when a setting or a secret changed too, or the node could
|
||||
// not tell: the move is then asked of a person as before.
|
||||
BuildAlone bool `json:"build-alone,omitempty"`
|
||||
// Kept says, in words, what the node keeps of the module as it runs because its manifest does not yet say what shared
|
||||
// code no longer infers (that it is the tool runner, that its own secrets are the core's credentials; novox/hq ADR 0601
|
||||
// §4): the watchman raises a condition from it, cleared once the have says none. Empty in every other have.
|
||||
Kept []string `json:"kept,omitempty"`
|
||||
// Sealed is, for a module the node composes itself, each value its running composition carries sealed to the node's
|
||||
// key (a secret, a credential, a vault box), as applied (ADR 0547 §3, issue 1126): what the node's composer reuses
|
||||
// after a restart while it opens to the vault's value, so a value sealed again moves no composition. Openable by the
|
||||
|
||||
@@ -388,6 +388,12 @@ func testPhaseHealthRefused(t *testing.T) {
|
||||
} else if back, err := DecodeHave(raw); err != nil || !back.BuildAlone {
|
||||
t.Errorf("a have waiting for a yes to its build alone came back %+v, %v", back, err)
|
||||
}
|
||||
// ADR 0601 §4: what the node keeps as it runs, read back as said.
|
||||
if raw, err := EncodeHave(Have{Phase: PhaseRunning, Health: HealthOK, Kept: []string{"runs the tool runner"}}); err != nil {
|
||||
t.Errorf("a have keeping what runs: %v", err)
|
||||
} else if back, err := DecodeHave(raw); err != nil || len(back.Kept) != 1 {
|
||||
t.Errorf("a have keeping what runs came back %+v, %v", back, err)
|
||||
}
|
||||
for name, h := range map[string]Have{
|
||||
"running build alone": {Phase: PhaseRunning, Health: HealthOK, BuildAlone: true},
|
||||
"neither judged": {Phase: PhaseWaitingYes, Health: HealthOK, Judgement: JudgedNeither, Waits: waits.Waits},
|
||||
|
||||
@@ -404,10 +404,15 @@ type Module struct {
|
||||
Manifest string `json:"manifest,omitempty"`
|
||||
// Inputs2 are the new-form inputs the merge gave the module, kept so the indexer computes FP2 again when a build
|
||||
// module's toolchain versions appear, with no merge (novox/hq ADR 0465 clause 2). It needs Manifest.
|
||||
Inputs2 *KeptInputs2 `json:"inputs2,omitempty"`
|
||||
Src uint64 `json:"src,omitempty"`
|
||||
Repository string `json:"repository"`
|
||||
Commit string `json:"commit"`
|
||||
Inputs2 *KeptInputs2 `json:"inputs2,omitempty"`
|
||||
Src uint64 `json:"src,omitempty"`
|
||||
// FPSrc is the source revision at which FP2 last changed (novox/hq ADR 0601 §1): Src when a merge of the module's own
|
||||
// repository moved it, the source revision of the moment when a recompute with no such merge moved it (a toolchain,
|
||||
// a package, a base). The release that moved the source to it is the one that carries the build; 0 is not known, and
|
||||
// no release is taken to carry it. Src and Commit stay where the module was last merged and say nothing of that.
|
||||
FPSrc uint64 `json:"fp-src,omitempty"`
|
||||
Repository string `json:"repository"`
|
||||
Commit string `json:"commit"`
|
||||
// Path is the module's directory in its repository, trimmed of slashes, and RootPath (".") when its manifest is the
|
||||
// repository's root (novox/hq ADR 0478 clause 9, issue 1615): the build tools need it. Empty means not known: a value
|
||||
// written before the indexer learned paths has none.
|
||||
|
||||
@@ -179,7 +179,7 @@ func TestSourceValuesRoundTrip(t *testing.T) { // 1200/AC3
|
||||
t.Errorf("candidate round trip: %+v %v", got, err)
|
||||
}
|
||||
for _, m := range []Module{
|
||||
{FP: "src1:abc", Src: 5, Repository: "novox/mesh-sdk", Commit: "cccc"},
|
||||
{FP: "src1:abc", Src: 5, FPSrc: 5, Repository: "novox/mesh-sdk", Commit: "cccc"},
|
||||
{None: "a build that resolves packages when built", Repository: "novox/mesh-sdk", Commit: "cccc"},
|
||||
} {
|
||||
data, err = EncodeModule(m)
|
||||
|
||||
@@ -46,6 +46,7 @@ func TestAWantNamesItsComposition(t *testing.T) {
|
||||
{Want{FP: fp2of('a'), Self: true, Yes: "sha256:12"}, "a want's yes allows"},
|
||||
{Want{Removed: true, Self: true}, "removed want names no"},
|
||||
{Want{Removed: true, Release: "feat/l3b-bus"}, "removed want names no"},
|
||||
{Want{FP: fp2of('a'), Self: true, Release: "feat/l3b-bus"}, "and no yes it gave"},
|
||||
{Want{FP: fp2of('a'), Composed: "sha256:12"}, "not sha256"},
|
||||
{Want{Removed: true, Composed: hashOf('1')}, "removed want names no"},
|
||||
{Want{FP: fp2of('a'), Composed: hashOf('1'), Backup: "later"}, `backup answer "later"`},
|
||||
|
||||
Reference in New Issue
Block a user