Show who requested a test run on the run it produced (follow-up to #55)

Aperta
#256 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
postgresql, python, typescript

Direzione di ricerca

Read app/src/lib/processes/storage.ts and the ApiProcessRun type, then trace how GET /api/processes/[id]/runs builds its response. Update the runs list in app/src/components/processes/ProcessDetailPage.tsx and the storage or API test named in the acceptance criteria; document the requester in docs/processes.md. Done means test runs show their requester and marker, while triggered and cron runs return null; keep the issue blocked until #55 merges.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

blocked enhancement
Spec section

docs/superpowers/specs/2026-08-29-phase9-processes-design.md §4 (test runs through the process_checks bridge); ADR 0004.

Plan

none — write one first with superpowers:writing-plans

Depends on

#55 (the process_checks drain that links a check to its run). Keep blocked until its PR merges.

Task

Follow-up from the #55 risk review (item 9c). Who asked for a test run is recorded on the request, but not on the run it produces.

When someone clicks Run once on a process page, POST /api/processes/[id]/test (app/src/pages/api/processes/[id]/test.ts) inserts a stac_higher.process_checks row with requested_by = the caller's identity, and the middleware writes one audit_log row (test on process). After #55, the pipeline's pipeline.process_check_drain (services/pipeline/src/pipeline/jobs/process_checks.py) turns that row into an ordinary process_runs row with is_test = true and stores its id in process_checks.run_id.

The run itself carries no requester. In the runs list on /processes/[id], and in GET /api/processes/[id]/runs, a test run looks like any other run. Nothing says it was a test or who started it, and the audit row does not name the run. To answer "who started run X?" today you have to join process_checks.run_id to the run by hand.

Suggested approach (no migration): have the runs read path (app/src/lib/processes/storage.ts, the process_runs SELECT behind ApiProcessRun) LEFT JOIN process_checks on run_id and return requested_by (null for triggered runs), and show it in RunRow (app/src/components/processes/ProcessDetailPage.tsx) together with a "Test run" marker based on the existing is_test field. A process_checks row is pruned after PROCESS_CHECKS_RETENTION_DAYS (30). If the requester must outlive that, the alternative is a process_runs.requested_by column written by the drain. That needs a reserved migration number and the migration label. Decide in the plan.

Acceptance criteria
  • GET /api/processes/[id]/runs returns requested_by for a test run started from the UI and null for triggered and cron runs; covered by a storage/API test.
  • The runs list marks test runs and shows who requested them.
  • If the column route is chosen: the migration is pinned in processes-migration.test.ts, and the drain writes the column (pytest).
  • npm run verify green (plus uv run pytest and uv run ruff check . if the pipeline changes).
  • docs/processes.md "Test runs" mentions where the requester shows.
Files in scope

app/src/lib/processes/storage.ts
app/src/components/processes/ProcessDetailPage.tsx
app/src/tests/ (storage/API test for the runs list)
docs/processes.md
(only if the column route is chosen) app/src/lib/db/migrate.ts, services/pipeline/src/pipeline/process/repo.py, services/pipeline/src/pipeline/jobs/process_checks.py

Lead-only steps

Live check on the compose stack: click Run once, then confirm the resulting run row shows the requester.

Migration number reserved

None for the suggested approach.

Lingua principale
Python
Stelle
0
Fork
2
Merge medio
8h 26m
PR unite (30g)
47

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TechTraverse/stac-higher

Tutte le issue di TechTraverse/stac-higher

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.