mesh-delivery-builder: judge a built reservation's bound after its kept published are taken in; only a raise with words of its own writes over a standing version-unreleased (issue 1984, review round 2)
A built reservation's bound was judged before the published kept on it were taken in, at a look (Built) and at the start: one past its bound whose kept published mark every artifact (note 8's own case) raised version-unreleased naming every artifact unpublished, then said package-published for each, and the false finding stood until its version-released. The kept are now taken in first (Kept answers the reservation as its take-in left it), and the bound is armed or judged on that reservation. The bound's end (ended) raised "nothing within" over the words the publish again left within the bound, the kind round 1 fixed past the bound. Every raise that says only the bound ended or could not be armed now goes through lapsed, which raises only when no version-unreleased of the module stands (Held, design 47 G A-38). The raises with words of their own, a holder's refusal of a publish again (ADR 0674 §3: left "raised with the holder's words") and a digest no artifact carries (A-490j: "fails loudly"), still write over a standing one. Builds: issue 1984 note 8 (1984/AC5), design 47 G §369, A-415, A-38, A-490j, ADR 0674 §3
This commit is contained in:
@@ -911,19 +911,32 @@ func (v ReservedVersion) keeps(name, digest string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// KeptTaken is what Kept took in: the reservation as the take-in left it (as written, or as read when nothing was kept on it),
|
||||
// whether it stands built at the version, the artifacts newly marked and the kept published whose digest matched no artifact.
|
||||
type KeptTaken struct {
|
||||
Reserved ReservedVersion
|
||||
Standing bool
|
||||
Marked []Marked
|
||||
Unmatched []KeptPublished
|
||||
}
|
||||
|
||||
// Kept takes the published kept on module's reservation of version in once its build recorded every digest (design 47 G
|
||||
// A-415): each kept published whose digest is an artifact's marks that artifact, as one heard after would, and every kept one
|
||||
// leaves the reservation. It answers the artifacts newly marked and the kept published whose digest matched no artifact.
|
||||
func (r *Reserver) Kept(ctx context.Context, module, version string) ([]Marked, []KeptPublished, error) {
|
||||
// leaves the reservation. It answers the reservation as the take-in left it, so what follows the take-in is judged on the
|
||||
// artifacts it marked (issue 1984 note 8, 1984/AC5).
|
||||
func (r *Reserver) Kept(ctx context.Context, module, version string) (KeptTaken, error) {
|
||||
series, _, err := SplitVersion(version)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
return KeptTaken{}, err
|
||||
}
|
||||
key := ReservedKey(module, series)
|
||||
for {
|
||||
cur, rev, found, err := r.get(ctx, key)
|
||||
if err != nil || !found || cur.Version != version || cur.BuiltAt.IsZero() || len(cur.Kept) == 0 {
|
||||
return nil, nil, err
|
||||
if err != nil || !found || cur.Version != version || cur.BuiltAt.IsZero() {
|
||||
return KeptTaken{}, err
|
||||
}
|
||||
if len(cur.Kept) == 0 {
|
||||
return KeptTaken{Reserved: cur, Standing: true}, nil
|
||||
}
|
||||
var arts []string
|
||||
var unmatched []KeptPublished
|
||||
@@ -949,13 +962,13 @@ func (r *Reserver) Kept(ctx context.Context, module, version string) ([]Marked,
|
||||
if _, err := r.Store.Update(ctx, key, raw, rev); errors.Is(err, ErrConflict) {
|
||||
continue
|
||||
} else if err != nil {
|
||||
return nil, nil, fmt.Errorf("%s cannot be written: %w", key, err)
|
||||
return KeptTaken{}, fmt.Errorf("%s cannot be written: %w", key, err)
|
||||
}
|
||||
var marked []Marked
|
||||
took := KeptTaken{Reserved: cur, Standing: true, Unmatched: unmatched}
|
||||
for _, a := range arts {
|
||||
marked = append(marked, Marked{Reserved: cur, Artifact: a})
|
||||
took.Marked = append(took.Marked, Marked{Reserved: cur, Artifact: a})
|
||||
}
|
||||
return marked, unmatched, nil
|
||||
return took, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user