Repository navigation
Runs: say how each run was started and by whom (trigger on the runs API) - #335
Merged
Merged
Conversation
The runs list and a run now carry `trigger` {kind, label, ref, ref_url, by},
worked out on the server from the run's own fields: ticket_source, the
ticket id's prefix (E2E-FIX-, E2E-GEN-, LOG-, ALERT-), requester_* or the
older sender, and the plan a ticket came from. Coderhelm's own work reads
"Started by Coderhelm · flaky test" with a link to the test instead of its
internal ticket id. Alerts and log findings link to the event and the
finding; Jira tickets to the team's site; GitHub issues to the issue.
GET /api/runs takes `started_by` (jira, github, coderhelm, alert, plan,
dashboard, chat), applied while it scans like the other filters.
Plans: when a plan's task opens a GitHub issue or a Jira ticket, the
worker records the link (settings PLAN_TICKET#...) before the label that
starts the run, copies the plan's id, title and runner onto the run it
starts, and marks a run that started first (a Jira webhook can win).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The runs list showed
<ticket id> · <repo>, so a run Coderhelm started itself read asE2E-FIX-a7f51433483adf820849, and nothing said whether a run came from Jira, GitHub, an alert, a log finding, a plan or a person in the dashboard. The runs API now sends atriggerobject worked out on the server, and the list can filter on it.Changes
triggeronRunSummaryandRun(gateway/src/routes/run_trigger.rs):{kind, label, ref, ref_url, by}.kindis one ofjira,github,coderhelm,alert,plan,dashboardorchat. It is read from the run's own fields:plan_id,ticket_source, the ticket id prefix (E2E-FIX-,E2E-GEN-,LOG-,ALERT-), andrequester_key(falling back tosenderon older runs).label,refandref_urlgive the words and the link:<site>/browse/KEY.#N, linking to the issue./tests/test?id=./logs?finding=. It iscoderhelmwhen the automatic fix started it anddashboardwhen a person did./alerts/detail?id=./plans/detail?id=.dashboardwhen a person ran it,coderhelmwhen a schedule or release did.byis the person's name, GitHub login or email. Jira runs that stored only an account id get the name from theJIRAUSER#record.byis null for Coderhelm's own work.BatchGetItemper page (100 keys per call, one retry for unprocessed keys). It reads the Jira site once, and only when the page has a Jira run. If a record can't be read, that run just has no link.started_byonGET /api/runs(comma-separated kinds; unknown words are ignored).RunFilterapplies it while it scans, likestatusandrepo.LIST_ATTRSnow also projects the fieldskindreads.worker/src/passes/plan_execute.rs,create_run_record):PLAN_TICKET#github#owner/repo#NorPLAN_TICKET#jira#KEYin the settings table, holding the plan's id, title and the person who ran it. For GitHub this happens before the label that starts the run.create_run_recordcopiesplan_id,plan_titleandplan_byonto the run.ticket-index.docs/api/openapi.jsonwas regenerated (RunTrigger,TriggerKind, thestarted_byparam).What this leaves out:
chatkind is there forslack:andteams:requester keys, but today that filter will always be empty.Verification
cargo fmt --check --all,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace: all pass. That includes 12 newrun_triggertests (one per kind, Jira name lookup, internal id never shown, links, filter words) and arun_searchtest forstarted_by.UPDATE_OPENAPI=1 cargo test -p gateway openapi, then the committed-document check passes.ui/run-trigger-source) readstriggerandstarted_by, with e2e coverage for each kind.