diff --git a/bin/SHA256SUMS b/bin/SHA256SUMS index 5c49ddf..4b2fc32 100644 --- a/bin/SHA256SUMS +++ b/bin/SHA256SUMS @@ -1,4 +1,4 @@ -69a60a3ba48e83640b6d8b122401e7204cfaac6c5d60976e19904c81eb37f838 control-api +a20dc6b6714cfcc204a6ff12830c8d7fc960e03c9a7590de73150b621e0fdd3e control-api ec6959ae151d8ad1ad5b68faca420159ca6ca6b3dd1359b7f9b0d8489ac0a27b validator-agent 7ef8785769d946d81c338f53928bbe18f243ec5b96ab8b874846504b8ac4e98c prober -dd3fcccf595608f477726d4818abe4e4fb9c7212ab6df73c68fdc346222ab047 admin-dashboard +de1fcc94ab356b6b9ef560feb9f9f25e7bd9f5c74fa9fd544360c586713af761 admin-dashboard diff --git a/bin/admin-dashboard b/bin/admin-dashboard index f2102a1..7d3dd64 100755 Binary files a/bin/admin-dashboard and b/bin/admin-dashboard differ diff --git a/bin/control-api b/bin/control-api index 3780a09..ab62db5 100755 Binary files a/bin/control-api and b/bin/control-api differ diff --git a/internal/dashboard/dashboard_test.go b/internal/dashboard/dashboard_test.go index 5a532b0..c90e21b 100644 --- a/internal/dashboard/dashboard_test.go +++ b/internal/dashboard/dashboard_test.go @@ -63,6 +63,8 @@ type fakeControlAPI struct { scanFreeAddresses []string registry map[string]registryItem registryChecks map[string][]check + registryEvents []event + registryCycles []registryCycle // The chart of /registry: the breakdown served (breakdownStatus != 0 makes // it fail with that status), the table behind a row and the raw queries // of both endpoints. @@ -553,7 +555,10 @@ func (f *fakeControlAPI) handler() http.Handler { writeAPIErr(w, http.StatusNotFound, "unknown ip: "+addr) return } - writeJSON(w, http.StatusOK, registryHistoryResponse{Registry: item, Checks: f.registryChecks[addr], SelfCheckFailedOn: f.selfCheckFailedOn}) + writeJSON(w, http.StatusOK, registryHistoryResponse{ + Registry: item, Checks: f.registryChecks[addr], SelfCheckFailedOn: f.selfCheckFailedOn, + Events: f.registryEvents, Cycles: f.registryCycles, + }) }) mux.HandleFunc("GET /api/v1/admin/config/subnets", func(w http.ResponseWriter, r *http.Request) { diff --git a/internal/dashboard/dto.go b/internal/dashboard/dto.go index 3150553..e4caa1a 100644 --- a/internal/dashboard/dto.go +++ b/internal/dashboard/dto.go @@ -62,6 +62,7 @@ type ipQueueItem struct { FIPAssociatedAt *time.Time AggregatedAt *time.Time FIPReleasedAt *time.Time + CycleID int CreatedAt time.Time UpdatedAt time.Time } @@ -88,6 +89,7 @@ type event struct { SourceType string SourceID string IPID *int64 + CycleID int EventType string Payload string OccurredAt time.Time @@ -373,7 +375,18 @@ type registryHistoryResponse struct { Checks []check `json:"checks"` // SelfCheckFailedOn lists the validators whose self-check of this address // failed, over every run. - SelfCheckFailedOn []string `json:"self_check_failed_on"` + SelfCheckFailedOn []string `json:"self_check_failed_on"` + Events []event `json:"events"` + Cycles []registryCycle `json:"cycles"` + CurrentIP *ipQueueItem `json:"current_ip"` +} + +type registryCycle struct { + CycleID int `json:"cycle_id"` + RunID int64 `json:"run_id"` + Verdict string `json:"verdict"` + AggregatedAt *time.Time `json:"aggregated_at"` + SelfCheckFailedOn []string `json:"self_check_failed_on"` } type validatorDTO struct { diff --git a/internal/dashboard/handlers_ips.go b/internal/dashboard/handlers_ips.go index dc3b2ce..78a085b 100644 --- a/internal/dashboard/handlers_ips.go +++ b/internal/dashboard/handlers_ips.go @@ -122,8 +122,13 @@ type ipsPageData struct { type ipDetailData struct { PageData - Detail ipDetailResponse - Events []eventView + ipDetailView +} + +type ipDetailView struct { + Detail ipDetailResponse + Events []eventView + HasQueueData bool } // tracerouteView is a parsed traceroute_result event payload. @@ -227,7 +232,7 @@ func (s *Server) handleIPsPage(w http.ResponseWriter, r *http.Request) { func (s *Server) handleIPDetail(w http.ResponseWriter, r *http.Request) { ip := r.PathValue("ip") detail, err := s.CA.GetIP(r.Context(), ip) - data := ipDetailData{Detail: detail, Events: buildEventViews(detail.Events)} + data := ipDetailData{ipDetailView: ipDetailView{Detail: detail, Events: buildEventViews(detail.Events), HasQueueData: true}} data.ActiveNav = "ips" data.Banner = bannerFor(err) s.renderPage(w, r, "ip_detail_page", data) diff --git a/internal/dashboard/handlers_registry.go b/internal/dashboard/handlers_registry.go index 5cdc3c1..c6c1c36 100644 --- a/internal/dashboard/handlers_registry.go +++ b/internal/dashboard/handlers_registry.go @@ -44,6 +44,7 @@ type registryPageData struct { type registryDetailData struct { PageData History registryHistoryResponse + Cycles []registryCycleView } // handleRegistryPage lists every address ever submitted to the check @@ -347,7 +348,7 @@ func registryRunOptions(runs []analyticsRun, chosen int64) []runOption { func (s *Server) handleRegistryDetail(w http.ResponseWriter, r *http.Request) { ip := r.PathValue("ip") history, err := s.CA.GetRegistryHistory(r.Context(), ip) - data := registryDetailData{History: history} + data := registryDetailData{History: history, Cycles: buildRegistryCycles(history)} data.ActiveNav = "registry" data.Banner = bannerFor(err) s.renderPage(w, r, "registry_detail_page", data) diff --git a/internal/dashboard/handlers_test.go b/internal/dashboard/handlers_test.go index 507cf2f..07690c0 100644 --- a/internal/dashboard/handlers_test.go +++ b/internal/dashboard/handlers_test.go @@ -637,8 +637,13 @@ func TestRegistryPageAndDetail(t *testing.T) { TotalCycles: 2, LastResult: "pass", InQueue: false, } fake.registryChecks["9.9.9.9"] = []check{ - {CycleID: 2, Source: "egress", CheckType: "https", Target: "https://example.test", Success: true, CheckedAt: now}, - {CycleID: 1, Source: "egress", CheckType: "https", Target: "https://example.test", Success: false, CheckedAt: now}, + {CycleID: 2, AttemptNumber: 1, Source: "egress", CheckType: "https", Target: "https://new.example.test", Success: true, CheckedAt: now}, + {CycleID: 1, AttemptNumber: 1, Source: "egress", CheckType: "https", Target: "https://old.example.test", Success: false, CheckedAt: now.Add(-time.Hour)}, + } + fake.registryEvents = []event{{CycleID: 2, EventType: "traceroute_result", OccurredAt: now, Payload: `{"output":"trace of cycle two"}`}} + fake.registryCycles = []registryCycle{ + {CycleID: 2, RunID: 20, Verdict: "pass", AggregatedAt: &now}, + {CycleID: 1, RunID: 19, Verdict: "partial", SelfCheckFailedOn: []string{"older-validator"}}, } ts := newTestServer(t, caURL) @@ -651,8 +656,31 @@ func TestRegistryPageAndDetail(t *testing.T) { if !strings.Contains(detail, "9.9.9.9") { t.Fatalf("expected detail page to show the address, got:\n%s", detail) } - if !strings.Contains(detail, "https://example.test") { - t.Fatalf("expected detail page to list retained checks, got:\n%s", detail) + const collapsedCycle = `
` + cards := strings.Split(detail, collapsedCycle) + if len(cards) != 3 { + t.Fatalf("expected two initially collapsed cycles, got %d:\n%s", len(cards)-1, detail) + } + first, second, _ := strings.Cut(cards[2], "
") + for _, tc := range []struct { + card string + want []string + unrelated string + }{ + {cards[1], []string{fmtTime(now), "Запуск №20", "Цикл №2", "Успешно 1 из 1", "https://new.example.test", "События", `class="trace-output">trace of cycle two`}, "older-validator"}, + {first, []string{fmtTime(now.Add(-time.Hour)), "Запуск №19", "Цикл №1", "Успешно 0 из 1", "https://old.example.test", "Self-check не прошёл на: older-validator"}, "trace of cycle two"}, + } { + for _, want := range tc.want { + if !strings.Contains(tc.card, want) { + t.Fatalf("expected %q in cycle card:\n%s", want, tc.card) + } + } + if strings.Contains(tc.card, tc.unrelated) { + t.Fatalf("found another cycle's data %q in:\n%s", tc.unrelated, tc.card) + } + } + if strings.Contains(second, "https://old.example.test") { + t.Fatal("historical check escaped its cycle card") } notFound := get(t, ts, "/registry/1.2.3.4") diff --git a/internal/dashboard/registry_cycles.go b/internal/dashboard/registry_cycles.go new file mode 100644 index 0000000..7d19d90 --- /dev/null +++ b/internal/dashboard/registry_cycles.go @@ -0,0 +1,118 @@ +package dashboard + +import ( + "encoding/json" + "sort" + "time" +) + +type registryCycleView struct { + ipDetailView + CycleID int + RunID int64 + Date time.Time + Passed int + Badge Badge +} + +func buildRegistryCycles(history registryHistoryResponse) []registryCycleView { + cycles := map[int]*registryCycleView{} + cycleFor := func(id int) *registryCycleView { + if cycles[id] == nil { + cycles[id] = ®istryCycleView{CycleID: id} + } + return cycles[id] + } + for _, check := range history.Checks { + c := cycleFor(check.CycleID) + c.Detail.Checks = append(c.Detail.Checks, check) + c.Detail.IP.AttemptNumber = check.AttemptNumber + if check.ValidatorID != "" { + c.Detail.IP.OwnerValidatorID = &check.ValidatorID + } + if check.Success { + c.Passed++ + } + if check.CheckedAt.After(c.Date) { + c.Date = check.CheckedAt + } + } + for _, e := range buildEventViews(history.Events) { + c := cycleFor(e.CycleID) + c.Events = append(c.Events, e) + } + if ip := history.CurrentIP; ip != nil && (ip.State != "queued" || cycles[ip.CycleID] != nil) { + c := cycleFor(ip.CycleID) + c.Detail.IP = *ip + c.HasQueueData = true + } + for _, meta := range history.Cycles { + if c := cycles[meta.CycleID]; c != nil { + c.RunID = meta.RunID + c.Detail.SelfCheckFailedOn = meta.SelfCheckFailedOn + if !c.HasQueueData { + c.Detail.IP.OverallResult = meta.Verdict + c.Detail.IP.AggregatedAt = meta.AggregatedAt + } + } + } + out := make([]registryCycleView, 0, len(cycles)) + for _, c := range cycles { + if !c.HasQueueData { + c.restoreEventMetadata() + } + ip := c.Detail.IP + switch { + case c.HasQueueData: + c.Badge = ipBadge(ip.State, ip.OverallResult, ip.FIPAssociatedAt, 0) + case ip.State == "occupied": + c.Badge = ipBadge(ip.State, "", nil, 0) + case ip.OverallResult != "": + c.Badge = ipBadge("done", ip.OverallResult, nil, 0) + } + switch { + case ip.AggregatedAt != nil: + c.Date = *ip.AggregatedAt + case c.Date.IsZero() && len(c.Events) > 0: + c.Date = c.Events[0].OccurredAt + case c.Date.IsZero() && ip.AssignedAt != nil: + c.Date = *ip.AssignedAt + case c.Date.IsZero(): + c.Date = ip.CreatedAt + } + out = append(out, *c) + } + sort.Slice(out, func(i, j int) bool { return out[i].CycleID > out[j].CycleID }) + return out +} + +func (c *registryCycleView) restoreEventMetadata() { + ip := &c.Detail.IP + for _, e := range c.Events { + switch e.EventType { + case "aggregated": + var payload struct{ Result string } + if ip.OverallResult == "" && json.Unmarshal([]byte(e.Payload), &payload) == nil { + switch payload.Result { + case "pass", "partial", "fail": + ip.OverallResult = payload.Result + ip.AggregatedAt = &e.OccurredAt + } + } + case "force_cancel": + if ip.OverallResult == "" { + ip.OverallResult = "cancelled" + ip.AggregatedAt = &e.OccurredAt + } + case "fip_occupied": + ip.State = "occupied" + case "fip_associated": + var payload struct { + ValidatorID string `json:"validator_id"` + } + if ip.OwnerValidatorID == nil && json.Unmarshal([]byte(e.Payload), &payload) == nil && payload.ValidatorID != "" { + ip.OwnerValidatorID = &payload.ValidatorID + } + } + } +} diff --git a/internal/dashboard/static/dashboard.css b/internal/dashboard/static/dashboard.css index 2fcffe6..132d046 100644 --- a/internal/dashboard/static/dashboard.css +++ b/internal/dashboard/static/dashboard.css @@ -407,6 +407,18 @@ tbody tr:hover { background: var(--surface-alt); } td.addr { font-family: var(--font-mono); font-size: 13px; } td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-muted); } .table-scroll { overflow-x: auto; } + +.registry-cycles { display: grid; gap: 8px; } +.registry-cycle { + min-width: 0; + background: var(--surface); + border: 1px solid var(--border); + border-radius: var(--radius-md); +} +.registry-cycle > summary { padding: 10px 14px; cursor: pointer; } +.registry-cycle > summary:hover, .registry-cycle[open] > summary { background: var(--surface-alt); } +.registry-cycle > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } +.registry-cycle-body { padding: 12px 14px 16px; border-top: 1px solid var(--border); } .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; } /* ---------- status tags (square, not pill) ---------- */ diff --git a/internal/dashboard/templates/ip_detail.html b/internal/dashboard/templates/ip_detail.html index 7d4b4ab..ff37f84 100644 --- a/internal/dashboard/templates/ip_detail.html +++ b/internal/dashboard/templates/ip_detail.html @@ -26,8 +26,12 @@

{{.Detail.IP.IPAddress}} {{$b.Label}}

Полная история проверок этого адреса за всё время →

+{{template "ip_check_cycle" .}} +{{end}} + +{{define "ip_check_cycle"}}

-попытка {{.Detail.IP.AttemptNumber}} (повторов: {{.Detail.IP.RetryCount}}) +попытка {{if .Detail.IP.AttemptNumber}}{{.Detail.IP.AttemptNumber}}{{else}}—{{end}} (повторов: {{if .HasQueueData}}{{.Detail.IP.RetryCount}}{{else}}—{{end}}) · валидатор {{deref .Detail.IP.OwnerValidatorID}}

@@ -36,7 +40,7 @@

{{if .Detail.SelfCheckFailedOn}}

Self-check не прошёл на: {{join .Detail.SelfCheckFailedOn ", "}}

{{end}} -

Проверки (попытка {{.Detail.IP.AttemptNumber}})

+

Проверки{{if .Detail.IP.AttemptNumber}} (попытка {{.Detail.IP.AttemptNumber}}){{end}}

{{if .Detail.Checks}}
diff --git a/internal/dashboard/templates/registry_detail.html b/internal/dashboard/templates/registry_detail.html index cbdbe6e..21d4389 100644 --- a/internal/dashboard/templates/registry_detail.html +++ b/internal/dashboard/templates/registry_detail.html @@ -36,24 +36,26 @@

{{if .History.SelfCheckFailedOn}}

Self-check не прошёл на: {{join .History.SelfCheckFailedOn ", "}}

{{end}} -

История проверок (все сохранённые циклы)

-{{if .History.Checks}} -
-
- - - -{{range .History.Checks}} - - - - - - +

История проверок

+{{if .Cycles}} +
+{{range .Cycles}} +
+ +{{if .Date.IsZero}}—{{else}}{{end}} +· {{if .RunID}}Запуск №{{.RunID}} · {{end}}Цикл №{{.CycleID}} +{{if .Badge.Label}}{{.Badge.Label}}{{end}} +{{if .Detail.Checks}} +· Успешно {{.Passed}} из {{len .Detail.Checks}} +{{else}} +· Проверок нет {{end}} -
-
ЦиклИсточникТипЦельУспехЗадержка, мсВремяДетали
{{.CycleID}}{{.Source}}{{.CheckType}}{{.Target}}{{if .Success}}ok{{else}}fail{{end}}{{.LatencyMS}}{{fmtTime .CheckedAt}}{{.Detail}}
+ +
+{{template "ip_check_cycle" .}}
+ +{{end}}

Если глубина истории (см. настройки) ограничена, здесь показаны только сохранённые циклы — более старые уже вытеснены.

diff --git a/internal/db/queries_events.go b/internal/db/queries_events.go index 20460e2..e50b314 100644 --- a/internal/db/queries_events.go +++ b/internal/db/queries_events.go @@ -37,6 +37,20 @@ func (d *DB) ListEventsForIP(ctx context.Context, ipID int64) ([]Event, error) { return scanEvents(rows) } +// ListEventsForRegistry includes events whose queue row has been deleted. +func (d *DB) ListEventsForRegistry(ctx context.Context, registryID int64) ([]Event, error) { + rows, err := d.QueryContext(ctx, ` + SELECT id, source_type, source_id, ip_id, registry_id, cycle_id, event_type, payload, occurred_at, created_at + FROM events WHERE registry_id=? AND cycle_id>0 + ORDER BY julianday(occurred_at) DESC, id DESC + `, registryID) + if err != nil { + return nil, err + } + defer rows.Close() + return scanEvents(rows) +} + func (d *DB) ListRecentEvents(ctx context.Context, limit int) ([]Event, error) { rows, err := d.QueryContext(ctx, ` SELECT id, source_type, source_id, ip_id, registry_id, cycle_id, event_type, payload, occurred_at, created_at diff --git a/internal/db/queries_registry.go b/internal/db/queries_registry.go index 163cf80..58fce80 100644 --- a/internal/db/queries_registry.go +++ b/internal/db/queries_registry.go @@ -603,6 +603,61 @@ func lastCycleResultFromChecks(ctx context.Context, d *DB, registryID int64) (st } } +type RegistryCycle struct { + CycleID int `json:"cycle_id"` + RunID int64 `json:"run_id"` + Verdict string `json:"verdict"` + AggregatedAt *time.Time `json:"aggregated_at"` + SelfCheckFailedOn []string `json:"self_check_failed_on"` +} + +// ListRegistryCycles adds run verdicts and self-check failures to the cycles +// that still have queue data, checks, or events. Analytics can keep results +// after registry history is pruned. +func (d *DB) ListRegistryCycles(ctx context.Context, registryID int64) ([]RegistryCycle, error) { + rows, err := d.QueryContext(ctx, ` + WITH evidence AS ( + SELECT cycle_id, run_id FROM checks WHERE registry_id=?1 + UNION ALL + SELECT DISTINCT cycle_id, NULL FROM events WHERE registry_id=?1 AND cycle_id>0 + UNION ALL + SELECT cycle_id, run_id FROM ip_queue WHERE registry_id=?1 + ), cycles AS ( + SELECT cycle_id, MAX(run_id) AS run_id FROM evidence GROUP BY cycle_id + ) + SELECT c.cycle_id, COALESCE(c.run_id, r.run_id, 0), + COALESCE(CASE WHEN r.verdict_derived=0 THEN r.verdict END, ''), + CASE WHEN r.verdict_derived=0 THEN r.aggregated_at END, + (SELECT json_group_array(validator_id) FROM ( + SELECT DISTINCT validator_id FROM ip_self_check_failures + WHERE registry_id=?1 AND cycle_id=c.cycle_id ORDER BY validator_id + )) + FROM cycles c LEFT JOIN run_results r ON r.registry_id=?1 AND r.cycle_id=c.cycle_id + ORDER BY c.cycle_id DESC + `, registryID) + if err != nil { + return nil, err + } + defer rows.Close() + var cycles []RegistryCycle + for rows.Next() { + var c RegistryCycle + var aggregatedAt sql.NullString + var failures string + if err := rows.Scan(&c.CycleID, &c.RunID, &c.Verdict, &aggregatedAt, &failures); err != nil { + return nil, err + } + if c.AggregatedAt, err = nullStringToTimePtr(aggregatedAt); err != nil { + return nil, err + } + if err := json.Unmarshal([]byte(failures), &c.SelfCheckFailedOn); err != nil { + return nil, err + } + cycles = append(cycles, c) + } + return cycles, rows.Err() +} + func scanRegistryItems(rows *sql.Rows) ([]RegistryItem, error) { var out []RegistryItem for rows.Next() { diff --git a/internal/httpapi/handlers_registry.go b/internal/httpapi/handlers_registry.go index 6d816c5..536a536 100644 --- a/internal/httpapi/handlers_registry.go +++ b/internal/httpapi/handlers_registry.go @@ -1,6 +1,8 @@ package httpapi import ( + "database/sql" + "errors" "fmt" "net/http" "net/netip" @@ -111,11 +113,29 @@ func (s *Server) handleAdminRegistryHistory(w http.ResponseWriter, r *http.Reque writeError(w, http.StatusInternalServerError, err.Error()) return } + events, err := s.DB.ListEventsForRegistry(r.Context(), summary.ID) + if err != nil { + writeDBError(w, err) + return + } + cycles, err := s.DB.ListRegistryCycles(r.Context(), summary.ID) + if err != nil { + writeDBError(w, err) + return + } + currentIP, err := s.DB.GetIPByAddress(r.Context(), summary.IPAddress) + if err != nil && !errors.Is(err, sql.ErrNoRows) { + writeDBError(w, err) + return + } writeJSON(w, http.StatusOK, struct { - Registry registryDTO `json:"registry"` - Checks []db.Check `json:"checks"` - SelfCheckFailedOn []string `json:"self_check_failed_on"` - }{registrySummaryToDTO(*summary), checks, failedOn}) + Registry registryDTO `json:"registry"` + Checks []db.Check `json:"checks"` + SelfCheckFailedOn []string `json:"self_check_failed_on"` + Events []db.Event `json:"events"` + Cycles []db.RegistryCycle `json:"cycles"` + CurrentIP *db.IPQueueItem `json:"current_ip,omitempty"` + }{registrySummaryToDTO(*summary), checks, failedOn, events, cycles, currentIP}) } func registrySummaryToDTO(s db.RegistrySummary) registryDTO { diff --git a/internal/httpapi/handlers_registry_test.go b/internal/httpapi/handlers_registry_test.go index 2d09367..6a6d614 100644 --- a/internal/httpapi/handlers_registry_test.go +++ b/internal/httpapi/handlers_registry_test.go @@ -106,8 +106,11 @@ func TestRegistryHistoryOutlivesIPDeletion(t *testing.T) { t.Fatalf("registry history: status=%d body=%s", resp.StatusCode, body) } var hist struct { - Registry registryDTO `json:"registry"` - Checks []db.Check `json:"checks"` + Registry registryDTO `json:"registry"` + Checks []db.Check `json:"checks"` + Events []db.Event `json:"events"` + Cycles []db.RegistryCycle `json:"cycles"` + CurrentIP *db.IPQueueItem `json:"current_ip"` } if err := json.Unmarshal(body, &hist); err != nil { t.Fatalf("unmarshal registry history: %v", err) @@ -121,6 +124,18 @@ func TestRegistryHistoryOutlivesIPDeletion(t *testing.T) { if hist.Registry.InQueue { t.Fatalf("expected registry entry to report not-in-queue after delete, got %+v", hist.Registry) } + if hist.CurrentIP != nil || len(hist.Cycles) != 1 || hist.Cycles[0].CycleID != item.CycleID || + hist.Cycles[0].RunID == 0 || hist.Cycles[0].Verdict != item.OverallResult || hist.Cycles[0].AggregatedAt == nil { + t.Fatalf("expected archived cycle with its own verdict and timestamp, got %+v", hist.Cycles) + } + if len(hist.Events) == 0 { + t.Fatal("expected archived events") + } + for _, event := range hist.Events { + if event.CycleID != item.CycleID || event.IPID != nil { + t.Fatalf("event should stay attached to the archived cycle, got %+v", event) + } + } // Resubmitting starts a second, distinct cycle on the same registry // entry rather than colliding with the first. @@ -141,6 +156,10 @@ func TestRegistryHistoryOutlivesIPDeletion(t *testing.T) { if !hist.Registry.InQueue { t.Fatalf("expected registry entry to report in-queue again, got %+v", hist.Registry) } + if hist.CurrentIP == nil || len(hist.Cycles) != 2 || hist.Cycles[0].CycleID != hist.CurrentIP.CycleID || + hist.Cycles[1].CycleID != item.CycleID || hist.Cycles[0].RunID == hist.Cycles[1].RunID { + t.Fatalf("expected current and archived cycles from different runs, got %+v", hist.Cycles) + } _, body = fc.do(http.MethodGet, "/api/v1/admin/registry", nil) var all []registryDTO