Design 47 H1: the pipeline-runner seat names a pipeline's key and its subjects by revision
A pipeline is keyed by its catalog revision's number, so the seat's key form is <branch>.<revision> (the generated PipelinesByBranchRevisionKey and its siblings; the fixtures follow), and pipeline-started, pipeline-ended, wait-held and wait-ended are said on <branch>.<revision>, carrying the same number as the key; every reader takes the body. The client's SourceSubject is RevisionSubject. The published key form, under which pipelines were kept before, stays. Builds: design 47 H H-A-213 (4), H-A-219, H-A-221
This commit is contained in:
@@ -17,8 +17,9 @@ import (
|
|||||||
// eventPrefix starts every event subject of the seat.
|
// eventPrefix starts every event subject of the seat.
|
||||||
const eventPrefix = "mesh.seat." + seat.Seat + ".event."
|
const eventPrefix = "mesh.seat." + seat.Seat + ".event."
|
||||||
|
|
||||||
// perSource are the events said per source revision, on <event>.<branch>.<source> (design 47 H §746, H-A-72 (3)).
|
// perRevision are the events said per pipeline, on <event>.<branch>.<revision>, its catalog revision's number as its key
|
||||||
var perSource = []string{seat.EventPipelineStarted, seat.EventPipelineEnded, seat.EventWaitHeld, seat.EventWaitEnded}
|
// names it (design 47 H §746, H-A-72 (3), H-A-221).
|
||||||
|
var perRevision = []string{seat.EventPipelineStarted, seat.EventPipelineEnded, seat.EventWaitHeld, seat.EventWaitEnded}
|
||||||
|
|
||||||
// Subject is where the runner says a step's event or a run's start: mesh.seat.mesh-pipeline-runner.event.<event>.
|
// Subject is where the runner says a step's event or a run's start: mesh.seat.mesh-pipeline-runner.event.<event>.
|
||||||
// <module>.<branch>.<commit>, each name escaped as a key's name is, so a branch holding a dot is one token (design 47 H
|
// <module>.<branch>.<commit>, each name escaped as a key's name is, so a branch holding a dot is one token (design 47 H
|
||||||
@@ -27,41 +28,42 @@ func Subject(event, module, branch, commit string) string {
|
|||||||
return eventPrefix + event + "." + keys.EscapeName(module) + "." + keys.EscapeName(branch) + "." + keys.EscapeName(commit)
|
return eventPrefix + event + "." + keys.EscapeName(module) + "." + keys.EscapeName(branch) + "." + keys.EscapeName(commit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SourceSubject is where the runner says a pipeline's start and end and its waits: mesh.seat.mesh-pipeline-runner.
|
// RevisionSubject is where the runner says a pipeline's start and end and its waits: mesh.seat.mesh-pipeline-runner.
|
||||||
// event.<event>.<branch>.<source>, the branch escaped as a key's name is (design 47 H §746, H-A-72 (3)).
|
// event.<event>.<branch>.<revision>, the pipeline's catalog revision number, the branch escaped as a key's name is (design
|
||||||
func SourceSubject(event, branch string, source int64) string {
|
// 47 H §746, H-A-72 (3), H-A-221).
|
||||||
return eventPrefix + event + "." + keys.EscapeName(branch) + "." + strconv.FormatInt(source, 10)
|
func RevisionSubject(event, branch string, revision int64) string {
|
||||||
|
return eventPrefix + event + "." + keys.EscapeName(branch) + "." + strconv.FormatInt(revision, 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Of is what an event's subject names: a step's event or a run's start names the module, the branch and the commit; an
|
// Of is what an event's subject names: a step's event or a run's start names the module, the branch and the commit; an
|
||||||
// event per source revision names the branch and the source.
|
// event per pipeline names the branch and the pipeline's catalog revision (H-A-221).
|
||||||
type Of struct {
|
type Of struct {
|
||||||
Event, Module, Branch, Commit string
|
Event, Module, Branch, Commit string
|
||||||
Source int64
|
Revision int64
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse reads a subject Subject or SourceSubject built: an event of the seat's, and its names unescaped.
|
// Parse reads a subject Subject or RevisionSubject built: an event of the seat's, and its names unescaped.
|
||||||
func Parse(subject string) (Of, error) {
|
func Parse(subject string) (Of, error) {
|
||||||
rest, ok := strings.CutPrefix(subject, eventPrefix)
|
rest, ok := strings.CutPrefix(subject, eventPrefix)
|
||||||
toks := strings.Split(rest, ".")
|
toks := strings.Split(rest, ".")
|
||||||
bySource := len(toks) > 0 && slices.Contains(perSource, toks[0])
|
byRevision := len(toks) > 0 && slices.Contains(perRevision, toks[0])
|
||||||
want := 4
|
want := 4
|
||||||
if bySource {
|
if byRevision {
|
||||||
want = 3
|
want = 3
|
||||||
}
|
}
|
||||||
if !ok || len(toks) != want || !slices.Contains(seat.Events(), toks[0]) {
|
if !ok || len(toks) != want || !slices.Contains(seat.Events(), toks[0]) {
|
||||||
return Of{}, fmt.Errorf("meshpipelinerunnerclient: %q is no event subject of the seat %s", subject, seat.Seat)
|
return Of{}, fmt.Errorf("meshpipelinerunnerclient: %q is no event subject of the seat %s", subject, seat.Seat)
|
||||||
}
|
}
|
||||||
if bySource {
|
if byRevision {
|
||||||
branch, err := keys.UnescapeName(toks[1])
|
branch, err := keys.UnescapeName(toks[1])
|
||||||
if err != nil || branch == "" {
|
if err != nil || branch == "" {
|
||||||
return Of{}, fmt.Errorf("meshpipelinerunnerclient: %q: branch: %v", subject, err)
|
return Of{}, fmt.Errorf("meshpipelinerunnerclient: %q: branch: %v", subject, err)
|
||||||
}
|
}
|
||||||
source, err := strconv.ParseInt(toks[2], 10, 64)
|
revision, err := strconv.ParseInt(toks[2], 10, 64)
|
||||||
if err != nil || source < 1 {
|
if err != nil || revision < 1 {
|
||||||
return Of{}, fmt.Errorf("meshpipelinerunnerclient: %q: no source revision", subject)
|
return Of{}, fmt.Errorf("meshpipelinerunnerclient: %q: no revision", subject)
|
||||||
}
|
}
|
||||||
return Of{Event: toks[0], Branch: branch, Source: source}, nil
|
return Of{Event: toks[0], Branch: branch, Revision: revision}, nil
|
||||||
}
|
}
|
||||||
names := make([]string, 0, 3)
|
names := make([]string, 0, 3)
|
||||||
for i, t := range toks[1:] {
|
for i, t := range toks[1:] {
|
||||||
|
|||||||
@@ -17,14 +17,14 @@ func TestSubjectsAndBodies(t *testing.T) {
|
|||||||
if of, err := Parse(s); err != nil || of != (Of{Event: seat.EventStepEnded, Module: "nats", Branch: "release.1", Commit: "c1"}) {
|
if of, err := Parse(s); err != nil || of != (Of{Event: seat.EventStepEnded, Module: "nats", Branch: "release.1", Commit: "c1"}) {
|
||||||
t.Errorf("parse %s: %+v, %v", s, of, err)
|
t.Errorf("parse %s: %+v, %v", s, of, err)
|
||||||
}
|
}
|
||||||
ps := SourceSubject(seat.EventPipelineEnded, "release.1", 3589)
|
ps := RevisionSubject(seat.EventPipelineEnded, "release.1", 3589)
|
||||||
if ps != "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.release=2e1.3589" {
|
if ps != "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.release=2e1.3589" {
|
||||||
t.Errorf("pipeline-ended subject %s", ps)
|
t.Errorf("pipeline-ended subject %s", ps)
|
||||||
}
|
}
|
||||||
if of, err := Parse(ps); err != nil || of != (Of{Event: seat.EventPipelineEnded, Branch: "release.1", Source: 3589}) {
|
if of, err := Parse(ps); err != nil || of != (Of{Event: seat.EventPipelineEnded, Branch: "release.1", Revision: 3589}) {
|
||||||
t.Errorf("parse %s: %+v, %v", ps, of, err)
|
t.Errorf("parse %s: %+v, %v", ps, of, err)
|
||||||
}
|
}
|
||||||
if of, err := Parse(SourceSubject(seat.EventWaitHeld, "main", 7)); err != nil || of.Source != 7 || of.Module != "" {
|
if of, err := Parse(RevisionSubject(seat.EventWaitHeld, "main", 7)); err != nil || of.Revision != 7 || of.Module != "" {
|
||||||
t.Errorf("wait-held: %+v, %v", of, err)
|
t.Errorf("wait-held: %+v, %v", of, err)
|
||||||
}
|
}
|
||||||
for _, bad := range []string{"not.an.event.subject",
|
for _, bad := range []string{"not.an.event.subject",
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ const (
|
|||||||
// StreamPipelineStarted is the stream pipeline-started is kept in.
|
// StreamPipelineStarted is the stream pipeline-started is kept in.
|
||||||
const StreamPipelineStarted = "SEAT_mesh-pipeline-runner_pipeline-started"
|
const StreamPipelineStarted = "SEAT_mesh-pipeline-runner_pipeline-started"
|
||||||
|
|
||||||
// SubjectPipelineStarted is where pipeline-started is published, on mesh.seat.mesh-pipeline-runner.event.pipeline-started.<branch>.<source>.
|
// SubjectPipelineStarted is where pipeline-started is published, on mesh.seat.mesh-pipeline-runner.event.pipeline-started.<branch>.<revision>.
|
||||||
func SubjectPipelineStarted(branch, source string) string {
|
func SubjectPipelineStarted(branch, revision string) string {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.pipeline-started." + branch + "." + source
|
return "mesh.seat.mesh-pipeline-runner.event.pipeline-started." + branch + "." + revision
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubjectPipelineStartedAll hears every pipeline-started.
|
// SubjectPipelineStartedAll hears every pipeline-started.
|
||||||
@@ -76,9 +76,9 @@ const SubjectPipelineStartedAll = "mesh.seat.mesh-pipeline-runner.event.pipeline
|
|||||||
// StreamPipelineEnded is the stream pipeline-ended is kept in.
|
// StreamPipelineEnded is the stream pipeline-ended is kept in.
|
||||||
const StreamPipelineEnded = "SEAT_mesh-pipeline-runner_pipeline-ended"
|
const StreamPipelineEnded = "SEAT_mesh-pipeline-runner_pipeline-ended"
|
||||||
|
|
||||||
// SubjectPipelineEnded is where pipeline-ended is published, on mesh.seat.mesh-pipeline-runner.event.pipeline-ended.<branch>.<source>.
|
// SubjectPipelineEnded is where pipeline-ended is published, on mesh.seat.mesh-pipeline-runner.event.pipeline-ended.<branch>.<revision>.
|
||||||
func SubjectPipelineEnded(branch, source string) string {
|
func SubjectPipelineEnded(branch, revision string) string {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.pipeline-ended." + branch + "." + source
|
return "mesh.seat.mesh-pipeline-runner.event.pipeline-ended." + branch + "." + revision
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubjectPipelineEndedAll hears every pipeline-ended.
|
// SubjectPipelineEndedAll hears every pipeline-ended.
|
||||||
@@ -120,9 +120,9 @@ const SubjectStepEndedAll = "mesh.seat.mesh-pipeline-runner.event.step-ended.*.*
|
|||||||
// StreamWaitHeld is the stream wait-held is kept in.
|
// StreamWaitHeld is the stream wait-held is kept in.
|
||||||
const StreamWaitHeld = "SEAT_mesh-pipeline-runner_wait-held"
|
const StreamWaitHeld = "SEAT_mesh-pipeline-runner_wait-held"
|
||||||
|
|
||||||
// SubjectWaitHeld is where wait-held is published, on mesh.seat.mesh-pipeline-runner.event.wait-held.<branch>.<source>.
|
// SubjectWaitHeld is where wait-held is published, on mesh.seat.mesh-pipeline-runner.event.wait-held.<branch>.<revision>.
|
||||||
func SubjectWaitHeld(branch, source string) string {
|
func SubjectWaitHeld(branch, revision string) string {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.wait-held." + branch + "." + source
|
return "mesh.seat.mesh-pipeline-runner.event.wait-held." + branch + "." + revision
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubjectWaitHeldAll hears every wait-held.
|
// SubjectWaitHeldAll hears every wait-held.
|
||||||
@@ -131,9 +131,9 @@ const SubjectWaitHeldAll = "mesh.seat.mesh-pipeline-runner.event.wait-held.*.*"
|
|||||||
// StreamWaitEnded is the stream wait-ended is kept in.
|
// StreamWaitEnded is the stream wait-ended is kept in.
|
||||||
const StreamWaitEnded = "SEAT_mesh-pipeline-runner_wait-ended"
|
const StreamWaitEnded = "SEAT_mesh-pipeline-runner_wait-ended"
|
||||||
|
|
||||||
// SubjectWaitEnded is where wait-ended is published, on mesh.seat.mesh-pipeline-runner.event.wait-ended.<branch>.<source>.
|
// SubjectWaitEnded is where wait-ended is published, on mesh.seat.mesh-pipeline-runner.event.wait-ended.<branch>.<revision>.
|
||||||
func SubjectWaitEnded(branch, source string) string {
|
func SubjectWaitEnded(branch, revision string) string {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.wait-ended." + branch + "." + source
|
return "mesh.seat.mesh-pipeline-runner.event.wait-ended." + branch + "." + revision
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubjectWaitEndedAll hears every wait-ended.
|
// SubjectWaitEndedAll hears every wait-ended.
|
||||||
@@ -156,11 +156,11 @@ const (
|
|||||||
StateStepOutputs = "step-outputs"
|
StateStepOutputs = "step-outputs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PipelinesByBranchSourceKey is the key of one value of the state pipelines under the form "<branch>.<source>".
|
// PipelinesByBranchRevisionKey is the key of one value of the state pipelines under the form "<branch>.<revision>".
|
||||||
func PipelinesByBranchSourceKey(branch, source string) string { return branch + "." + source }
|
func PipelinesByBranchRevisionKey(branch, revision string) string { return branch + "." + revision }
|
||||||
|
|
||||||
// ParsePipelinesByBranchSourceKey reads the parts of a key of the form "<branch>.<source>", in the order of the form; the last result is false for a key of another form.
|
// ParsePipelinesByBranchRevisionKey reads the parts of a key of the form "<branch>.<revision>", in the order of the form; the last result is false for a key of another form.
|
||||||
func ParsePipelinesByBranchSourceKey(key string) (string, string, bool) {
|
func ParsePipelinesByBranchRevisionKey(key string) (string, string, bool) {
|
||||||
rest := key
|
rest := key
|
||||||
v0, after0, found0 := strings.Cut(rest, ".")
|
v0, after0, found0 := strings.Cut(rest, ".")
|
||||||
if !found0 || v0 == "" {
|
if !found0 || v0 == "" {
|
||||||
@@ -178,9 +178,9 @@ func ParsePipelinesByBranchSourceKey(key string) (string, string, bool) {
|
|||||||
return v0, v2, true
|
return v0, v2, true
|
||||||
}
|
}
|
||||||
|
|
||||||
// DecodePipelinesByBranchSourceValue reads one value of the state pipelines under the form "<branch>.<source>", refusing a field PipelinesByBranchSourceValue does not know and any text after the value.
|
// DecodePipelinesByBranchRevisionValue reads one value of the state pipelines under the form "<branch>.<revision>", refusing a field PipelinesByBranchRevisionValue does not know and any text after the value.
|
||||||
func DecodePipelinesByBranchSourceValue(raw []byte) (PipelinesByBranchSourceValue, error) {
|
func DecodePipelinesByBranchRevisionValue(raw []byte) (PipelinesByBranchRevisionValue, error) {
|
||||||
var v PipelinesByBranchSourceValue
|
var v PipelinesByBranchRevisionValue
|
||||||
dec := json.NewDecoder(bytes.NewReader(raw))
|
dec := json.NewDecoder(bytes.NewReader(raw))
|
||||||
dec.DisallowUnknownFields()
|
dec.DisallowUnknownFields()
|
||||||
if err := dec.Decode(&v); err != nil {
|
if err := dec.Decode(&v); err != nil {
|
||||||
@@ -670,7 +670,7 @@ type Pipeline struct {
|
|||||||
// the modules the pipeline moves, its take-in's entries (design 47 H §746)
|
// the modules the pipeline moves, its take-in's entries (design 47 H §746)
|
||||||
Movers []Mover `json:"movers"`
|
Movers []Mover `json:"movers"`
|
||||||
Outcome string `json:"outcome"`
|
Outcome string `json:"outcome"`
|
||||||
// the pipeline's key, <branch>.<source>, <branch>.<source>.published.<package>.<version> for a pipeline a publish started, or <branch>.run.<run> for a run on request; a branch escaped as a key's name is (design 47 H §746, §747; H-A-83)
|
// the pipeline's key, <branch>.<revision>, <branch>.<source>.published.<package>.<version> for a pipeline a publish started, or <branch>.run.<run> for a run on request; a branch escaped as a key's name is (design 47 H §746, §747; H-A-83)
|
||||||
Pipeline string `json:"pipeline"`
|
Pipeline string `json:"pipeline"`
|
||||||
// for a pipeline a package's publish started, that publish (A-202)
|
// for a pipeline a package's publish started, that publish (A-202)
|
||||||
Published *Published `json:"published,omitempty"`
|
Published *Published `json:"published,omitempty"`
|
||||||
@@ -720,7 +720,7 @@ type PipelineEnded struct {
|
|||||||
// per mover its fingerprint, released version, step results and tier, in the delivery order (design 47 H §746, H-A-2)
|
// per mover its fingerprint, released version, step results and tier, in the delivery order (design 47 H §746, H-A-2)
|
||||||
Movers []MoverEnded `json:"movers"`
|
Movers []MoverEnded `json:"movers"`
|
||||||
Outcome string `json:"outcome"`
|
Outcome string `json:"outcome"`
|
||||||
// the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
// the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
||||||
Pipeline string `json:"pipeline"`
|
Pipeline string `json:"pipeline"`
|
||||||
// the catalog graph revision of the branch the pipeline runs for
|
// the catalog graph revision of the branch the pipeline runs for
|
||||||
Revision int64 `json:"revision,omitempty"`
|
Revision int64 `json:"revision,omitempty"`
|
||||||
@@ -753,7 +753,7 @@ type PipelineStarted struct {
|
|||||||
Call string `json:"call,omitempty"`
|
Call string `json:"call,omitempty"`
|
||||||
// the pipeline's movers
|
// the pipeline's movers
|
||||||
Movers []Mover `json:"movers"`
|
Movers []Mover `json:"movers"`
|
||||||
// the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
// the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
||||||
Pipeline string `json:"pipeline"`
|
Pipeline string `json:"pipeline"`
|
||||||
// for a pipeline a package's publish started, that publish (A-202)
|
// for a pipeline a package's publish started, that publish (A-202)
|
||||||
Published *Published `json:"published,omitempty"`
|
Published *Published `json:"published,omitempty"`
|
||||||
@@ -814,7 +814,7 @@ type StepEvent struct {
|
|||||||
// the module's build-input fingerprint at the commit
|
// the module's build-input fingerprint at the commit
|
||||||
Fingerprint string `json:"fingerprint,omitempty"`
|
Fingerprint string `json:"fingerprint,omitempty"`
|
||||||
Module string `json:"module"`
|
Module string `json:"module"`
|
||||||
// the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
// the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
||||||
Pipeline string `json:"pipeline"`
|
Pipeline string `json:"pipeline"`
|
||||||
Result StepResult `json:"result"`
|
Result StepResult `json:"result"`
|
||||||
// the catalog graph revision of the branch the pipeline runs for
|
// the catalog graph revision of the branch the pipeline runs for
|
||||||
@@ -966,7 +966,7 @@ type ToolchainUsed struct {
|
|||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait is a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283); said on <branch>.<source> (design 47 H-A-72).
|
// Wait is a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283); said on <branch>.<revision> (design 47 H-A-72, H-A-221).
|
||||||
type Wait struct {
|
type Wait struct {
|
||||||
Artifact string `json:"artifact,omitempty"`
|
Artifact string `json:"artifact,omitempty"`
|
||||||
// the step's own ask, where it has one (design 47 G §731)
|
// the step's own ask, where it has one (design 47 G §731)
|
||||||
@@ -983,7 +983,7 @@ type Wait struct {
|
|||||||
Module string `json:"module,omitempty"`
|
Module string `json:"module,omitempty"`
|
||||||
// what the step waits on (design 47 *Health and going back*)
|
// what the step waits on (design 47 *Health and going back*)
|
||||||
On string `json:"on"`
|
On string `json:"on"`
|
||||||
// the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
// the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
||||||
Pipeline string `json:"pipeline"`
|
Pipeline string `json:"pipeline"`
|
||||||
// the catalog graph revision of the branch the pipeline runs for
|
// the catalog graph revision of the branch the pipeline runs for
|
||||||
Revision int64 `json:"revision,omitempty"`
|
Revision int64 `json:"revision,omitempty"`
|
||||||
@@ -1024,7 +1024,7 @@ const (
|
|||||||
|
|
||||||
// Waiting is a pipeline waiting its turn under pipelines-at-once (design 47 H §748, H-A-72).
|
// Waiting is a pipeline waiting its turn under pipelines-at-once (design 47 H §748, H-A-72).
|
||||||
type Waiting struct {
|
type Waiting struct {
|
||||||
// the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
// the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)
|
||||||
Pipeline string `json:"pipeline"`
|
Pipeline string `json:"pipeline"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1355,8 +1355,8 @@ type FullEvent = Fill
|
|||||||
// RoomEvent is the body of the event room.
|
// RoomEvent is the body of the event room.
|
||||||
type RoomEvent = Fill
|
type RoomEvent = Fill
|
||||||
|
|
||||||
// PipelinesByBranchSourceValue is one value of the state pipelines under the key <branch>.<source>.
|
// PipelinesByBranchRevisionValue is one value of the state pipelines under the key <branch>.<revision>.
|
||||||
type PipelinesByBranchSourceValue = Pipeline
|
type PipelinesByBranchRevisionValue = Pipeline
|
||||||
|
|
||||||
// PipelinesByBranchSourcePublishedPackageVersionValue is one value of the state pipelines under the key <branch>.<source>.published.<package>.<version>.
|
// PipelinesByBranchSourcePublishedPackageVersionValue is one value of the state pipelines under the key <branch>.<source>.published.<package>.<version>.
|
||||||
type PipelinesByBranchSourcePublishedPackageVersionValue = Pipeline
|
type PipelinesByBranchSourcePublishedPackageVersionValue = Pipeline
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ func TestFixtures(t *testing.T) {
|
|||||||
decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.step-ended\\.[^.*> ]+\\.[^.*> ]+\\.[^.*> ]+$")},
|
decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.step-ended\\.[^.*> ]+\\.[^.*> ]+\\.[^.*> ]+$")},
|
||||||
{name: "a take-in's pipeline kept, its steps naming their mover", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}",
|
{name: "a take-in's pipeline kept, its steps naming their mover", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}",
|
||||||
decode: func(b []byte) (any, error) {
|
decode: func(b []byte) (any, error) {
|
||||||
var v PipelinesByBranchSourceValue
|
var v PipelinesByBranchRevisionValue
|
||||||
err := json.Unmarshal(b, &v)
|
err := json.Unmarshal(b, &v)
|
||||||
return v, err
|
return v, err
|
||||||
}, subjectIs: nil},
|
}, subjectIs: nil},
|
||||||
@@ -73,13 +73,13 @@ func TestFixtures(t *testing.T) {
|
|||||||
}, subjectIs: nil},
|
}, subjectIs: nil},
|
||||||
{name: "a pipeline waiting its turn, its seq given", subject: "", given: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"v\":1}",
|
{name: "a pipeline waiting its turn, its seq given", subject: "", given: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"v\":1}",
|
||||||
decode: func(b []byte) (any, error) {
|
decode: func(b []byte) (any, error) {
|
||||||
var v PipelinesByBranchSourceValue
|
var v PipelinesByBranchRevisionValue
|
||||||
err := json.Unmarshal(b, &v)
|
err := json.Unmarshal(b, &v)
|
||||||
return v, err
|
return v, err
|
||||||
}, subjectIs: nil},
|
}, subjectIs: nil},
|
||||||
{name: "a waiting pipeline names the movers a newer take-in took out of it", subject: "", given: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"superseded\":[\"mesh-config\"],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"superseded\":[\"mesh-config\"],\"v\":1}",
|
{name: "a waiting pipeline names the movers a newer take-in took out of it", subject: "", given: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"superseded\":[\"mesh-config\"],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"fedcba9876543210\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0124\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"waiting\",\"pipeline\":\"main.3590\",\"revision\":13,\"seq\":2,\"source\":3590,\"steps\":[],\"superseded\":[\"mesh-config\"],\"v\":1}",
|
||||||
decode: func(b []byte) (any, error) {
|
decode: func(b []byte) (any, error) {
|
||||||
var v PipelinesByBranchSourceValue
|
var v PipelinesByBranchRevisionValue
|
||||||
err := json.Unmarshal(b, &v)
|
err := json.Unmarshal(b, &v)
|
||||||
return v, err
|
return v, err
|
||||||
}, subjectIs: nil},
|
}, subjectIs: nil},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "a take-in's pipeline kept, its steps naming their mover",
|
"name": "a take-in's pipeline kept, its steps naming their mover",
|
||||||
"of": "state:pipelines/<branch>.<source>",
|
"of": "state:pipelines/<branch>.<revision>",
|
||||||
"given": {
|
"given": {
|
||||||
"pipeline": "main.3589",
|
"pipeline": "main.3589",
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "a pipeline waiting its turn, its seq given",
|
"name": "a pipeline waiting its turn, its seq given",
|
||||||
"of": "state:pipelines/<branch>.<source>",
|
"of": "state:pipelines/<branch>.<revision>",
|
||||||
"given": {
|
"given": {
|
||||||
"pipeline": "main.3590",
|
"pipeline": "main.3590",
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "a waiting pipeline names the movers a newer take-in took out of it",
|
"name": "a waiting pipeline names the movers a newer take-in took out of it",
|
||||||
"of": "state:pipelines/<branch>.<source>",
|
"of": "state:pipelines/<branch>.<revision>",
|
||||||
"given": {
|
"given": {
|
||||||
"pipeline": "main.3590",
|
"pipeline": "main.3590",
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
|
|||||||
@@ -672,7 +672,7 @@
|
|||||||
"events": [
|
"events": [
|
||||||
{
|
{
|
||||||
"name": "pipeline-started",
|
"name": "pipeline-started",
|
||||||
"subject": "pipeline-started.<branch>.<source>",
|
"subject": "pipeline-started.<branch>.<revision>",
|
||||||
"body": {
|
"body": {
|
||||||
"$ref": "#/defs/PipelineStarted"
|
"$ref": "#/defs/PipelineStarted"
|
||||||
},
|
},
|
||||||
@@ -683,7 +683,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pipeline-ended",
|
"name": "pipeline-ended",
|
||||||
"subject": "pipeline-ended.<branch>.<source>",
|
"subject": "pipeline-ended.<branch>.<revision>",
|
||||||
"body": {
|
"body": {
|
||||||
"$ref": "#/defs/PipelineEnded"
|
"$ref": "#/defs/PipelineEnded"
|
||||||
},
|
},
|
||||||
@@ -727,7 +727,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "wait-held",
|
"name": "wait-held",
|
||||||
"subject": "wait-held.<branch>.<source>",
|
"subject": "wait-held.<branch>.<revision>",
|
||||||
"body": {
|
"body": {
|
||||||
"$ref": "#/defs/Wait"
|
"$ref": "#/defs/Wait"
|
||||||
},
|
},
|
||||||
@@ -738,7 +738,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "wait-ended",
|
"name": "wait-ended",
|
||||||
"subject": "wait-ended.<branch>.<source>",
|
"subject": "wait-ended.<branch>.<revision>",
|
||||||
"body": {
|
"body": {
|
||||||
"$ref": "#/defs/Wait"
|
"$ref": "#/defs/Wait"
|
||||||
},
|
},
|
||||||
@@ -778,11 +778,11 @@
|
|||||||
"description": "one key per pipeline, one per take-in, written by compare-and-set on its absence (design 47 H §746, §747), and one key per mover of a pipeline holding that mover's steps (H-A-187)",
|
"description": "one key per pipeline, one per take-in, written by compare-and-set on its absence (design 47 H §746, §747), and one key per mover of a pipeline holding that mover's steps (H-A-187)",
|
||||||
"key-forms": [
|
"key-forms": [
|
||||||
{
|
{
|
||||||
"key": "<branch>.<source>",
|
"key": "<branch>.<revision>",
|
||||||
"value": {
|
"value": {
|
||||||
"$ref": "#/defs/Pipeline"
|
"$ref": "#/defs/Pipeline"
|
||||||
},
|
},
|
||||||
"description": "a take-in's pipeline"
|
"description": "a pipeline of one catalog revision, keyed by the revision's number (design 47 H-A-213 (4), H-A-219); one kept from before under its source has the same form"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "<branch>.<source>.published.<package>.<version>",
|
"key": "<branch>.<source>.published.<package>.<version>",
|
||||||
@@ -1199,7 +1199,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "the pipeline's key, <branch>.<source>, <branch>.<source>.published.<package>.<version> for a pipeline a publish started, or <branch>.run.<run> for a run on request; a branch escaped as a key's name is (design 47 H §746, §747; H-A-83)"
|
"description": "the pipeline's key, <branch>.<revision>, <branch>.<source>.published.<package>.<version> for a pipeline a publish started, or <branch>.run.<run> for a run on request; a branch escaped as a key's name is (design 47 H §746, §747; H-A-83)"
|
||||||
},
|
},
|
||||||
"branch": {
|
"branch": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1313,7 +1313,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
"description": "the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
||||||
},
|
},
|
||||||
"branch": {
|
"branch": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1388,7 +1388,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
"description": "the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
||||||
},
|
},
|
||||||
"branch": {
|
"branch": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1495,7 +1495,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
"description": "the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
||||||
},
|
},
|
||||||
"module": {
|
"module": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@@ -1550,7 +1550,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
"description": "the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
||||||
},
|
},
|
||||||
"module": {
|
"module": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -1635,7 +1635,7 @@
|
|||||||
"description": "the run the step waits on, where the runner knows it: a test step's run key and ask (design 47 G §731, A-469v)"
|
"description": "the run the step waits on, where the runner knows it: a test step's run key and ask (design 47 G §731, A-469v)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283); said on <branch>.<source> (design 47 H-A-72)",
|
"description": "a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283); said on <branch>.<revision> (design 47 H-A-72, H-A-221)",
|
||||||
"required": [
|
"required": [
|
||||||
"v",
|
"v",
|
||||||
"pipeline",
|
"pipeline",
|
||||||
@@ -1978,7 +1978,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
"description": "the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description": "a pipeline waiting its turn under pipelines-at-once (design 47 H §748, H-A-72)",
|
"description": "a pipeline waiting its turn under pipelines-at-once (design 47 H §748, H-A-72)",
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ export declare const family: { readonly name: "mesh-pipeline-runner.events"; rea
|
|||||||
|
|
||||||
export declare const pipelineStartedStream: "SEAT_mesh-pipeline-runner_pipeline-started";
|
export declare const pipelineStartedStream: "SEAT_mesh-pipeline-runner_pipeline-started";
|
||||||
|
|
||||||
export declare function pipelineStartedSubject(branch: string, source: string): string;
|
export declare function pipelineStartedSubject(branch: string, revision: string): string;
|
||||||
|
|
||||||
export declare const pipelineStartedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*";
|
export declare const pipelineStartedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*";
|
||||||
|
|
||||||
export declare const pipelineEndedStream: "SEAT_mesh-pipeline-runner_pipeline-ended";
|
export declare const pipelineEndedStream: "SEAT_mesh-pipeline-runner_pipeline-ended";
|
||||||
|
|
||||||
export declare function pipelineEndedSubject(branch: string, source: string): string;
|
export declare function pipelineEndedSubject(branch: string, revision: string): string;
|
||||||
|
|
||||||
export declare const pipelineEndedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.*.*";
|
export declare const pipelineEndedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.*.*";
|
||||||
|
|
||||||
@@ -70,13 +70,13 @@ export declare const stepEndedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.
|
|||||||
|
|
||||||
export declare const waitHeldStream: "SEAT_mesh-pipeline-runner_wait-held";
|
export declare const waitHeldStream: "SEAT_mesh-pipeline-runner_wait-held";
|
||||||
|
|
||||||
export declare function waitHeldSubject(branch: string, source: string): string;
|
export declare function waitHeldSubject(branch: string, revision: string): string;
|
||||||
|
|
||||||
export declare const waitHeldSubjectAll: "mesh.seat.mesh-pipeline-runner.event.wait-held.*.*";
|
export declare const waitHeldSubjectAll: "mesh.seat.mesh-pipeline-runner.event.wait-held.*.*";
|
||||||
|
|
||||||
export declare const waitEndedStream: "SEAT_mesh-pipeline-runner_wait-ended";
|
export declare const waitEndedStream: "SEAT_mesh-pipeline-runner_wait-ended";
|
||||||
|
|
||||||
export declare function waitEndedSubject(branch: string, source: string): string;
|
export declare function waitEndedSubject(branch: string, revision: string): string;
|
||||||
|
|
||||||
export declare const waitEndedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.wait-ended.*.*";
|
export declare const waitEndedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.wait-ended.*.*";
|
||||||
|
|
||||||
@@ -94,11 +94,11 @@ export declare const states: {
|
|||||||
readonly stepOutputs: "step-outputs";
|
readonly stepOutputs: "step-outputs";
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The key of one value of the state pipelines under the form "<branch>.<source>". */
|
/** The key of one value of the state pipelines under the form "<branch>.<revision>". */
|
||||||
export declare function pipelinesByBranchSourceKey(branch: string, source: string): string;
|
export declare function pipelinesByBranchRevisionKey(branch: string, revision: string): string;
|
||||||
|
|
||||||
/** The parts of a key of the form "<branch>.<source>", or undefined for a key of another form. */
|
/** The parts of a key of the form "<branch>.<revision>", or undefined for a key of another form. */
|
||||||
export declare function parsePipelinesByBranchSourceKey(_key: string): { branch: string; source: string } | undefined;
|
export declare function parsePipelinesByBranchRevisionKey(_key: string): { branch: string; revision: string } | undefined;
|
||||||
|
|
||||||
/** The key of one value of the state pipelines under the form "<branch>.<source>.published.<package>.<version>". */
|
/** The key of one value of the state pipelines under the form "<branch>.<source>.published.<package>.<version>". */
|
||||||
export declare function pipelinesByBranchSourcePublishedPackageVersionKey(branch: string, source: string, packagePart: string, version: string): string;
|
export declare function pipelinesByBranchSourcePublishedPackageVersionKey(branch: string, source: string, packagePart: string, version: string): string;
|
||||||
@@ -261,7 +261,7 @@ export interface Pipeline {
|
|||||||
/** the modules the pipeline moves, its take-in's entries (design 47 H §746) */
|
/** the modules the pipeline moves, its take-in's entries (design 47 H §746) */
|
||||||
"movers": Mover[];
|
"movers": Mover[];
|
||||||
"outcome": "waiting" | "running" | "passed" | "failed" | "refused" | "superseded" | "cancelled";
|
"outcome": "waiting" | "running" | "passed" | "failed" | "refused" | "superseded" | "cancelled";
|
||||||
/** the pipeline's key, <branch>.<source>, <branch>.<source>.published.<package>.<version> for a pipeline a publish started, or <branch>.run.<run> for a run on request; a branch escaped as a key's name is (design 47 H §746, §747; H-A-83) */
|
/** the pipeline's key, <branch>.<revision>, <branch>.<source>.published.<package>.<version> for a pipeline a publish started, or <branch>.run.<run> for a run on request; a branch escaped as a key's name is (design 47 H §746, §747; H-A-83) */
|
||||||
"pipeline": string;
|
"pipeline": string;
|
||||||
/** for a pipeline a package's publish started, that publish (A-202) */
|
/** for a pipeline a package's publish started, that publish (A-202) */
|
||||||
"published"?: Published;
|
"published"?: Published;
|
||||||
@@ -300,7 +300,7 @@ export interface PipelineEnded {
|
|||||||
/** per mover its fingerprint, released version, step results and tier, in the delivery order (design 47 H §746, H-A-2) */
|
/** per mover its fingerprint, released version, step results and tier, in the delivery order (design 47 H §746, H-A-2) */
|
||||||
"movers": MoverEnded[];
|
"movers": MoverEnded[];
|
||||||
"outcome": "waiting" | "running" | "passed" | "failed" | "refused" | "superseded" | "cancelled";
|
"outcome": "waiting" | "running" | "passed" | "failed" | "refused" | "superseded" | "cancelled";
|
||||||
/** the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
/** the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
||||||
"pipeline": string;
|
"pipeline": string;
|
||||||
/** the catalog graph revision of the branch the pipeline runs for */
|
/** the catalog graph revision of the branch the pipeline runs for */
|
||||||
"revision"?: number;
|
"revision"?: number;
|
||||||
@@ -322,7 +322,7 @@ export interface PipelineStarted {
|
|||||||
"call"?: string;
|
"call"?: string;
|
||||||
/** the pipeline's movers */
|
/** the pipeline's movers */
|
||||||
"movers": Mover[];
|
"movers": Mover[];
|
||||||
/** the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
/** the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
||||||
"pipeline": string;
|
"pipeline": string;
|
||||||
/** for a pipeline a package's publish started, that publish (A-202) */
|
/** for a pipeline a package's publish started, that publish (A-202) */
|
||||||
"published"?: Published;
|
"published"?: Published;
|
||||||
@@ -383,7 +383,7 @@ export interface StepEvent {
|
|||||||
/** the module's build-input fingerprint at the commit */
|
/** the module's build-input fingerprint at the commit */
|
||||||
"fingerprint"?: string;
|
"fingerprint"?: string;
|
||||||
"module": string;
|
"module": string;
|
||||||
/** the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
/** the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
||||||
"pipeline": string;
|
"pipeline": string;
|
||||||
"result": StepResult;
|
"result": StepResult;
|
||||||
/** the catalog graph revision of the branch the pipeline runs for */
|
/** the catalog graph revision of the branch the pipeline runs for */
|
||||||
@@ -490,7 +490,7 @@ export interface ToolchainUsed {
|
|||||||
"version": string;
|
"version": string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283); said on <branch>.<source> (design 47 H-A-72) */
|
/** a step's wait, held and ended; a wait on a person is said as waiting on that person, never a stall (ADR 0283); said on <branch>.<revision> (design 47 H-A-72, H-A-221) */
|
||||||
export interface Wait {
|
export interface Wait {
|
||||||
"artifact"?: string;
|
"artifact"?: string;
|
||||||
/** the step's own ask, where it has one (design 47 G §731) */
|
/** the step's own ask, where it has one (design 47 G §731) */
|
||||||
@@ -507,7 +507,7 @@ export interface Wait {
|
|||||||
"module"?: string;
|
"module"?: string;
|
||||||
/** what the step waits on (design 47 *Health and going back*) */
|
/** what the step waits on (design 47 *Health and going back*) */
|
||||||
"on": "person" | "build node" | "revision view" | "pipelines-at-once";
|
"on": "person" | "build node" | "revision view" | "pipelines-at-once";
|
||||||
/** the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
/** the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
||||||
"pipeline": string;
|
"pipeline": string;
|
||||||
/** the catalog graph revision of the branch the pipeline runs for */
|
/** the catalog graph revision of the branch the pipeline runs for */
|
||||||
"revision"?: number;
|
"revision"?: number;
|
||||||
@@ -527,7 +527,7 @@ export interface Wait {
|
|||||||
|
|
||||||
/** a pipeline waiting its turn under pipelines-at-once (design 47 H §748, H-A-72) */
|
/** a pipeline waiting its turn under pipelines-at-once (design 47 H §748, H-A-72) */
|
||||||
export interface Waiting {
|
export interface Waiting {
|
||||||
/** the pipeline's key, <branch>.<source>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
/** the pipeline's key, <branch>.<revision>, or <branch>.<source>.published.<package>.<version> for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */
|
||||||
"pipeline": string;
|
"pipeline": string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -800,8 +800,8 @@ export type FullEvent = Fill;
|
|||||||
/** is the body of the event room. */
|
/** is the body of the event room. */
|
||||||
export type RoomEvent = Fill;
|
export type RoomEvent = Fill;
|
||||||
|
|
||||||
/** is one value of the state pipelines under the key <branch>.<source>. */
|
/** is one value of the state pipelines under the key <branch>.<revision>. */
|
||||||
export type PipelinesByBranchSourceValue = Pipeline;
|
export type PipelinesByBranchRevisionValue = Pipeline;
|
||||||
|
|
||||||
/** is one value of the state pipelines under the key <branch>.<source>.published.<package>.<version>. */
|
/** is one value of the state pipelines under the key <branch>.<source>.published.<package>.<version>. */
|
||||||
export type PipelinesByBranchSourcePublishedPackageVersionValue = Pipeline;
|
export type PipelinesByBranchSourcePublishedPackageVersionValue = Pipeline;
|
||||||
|
|||||||
@@ -40,16 +40,16 @@ export const family = { name: "mesh-pipeline-runner.events", maxAgeDays: 7 };
|
|||||||
|
|
||||||
export const pipelineStartedStream = "SEAT_mesh-pipeline-runner_pipeline-started";
|
export const pipelineStartedStream = "SEAT_mesh-pipeline-runner_pipeline-started";
|
||||||
|
|
||||||
export function pipelineStartedSubject(branch, source) {
|
export function pipelineStartedSubject(branch, revision) {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.pipeline-started." + branch + "." + source;
|
return "mesh.seat.mesh-pipeline-runner.event.pipeline-started." + branch + "." + revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pipelineStartedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*";
|
export const pipelineStartedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*";
|
||||||
|
|
||||||
export const pipelineEndedStream = "SEAT_mesh-pipeline-runner_pipeline-ended";
|
export const pipelineEndedStream = "SEAT_mesh-pipeline-runner_pipeline-ended";
|
||||||
|
|
||||||
export function pipelineEndedSubject(branch, source) {
|
export function pipelineEndedSubject(branch, revision) {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.pipeline-ended." + branch + "." + source;
|
return "mesh.seat.mesh-pipeline-runner.event.pipeline-ended." + branch + "." + revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pipelineEndedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.*.*";
|
export const pipelineEndedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.*.*";
|
||||||
@@ -80,16 +80,16 @@ export const stepEndedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.step-en
|
|||||||
|
|
||||||
export const waitHeldStream = "SEAT_mesh-pipeline-runner_wait-held";
|
export const waitHeldStream = "SEAT_mesh-pipeline-runner_wait-held";
|
||||||
|
|
||||||
export function waitHeldSubject(branch, source) {
|
export function waitHeldSubject(branch, revision) {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.wait-held." + branch + "." + source;
|
return "mesh.seat.mesh-pipeline-runner.event.wait-held." + branch + "." + revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const waitHeldSubjectAll = "mesh.seat.mesh-pipeline-runner.event.wait-held.*.*";
|
export const waitHeldSubjectAll = "mesh.seat.mesh-pipeline-runner.event.wait-held.*.*";
|
||||||
|
|
||||||
export const waitEndedStream = "SEAT_mesh-pipeline-runner_wait-ended";
|
export const waitEndedStream = "SEAT_mesh-pipeline-runner_wait-ended";
|
||||||
|
|
||||||
export function waitEndedSubject(branch, source) {
|
export function waitEndedSubject(branch, revision) {
|
||||||
return "mesh.seat.mesh-pipeline-runner.event.wait-ended." + branch + "." + source;
|
return "mesh.seat.mesh-pipeline-runner.event.wait-ended." + branch + "." + revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const waitEndedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.wait-ended.*.*";
|
export const waitEndedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.wait-ended.*.*";
|
||||||
@@ -108,23 +108,23 @@ export const states = {
|
|||||||
stepOutputs: "step-outputs",
|
stepOutputs: "step-outputs",
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The key of one value of the state pipelines under the form "<branch>.<source>". */
|
/** The key of one value of the state pipelines under the form "<branch>.<revision>". */
|
||||||
export function pipelinesByBranchSourceKey(branch, source) {
|
export function pipelinesByBranchRevisionKey(branch, revision) {
|
||||||
return branch + "." + source;
|
return branch + "." + revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The parts of a key of the form "<branch>.<source>", or undefined for a key of another form. */
|
/** The parts of a key of the form "<branch>.<revision>", or undefined for a key of another form. */
|
||||||
export function parsePipelinesByBranchSourceKey(_key) {
|
export function parsePipelinesByBranchRevisionKey(_key) {
|
||||||
let _rest = _key;
|
let _rest = _key;
|
||||||
const _at0 = _rest.indexOf(".");
|
const _at0 = _rest.indexOf(".");
|
||||||
if (_at0 <= 0) return undefined;
|
if (_at0 <= 0) return undefined;
|
||||||
const branch = _rest.slice(0, _at0);
|
const branch = _rest.slice(0, _at0);
|
||||||
_rest = _rest.slice(_at0 + 1);
|
_rest = _rest.slice(_at0 + 1);
|
||||||
if (_rest === "") return undefined;
|
if (_rest === "") return undefined;
|
||||||
const source = _rest;
|
const revision = _rest;
|
||||||
_rest = "";
|
_rest = "";
|
||||||
if (_rest !== "") return undefined;
|
if (_rest !== "") return undefined;
|
||||||
return { branch, source };
|
return { branch, revision };
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The key of one value of the state pipelines under the form "<branch>.<source>.published.<package>.<version>". */
|
/** The key of one value of the state pipelines under the form "<branch>.<source>.published.<package>.<version>". */
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ func (ix *Indexer) keepBranchEntries(ctx context.Context, branch string, src int
|
|||||||
}
|
}
|
||||||
// The take-in's revision pinned for its one pipeline before any judge can remove it (§743, §749, A-449a).
|
// The take-in's revision pinned for its one pipeline before any judge can remove it (§743, §749, A-449a).
|
||||||
if len(movers) > 0 && ix.Pins != nil {
|
if len(movers) > 0 && ix.Pins != nil {
|
||||||
record := PipelineRecord(runner.PipelinesByBranchSourceKey(keys.EscapeName(branch), strconv.FormatInt(src, 10)))
|
record := PipelineRecord(runner.PipelinesByBranchRevisionKey(keys.EscapeName(branch), strconv.FormatInt(src, 10)))
|
||||||
if err := ix.pin(ctx, PinKey(branch, src), record); err != nil {
|
if err := ix.pin(ctx, PinKey(branch, src), record); err != nil {
|
||||||
ix.logf("pins: the revision %s is not pinned for %s: %v", BranchObject(branch, src), record, err)
|
ix.logf("pins: the revision %s is not pinned for %s: %v", BranchObject(branch, src), record, err)
|
||||||
return fmt.Errorf("the pin of %s: %w", BranchObject(branch, src), err)
|
return fmt.Errorf("the pin of %s: %w", BranchObject(branch, src), err)
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ func (q *Queue) leave(key string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// queueWait is a pipeline's wait on its turn, said as wait-held and wait-ended on <branch>.<source> with step pipeline and
|
// queueWait is a pipeline's wait on its turn, said as wait-held and wait-ended on <branch>.<revision> with step pipeline and
|
||||||
// on pipelines-at-once (design 47 H §748, H-A-52).
|
// on pipelines-at-once (design 47 H §748, H-A-52).
|
||||||
func queueWait(p seat.Pipeline, at time.Time, how string) seat.Wait {
|
func queueWait(p seat.Pipeline, at time.Time, how string) seat.Wait {
|
||||||
return seat.Wait{V: 1, Pipeline: p.Pipeline, Branch: p.Branch, Source: p.Source, Revision: p.Revision, Run: p.Run,
|
return seat.Wait{V: 1, Pipeline: p.Pipeline, Branch: p.Branch, Source: p.Source, Revision: p.Revision, Run: p.Run,
|
||||||
@@ -175,7 +175,7 @@ func (s *Starter) sayQueueWait(event string, p seat.Pipeline, at time.Time, how
|
|||||||
if s.Say == nil {
|
if s.Say == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := s.Say(runnerclient.SourceSubject(event, p.Branch, p.Source), queueWait(p, at, how)); err != nil {
|
if err := s.Say(runnerclient.RevisionSubject(event, p.Branch, subjectRevision(p)), queueWait(p, at, how)); err != nil {
|
||||||
s.logf("%s of %s is not said: %v", event, p.Pipeline, err)
|
s.logf("%s of %s is not said: %v", event, p.Pipeline, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ func (r Reads) pipelineOf(key string, all []string) (seat.Pipeline, bool, error)
|
|||||||
if raw == nil {
|
if raw == nil {
|
||||||
return seat.Pipeline{}, false, nil
|
return seat.Pipeline{}, false, nil
|
||||||
}
|
}
|
||||||
p, err := seat.DecodePipelinesByBranchSourceValue(raw)
|
p, err := seat.DecodePipelinesByBranchRevisionValue(raw)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return seat.Pipeline{}, false, fmt.Errorf("%s %s: %w", seat.StatePipelines, key, err)
|
return seat.Pipeline{}, false, fmt.Errorf("%s %s: %w", seat.StatePipelines, key, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,13 @@ type Begin struct {
|
|||||||
// the branch escaped as a key's name is (design 47 H §746, H-A-213 (4)); a take-in's number is unchanged where it equalled
|
// the branch escaped as a key's name is (design 47 H §746, H-A-213 (4)); a take-in's number is unchanged where it equalled
|
||||||
// its source. A pipeline kept under its source before (`<branch>.<source>`) has the same form and is read as it is.
|
// its source. A pipeline kept under its source before (`<branch>.<source>`) has the same form and is read as it is.
|
||||||
func Key(branch string, revision int64) string {
|
func Key(branch string, revision int64) string {
|
||||||
return seat.PipelinesByBranchSourceKey(keys.EscapeName(branch), strconv.FormatInt(revision, 10))
|
return seat.PipelinesByBranchRevisionKey(keys.EscapeName(branch), strconv.FormatInt(revision, 10))
|
||||||
|
}
|
||||||
|
|
||||||
|
// subjectRevision is the number p's pipeline-started, pipeline-ended and waits are said under, <branch>.<revision>: its
|
||||||
|
// key's number (H-A-221).
|
||||||
|
func subjectRevision(p seat.Pipeline) int64 {
|
||||||
|
return keyRevision(Begin{Revision: p.Revision, Source: p.Source})
|
||||||
}
|
}
|
||||||
|
|
||||||
// keyRevision is the number b's pipeline is keyed by (H-A-213 (4)): its revision, or its source where the start names no
|
// keyRevision is the number b's pipeline is keyed by (H-A-213 (4)): its revision, or its source where the start names no
|
||||||
@@ -300,12 +306,12 @@ func started(p seat.Pipeline, at time.Time) seat.PipelineStarted {
|
|||||||
Revision: p.Revision, Movers: p.Movers, Published: p.Published, Run: p.Run}
|
Revision: p.Revision, Movers: p.Movers, Published: p.Published, Run: p.Run}
|
||||||
}
|
}
|
||||||
|
|
||||||
// sayStartedPipeline says p's pipeline-started on <branch>.<source> (§746).
|
// sayStartedPipeline says p's pipeline-started on <branch>.<revision> (§746).
|
||||||
func (s *Starter) sayStartedPipeline(p seat.Pipeline, at time.Time) {
|
func (s *Starter) sayStartedPipeline(p seat.Pipeline, at time.Time) {
|
||||||
if s.Say == nil {
|
if s.Say == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := s.Say(runnerclient.SourceSubject(seat.EventPipelineStarted, p.Branch, p.Source), started(p, at)); err != nil {
|
if err := s.Say(runnerclient.RevisionSubject(seat.EventPipelineStarted, p.Branch, subjectRevision(p)), started(p, at)); err != nil {
|
||||||
s.logf("pipeline-started of %s is not said: %v", p.Pipeline, err)
|
s.logf("pipeline-started of %s is not said: %v", p.Pipeline, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func TestStarts(t *testing.T) {
|
|||||||
if _, err := s.Start(Begin{Branch: "release.1", Source: 3, Movers: []seat.Mover{{Module: "app"}}}); err != nil {
|
if _, err := s.Start(Begin{Branch: "release.1", Source: 3, Movers: []seat.Mover{{Module: "app"}}}); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
if b, r, ok := seat.ParsePipelinesByBranchSourceKey(Key("release.1", 3)); !ok || r != "3" || b == "release" {
|
if b, r, ok := seat.ParsePipelinesByBranchRevisionKey(Key("release.1", 3)); !ok || r != "3" || b == "release" {
|
||||||
t.Errorf("the key of release.1 is %q", Key("release.1", 3))
|
t.Errorf("the key of release.1 is %q", Key("release.1", 3))
|
||||||
}
|
}
|
||||||
if _, err := s.Start(Begin{Branch: "main", Movers: []seat.Mover{{Module: "app"}}}); err == nil {
|
if _, err := s.Start(Begin{Branch: "main", Movers: []seat.Mover{{Module: "app"}}}); err == nil {
|
||||||
@@ -151,7 +151,7 @@ func (failing) Create(string, []byte) error { return errors.New("bus away") }
|
|||||||
|
|
||||||
// R4/AC1 (design 47 H §746, acceptance test 112): a take-in.taken naming mesh-sdk and one importer starts one pipeline
|
// R4/AC1 (design 47 H §746, acceptance test 112): a take-in.taken naming mesh-sdk and one importer starts one pipeline
|
||||||
// keyed <branch>.<source> by compare-and-set, its movers the event's entries, at the take-in's revision, and says one
|
// keyed <branch>.<source> by compare-and-set, its movers the event's entries, at the take-in's revision, and says one
|
||||||
// pipeline-started on <branch>.<source> naming the call and the movers; R4/AC2: heard twice, the second writes nothing. A
|
// pipeline-started on <branch>.<revision> naming the call and the movers; R4/AC2: heard twice, the second writes nothing. A
|
||||||
// take-in with no entries and one naming no source revision start nothing.
|
// take-in with no entries and one naming no source revision start nothing.
|
||||||
func TestATakeInIsOnePipeline(t *testing.T) {
|
func TestATakeInIsOnePipeline(t *testing.T) {
|
||||||
store := created{}
|
store := created{}
|
||||||
@@ -182,7 +182,7 @@ func TestATakeInIsOnePipeline(t *testing.T) {
|
|||||||
if m, _ := MoverOf(p, "mesh-sdk"); m.Commit != "c1" || m.Fingerprint != "src2:aa" || m.Repository != "o/sdk" || m.Tier != 1 {
|
if m, _ := MoverOf(p, "mesh-sdk"); m.Commit != "c1" || m.Fingerprint != "src2:aa" || m.Repository != "o/sdk" || m.Tier != 1 {
|
||||||
t.Errorf("the mover mesh-sdk = %+v", m)
|
t.Errorf("the mover mesh-sdk = %+v", m)
|
||||||
}
|
}
|
||||||
if subjects[0] != "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.7" || said[0].Call != ev.Call || len(said[0].Movers) != 2 {
|
if subjects[0] != "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.12" || said[0].Call != ev.Call || len(said[0].Movers) != 2 {
|
||||||
t.Errorf("pipeline-started %+v on %s", said[0], subjects[0])
|
t.Errorf("pipeline-started %+v on %s", said[0], subjects[0])
|
||||||
}
|
}
|
||||||
if _, err := s.TakenIn(catalog.TakeInTaken{Branch: "main", Entries: ev.Entries}, view); err == nil {
|
if _, err := s.TakenIn(catalog.TakeInTaken{Branch: "main", Entries: ev.Entries}, view); err == nil {
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ func (h *Hearer) endRunOf(p seat.Pipeline, s seat.StepResult, ev StepEnded) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
// said says what a written pipeline became: an approval asked is a wait held on the operator (ADR 0283), never a stall;
|
// said says what a written pipeline became: an approval asked is a wait held on the operator (ADR 0283), never a stall;
|
||||||
// an end is said once, on <branch>.<source> (design 47 H §746). The runner says no group-ended (§764).
|
// an end is said once, on <branch>.<revision> (design 47 H §746). The runner says no group-ended (§764).
|
||||||
func (h *Hearer) said(p seat.Pipeline, asked []int, ended bool) error {
|
func (h *Hearer) said(p seat.Pipeline, asked []int, ended bool) error {
|
||||||
for _, i := range asked {
|
for _, i := range asked {
|
||||||
if err := h.say(seat.EventWaitHeld, p, &p.Steps[i]); err != nil {
|
if err := h.say(seat.EventWaitHeld, p, &p.Steps[i]); err != nil {
|
||||||
@@ -489,7 +489,7 @@ func (h *Hearer) say(event string, p seat.Pipeline, step *seat.StepResult) error
|
|||||||
subject, ev := stepEvent(event, p, *step, at)
|
subject, ev := stepEvent(event, p, *step, at)
|
||||||
return h.Say(subject, ev)
|
return h.Say(subject, ev)
|
||||||
case seat.EventPipelineEnded:
|
case seat.EventPipelineEnded:
|
||||||
return h.Say(runnerclient.SourceSubject(event, p.Branch, p.Source), pipelineEnded(p))
|
return h.Say(runnerclient.RevisionSubject(event, p.Branch, subjectRevision(p)), pipelineEnded(p))
|
||||||
default:
|
default:
|
||||||
w := seat.Wait{V: 1, Pipeline: p.Pipeline, Branch: p.Branch, Revision: p.Revision, Source: p.Source, Run: p.Run,
|
w := seat.Wait{V: 1, Pipeline: p.Pipeline, Branch: p.Branch, Revision: p.Revision, Source: p.Source, Run: p.Run,
|
||||||
Step: seat.WaitStepApproval, On: seat.WaitOnPerson, Since: at}
|
Step: seat.WaitStepApproval, On: seat.WaitOnPerson, Since: at}
|
||||||
@@ -497,7 +497,7 @@ func (h *Hearer) say(event string, p seat.Pipeline, step *seat.StepResult) error
|
|||||||
m, _ := MoverOf(p, step.Module)
|
m, _ := MoverOf(p, step.Module)
|
||||||
w.Module, w.Commit, w.Fingerprint, w.Step, w.Ask = m.Module, m.Commit, m.Fingerprint, step.Step, step.Ask
|
w.Module, w.Commit, w.Fingerprint, w.Step, w.Ask = m.Module, m.Commit, m.Fingerprint, step.Step, step.Ask
|
||||||
}
|
}
|
||||||
return h.Say(runnerclient.SourceSubject(event, p.Branch, p.Source), w)
|
return h.Say(runnerclient.RevisionSubject(event, p.Branch, subjectRevision(p)), w)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user