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

Open
#256 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
70/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
postgresql, python, typescript

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
0
Forks
2
Avg merge
8h 26m
Merged PRs (30d)
47

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TechTraverse/stac-higher

All issues in TechTraverse/stac-higher

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.