Delete the dead table paths, the move, the store's assignments mirror and its tick (issue 1110)
Every method of builds, build requests, rollouts, merges and assignments reads and writes the chain alone: the else branches that read the tables, the movers and MoveChain with their tests, chain_moved reads, ChainReads and the flags that switched a kind, the store's assignments mirror (KeepAssignmentPlans needs none of it: it uses only the AssignmentMirrored type, mirrors.go, and AssignmentValues, provisioning.go) and its tick, the move code of the controller's start, and ForTest's chain_moved row. The listed store tests of the move go with their functions; the tests of the readers, requests, assignments and plans that lived beside them stay in chain_store_test.go. Tests that replayed old data migrations over the build, assignment and pin tables are removed with the tables. The static test that no plan is written but through SavePlansMoving now reads the plan's chain path.
This commit is contained in:
@@ -32,39 +32,11 @@ type sourceRow struct {
|
||||
// sourceRows is every successful build of each module (of one module, when named), newest request
|
||||
// first.
|
||||
func (i *Inventory) sourceRows(ctx context.Context, module string) (map[string][]sourceRow, []string, error) {
|
||||
if c, on, err := i.ChainReads(ctx, KindBuilds); err != nil {
|
||||
return nil, nil, err
|
||||
} else if on {
|
||||
return i.chainSourceRows(ctx, c, module)
|
||||
}
|
||||
query := `select b.module, b.id, b.commit_hash, b.source_fingerprint, b.made, b.manifest,
|
||||
coalesce(g.verdict = 'failed', false)
|
||||
from build b left join build_gate g on g.build = b.id
|
||||
where b.module is not null and b.module <> '' and b.failed = ''`
|
||||
args := []any{}
|
||||
if module != "" {
|
||||
query += ` and b.module = $1`
|
||||
args = append(args, module)
|
||||
}
|
||||
rows, err := i.store.Pool().Query(ctx, query+` order by b.module, coalesce(b.asked, b.at) desc, b.at desc`, args...)
|
||||
c, err := i.theChain(ctx)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
out := map[string][]sourceRow{}
|
||||
var order []string
|
||||
for rows.Next() {
|
||||
var m string
|
||||
var r sourceRow
|
||||
if err := rows.Scan(&m, &r.id, &r.commit, &r.fingerprint, &r.made, &r.manifest, &r.failedGate); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if _, seen := out[m]; !seen {
|
||||
order = append(order, m)
|
||||
}
|
||||
out[m] = append(out[m], r)
|
||||
}
|
||||
return out, order, rows.Err()
|
||||
return i.chainSourceRows(ctx, c, module)
|
||||
}
|
||||
|
||||
// standing is, of a module's builds newest first, the index of the build that stands for the build at
|
||||
|
||||
Reference in New Issue
Block a user