Judge a packaging module's news by plans that built it, over every plan since its build (hq ADR 0267, review)
A plan that closed without building a module hid a missed merge from it; a window of recent plans let an old closure back in once the plan that overtook it slid out; a merge the forge gave no time was acted on again every pass. A plan answering the merge's own commit is now a look at it, and clocks a little apart do not make a merge history.
This commit is contained in:
@@ -95,6 +95,9 @@ type ReadRepository struct {
|
||||
// any outcome was: what the planner judges a build source's age, and a merge's news, by. Never stored.
|
||||
Built time.Time `json:"-"`
|
||||
Looked time.Time `json:"-"`
|
||||
// LookedAt are the merge commits a plan that built the module, or is building it, answered: a merge
|
||||
// of one of them is history for the module whatever the clocks say. Never stored.
|
||||
LookedAt []string `json:"-"`
|
||||
}
|
||||
|
||||
// BuildSource is the build source a build read in one repository (novox/hq ADR 0267): Repository and Ref
|
||||
|
||||
@@ -312,6 +312,11 @@ func (i *Inventory) OpenPlans(ctx context.Context) ([]Plan, error) {
|
||||
return i.plans(ctx, `where state in ('building', 'rolling') order by created`)
|
||||
}
|
||||
|
||||
// PlansSince is every plan made after a moment, and every plan still being worked, oldest first.
|
||||
func (i *Inventory) PlansSince(ctx context.Context, since time.Time) ([]Plan, error) {
|
||||
return i.plans(ctx, `where created > $1 or state in ('building', 'rolling') order by created`, since)
|
||||
}
|
||||
|
||||
// RecentPlans is the last few plans, newest first, open or not — what the overview shows.
|
||||
func (i *Inventory) RecentPlans(ctx context.Context, limit int) ([]Plan, error) {
|
||||
return i.plans(ctx, fmt.Sprintf(`order by created desc limit %d`, limit))
|
||||
|
||||
Reference in New Issue
Block a user