Run detail and log diagnosis
Pipedash lets users move from a pipeline's run history to one run's details and job logs. The UI keeps the run identity as a pipeline ID plus run number. The client then uses shared run and log queries to show provider data, live changes, and job output. For the wider monitoring model, see Pipeline monitoring, Pipeline dashboard, and Metrics and observability.
Run history
The run history is the main entry point for diagnosis. It shows recorded runs for one pipeline and lets the user narrow the list before opening a run.
History route
The pipeline detail route is /pipelines/:pipelineId. It opens on the History tab. The optional ?tab=metrics query selects the Metrics tab instead. Desktop uses a table with paging. Mobile uses a run list that loads more records as the user reaches the end. Both views open the same run detail flow. An invalid tab value is removed from the URL instead of creating a separate view.
The history view supports these user-facing filters and actions:
- Text search across the run's searchable context.
- Run status, branch, actor, and date-range filters.
- Sort and page selection on desktop.
- Load-more behavior on mobile and an option to search older runs when the source has more history to scan.
- Provider-defined column choices on desktop. Saved choices keep known columns in the user's order, while new provider columns appear after them.
- Selection of cancellable runs for a bulk cancel action when the provider allows it.
References: src/…/PipelineDetailRoute.tsx• L25-64 src/…/RunHistoryPage.tsx• L33-81 src/…/RunHistoryFilters.tsx• L17-58 src/…/RunHistoryResults.tsx• L97-185 src/…/useTableColumns.dom.test.ts• L36-63 src/…/columnCustomization.test.ts• L16-25
Bulk cancellation
Bulk cancellation lets a user stop several active runs from the history view. The action only accepts runs that the provider marks as cancellable and keeps the selection tied to the current pipeline and page, so a page change does not carry old run choices into a new list.
Before confirmation, Pipedash checks the provider again for current cancellation targets. It groups the targets by provider and shows runs that could not be read or cannot be cancelled. A failed check shows an error with Retry instead of offering a misleading empty result.
After confirmation, the service sends the targets in bounded batches and combines the results into one summary. A failed request keeps the dialog available for retry and resumes from the first unfinished batch. Successful targets invalidate their run history and pipeline list, while partial failures remain visible in the summary so the user can distinguish completed cancellations from runs that still need attention.
References: src/…/useBulkCancelRuns.tsx• L24-92 src/…/CancelActiveRunsModal.tsx• L39-129 src/…/useCancelRuns.ts• L18-65 src/…/CancelActiveRunsModal.test.ts• L196-341
History data
The history query requests pages for the selected pipeline with the active filters and sort order. Until the user chooses a sort, the view follows the order returned by the provider. Desktop can increase the scan depth when older matching runs are not in the current result. Mobile keeps the loaded pages as one list. Run-triggered events and successful trigger actions refresh the matching history without changing the route.
The page shows different empty states for no runs, no filter matches, and a source that has not yet scanned enough history. A failed later page keeps the earlier rows visible and offers a retry for that page. This helps the user tell an empty pipeline from an incomplete or failed search.
References: src/…/useRunHistoryPageData.ts• L49-141 src/…/useRunHistoryEvents.ts• L12-55 src/…/RunHistoryResults.tsx• L23-185 src/…/RunHistoryTable.tsx• L19-79 src/…/useWorkflowQueries.ts• L49-65
Run detail
Run detail joins the provider's current run record with actions that help the user confirm or resolve its state. It appears in a modal, so the pipeline history remains the user's navigation context.
Detail modal
Opening a history row stores the pipeline ID and run number in the modal state. The modal loads the run record and shows provider-defined fields such as status, timing, branch, commit, actor, and message when those fields are available. Detail fields can include data that is hidden from the history table, so the modal is the fuller view of one run. It also exposes provider-supported actions such as cancel, rerun, review, watch, and opening the provider page. Cancellation can offer one normal or force option, while rerun can offer all jobs or failed jobs only.
On desktop, a run with log access opens a full-height modal with Logs and Details tabs. The Logs tab shows the selected job and can offer a provider-authorized Re-run job action for that job. The action asks for confirmation, then refreshes the run history and job tree after success. On narrower screens, the details view opens first. The user selects a job from that view to open its log in a separate full-height screen.
References: src/…/WorkflowLogsModal.tsx• L69-209 src/…/WorkflowLogTabs.tsx• L30-74 src/…/RunDetailFields.tsx• L48-103 src/…/RunActionsFooter.tsx• L24-74 src/…/runActions.tsx• L47-132 src/…/RerunJobBar.tsx• L16-47 src/…/useRunHistoryQueries.ts• L211-264 src/…/RerunJobBar.test.tsx• L89-123
Live run details
Pending and running runs show their current status and duration. The detail view states that the provider may still change the data. Run-update events replace the matching cached record, and the detail query continues to refresh live runs while the screen is open. A terminal update stops that refresh.
The detail view also gives users a clear state while a run is still active. It shows whether the run is waiting or running and reports its current duration. If a user requests cancellation, the view says that it is waiting for provider confirmation instead of treating the request as final. Archived runs can show a provider-supplied notice that explains why their data may differ from current run data. src/…/RunDetailsContent.tsx• L54-121
After a cancellation request, the detail view checks the provider more often for a short period, then returns to its normal heartbeat if the run is still active. It waits for the provider to confirm the final status. If the provider keeps an archived or reconciled record, the detail view can still show that record with its provider notice.
References: src/…/RunDetailsContent.tsx• L54-121 src/…/useRunDetailsQuery.ts• L15-67 src/…/useRunUpdatedEvent.ts• L8-51
Log inspection
Logs are organized around the jobs and steps that make up a run. The UI first loads a log tree, then opens one navigable job log at a time.
Job log tree
The tree gives each stage, job, or step its status, duration, parent, and log availability. It also provides a preferred job and a failed-first order when the provider supplies one. Desktop shows the jobs in a side list. Narrow layouts use a job selector. Mobile shows jobs below the run details.
Jobs without log output remain visible as context but cannot be opened. If the run has no usable jobs yet, the UI tells the user that jobs appear when the provider starts them. When the selected run allows a job rerun, the log view places the Re-run job action above that job's viewer. A successful rerun refreshes the run and its log tree so the user can follow the new job state.
References: src/…/logs.ts• L3-34 src/…/logTree.ts• L3-15 src/…/RunLogsPanel.tsx• L22-113 src/…/RerunJobBar.tsx• L16-47 src/…/useRunHistoryQueries.ts• L223-264 src/…/RerunJobBar.test.tsx• L89-123 src/…/MobileRunJobs.tsx• L24-59
Log viewer
The viewer presents provider log lines with status marks, timestamps, step sections, styles, links, and warning or error cues. It opens the relevant part of a large log as the user scrolls, so the screen can inspect logs without loading the full text at once. Lines that are not loaded yet show a loading state, and a failed line shows a retry action instead of a blank row.
Users can search plain text or regular expressions with optional case matching. They can move between matches or errors, show matching or error lines only, expand or collapse step sections, select and copy lines, show a full omitted line, download the log, or open the job in the provider. Desktop exposes these controls in a toolbar. Phone layouts use a compact search and action bar.
The viewer also explains the state of a log:
- A pending log waits for the job to finish.
- A loading log reports download progress.
- An unavailable log offers retry and the provider job link.
- A completed empty log means the job produced no output.
- A live log shows its last update and keeps its current output when a refresh fails.
- A truncated log directs the user to the provider for the rest. The viewer identifies the visible part as the first 1 GB.
References: src/…/LogViewer.tsx• L16-113 src/…/ReadyViewer.tsx• L34-264 src/…/LogToolbar.tsx• L18-175 src/…/LogBody.tsx• L151-273 src/…/LogRow.tsx• L196-274 src/…/LiveMarker.tsx• L15-39 src/…/FullLineModal.tsx• L23-73
Log queries
Opening a job first obtains a log document. The document returns a state and, when ready, a revision and summary data. The viewer uses that revision for line reads and searches, which keeps all diagnosis actions tied to one stable view of the log. For a live document, the backend keeps the current output while it checks for more data and publishes a new revision only when the view changes.
Search waits briefly after input changes before sending a query. A new search replaces the old result. Line reads request the visible part of the document and keep it available while the user moves through the log. The client limits concurrent line reads and retries a transient read once. A changed or missing revision causes the viewer to refresh the document instead of silently mixing old and new output. Users can copy a selected range within the copy limits, export the full log, or request the full text of one omitted line.
References: src/…/useRunLogQueries.ts• L63-152 src/…/useRunLogQueries.ts• L168-214 src/…/useLogSearch.ts• L37-87 src/…/useLogLines.ts• L6-44 src/…/lineCache.ts• L75-135 src/…/lineCache.ts• L197-329 src/…/useLogExport.ts• L24-59 src/…/ReadyViewer.tsx• L49-59
Log updates
Open logs update without a full page reload. Progress events update the received byte count. Ready, failed, and tree-change events refresh the matching document or job list. A tree or document that is still incomplete also receives foreground refreshes until it becomes complete. A refresh failure keeps the last usable lines and changes the live marker to a Retry state.
When new lines arrive, the viewer marks fresh output and shows how many lines are below the current position. The user can jump to the latest output. This keeps a diagnosis view useful while a build is still running without forcing the user away from an earlier line. If a line read reports that its revision is gone, the viewer reopens the document before reading again.
References: src/…/useRunLogQueries.ts• L69-152 src/…/events.ts• L49-52 src/…/useLiveTail.ts• L19-56 src/…/LiveMarker.tsx• L15-39 src/…/ReadyViewer.tsx• L86-104 src/…/ReadyViewer.tsx• L204-212
Log queries and backend access
The backend presents one model for remote web clients and local desktop clients. The web client uses HTTP routes. The desktop client calls the same core service through Tauri commands. Both paths return the same run-log tree, document states, line pages, search results, and download behavior.
Log access paths
The main log operations are exposed as follows:
| Operation | Purpose |
|---|---|
| Run log tree | List the stages, jobs, steps, status, and log availability for a run. |
| Open log | Return the state and metadata for one job log. |
| Read lines | Read a page from a stored log revision. |
| Search log | Find plain-text or regular-expression matches in a stored revision. |
| Download log | Stream the rendered log through a short-lived download ticket. |
The HTTP forms use /pipelines/{pipeline}/runs/{run}/logs.... The desktop forms use the matching get_run_log_tree, open_run_log, read_run_log_lines, and search_run_log commands. The client selects the service for the current host, so the UI does not need a separate diagnosis flow for web and desktop.
References: crates/…/run_logs.rs• L70-176 src/…/logs.ts• L39-87 src/…/logs.ts• L21-56 src/…/types.ts• L143-164
Stored log revisions
A log document has a revision so that line reads and searches use one stable view of the text. The backend may keep downloading a partial provider log while the UI reads it. A pending job is watched until it has a log, while a partial or running log is refreshed until it becomes complete. The backend keeps completed output when a later tree read fails, and it does not refresh a truncated document. If that revision is cleared or replaced, later reads fail and the UI must open the log again.
Search requests carry the text, regular-expression choice, case choice, and a client search session. The client keeps the active search result tied to the selected run, job, and revision. Provider changes, cache clears, and shutdowns stop old work so it cannot publish data into a newer session.
References: src/…/logs.ts• L65-126 src/…/lineCacheTypes.ts• L3-19 src/…/useLogSearch.ts• L12-46 crates/…/documents.rs• L44-109 crates/…/documents.rs• L221-273 crates/…/tests.rs• L869-950 crates/…/tests.rs• L1347-1386 crates/…/run_logs.rs• L109-139
Build-watch updates
Build watch is a local device feature for following one pending or running build while Pipedash is open. It is separate from log viewing: it tracks run status and sends updates to the native activity surface, while the normal run and log views remain the place for diagnosis.
Watch lifecycle
The user starts Watch run from a run detail view. The action is available only when the provider and local device support it. Only one watch can be active at a time. Pipedash checks that the selected provider and run still match, then sends status snapshots until the run reaches a terminal state or the user stops the watch.
This diagram shows how a watched run produces local status snapshots and updates the normal run views.
flowchart LR
A[Pending or running run] --> B[Start Watch run]
B --> C[Local run watch]
C --> D[Status snapshot]
D --> C
C --> E[Completed, stopped, or interrupted]
D --> F[Run and watch UI update]
Watching does not cancel the run. Desktop background mode controls whether monitoring can continue after the window closes, and iOS may interrupt monitoring. A watch session identity also protects a replacement watch from late end notices or provider-removal notices belonging to an older session.
References: src/…/RunDetailsContent.tsx• L66-99 src/…/BuildWatchControls.tsx• L94-125 src/…/useBuildWatchQueries.ts• L27-75 crates/…/tests.rs• L152-197 crates/…/tests.rs• L297-321
Watch update delivery
Native watch changes are published as build-watch-changed. The client updates the watch status and invalidates run queries so the history and detail views can show the latest provider state. A provider removal, app-session change, or unavailable local core interrupts the watch instead of leaving a stale session active.
The native side cancels only the session tied to the changed provider or end notice. It drops in-flight provider work after cancellation and queues each interruption once, so an old session cannot stop a newer watch or leave duplicate cleanup work.
References: src/…/useBuildWatchQueries.ts• L78-144 src/…/BuildWatchControls.tsx• L133-224 src/…/RunActionsContext.tsx• L26-131 crates/…/tests.rs• L95-150 crates/…/tests.rs• L212-294 crates/…/tests.rs• L323-344
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the
/pipelines/:pipelineIdroute, tab query normalization, modal run identity, mobile run-to-job transition, and provider deep-link identity aligned. - Keep history filter names, provider sort state, paging or scan-depth rules, table columns, and mobile load-more behavior aligned with the run-history query contract.
- Keep saved column order and visibility behavior aligned with provider schema changes so new columns remain usable and removed columns do not create empty table entries.
- Keep bulk-cancel selection scope, provider capability checks, target rediscovery, bounded batches, retry progress, and history invalidation aligned across the history view and cancellation service.
- Keep detail fields aligned with the provider table schema so fields hidden in history still appear when the run is opened.
- Keep job-rerun capability checks, provider confirmation text, selected job identity, and run or log-tree invalidation aligned across the log panel and run action query.
- Keep successful workflow triggers tied to run-list and pipeline invalidation so a newly started run appears without a stale history view.
- Keep the HTTP log routes, Tauri commands, service methods, and client query keys aligned for tree, document, line, search, and download operations.
- Keep log event payload names and run/node matching rules aligned so progress updates cannot refresh a different job.
- Keep log revision changes tied to line reads, searches, full-line reads, copies, and downloads.
- Keep line-cache revision reuse and eviction rules aligned with the backend's stable-line metadata.
- Keep build-watch status changes tied to run-query invalidation so a completed or interrupted watch cannot leave stale run data on screen.
- Keep build-watch session identity checks aligned across provider removal, native end notices, cancellation, and replacement watches.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Provider has no log capability or the run has no usable job | The run log tree cannot open a job log. | Show the empty or unavailable state and use the provider job link when one exists. |
| Run or provider does not allow a job rerun | The Re-run job action is not shown. | Check the run action and provider presentation before offering the control. |
| Job rerun succeeds but the run or log tree stays cached | The log view can show the old job state. | Invalidate run history and the matching log tree after the rerun. |
| Job log is pending or still downloading | The viewer shows a wait or progress state instead of stale text. | Use log events and foreground refresh until the document is ready. |
| Stored log revision is gone | Visible lines, searches, copies, or downloads return not found. | Reopen the job log to obtain a current revision. |
| A visible line fails to load | The row shows an explicit load error and diagnosis may be incomplete. | Retry the line or move through the log again after the read retry window. |
| Provider rate limit or changed provider data | The log becomes unavailable or an ingest attempt stops. | Retry after the provider cooldown or reopen the log. |
| Log output is truncated or a selected line has omitted text | The viewer does not show the full provider output. | Open the full line when offered or open the job in the provider. |
| A later history page fails | Earlier rows remain visible but the history is incomplete. | Retry the failed page before treating the list as complete. |
| Cancellation target discovery fails or finds unreadable pipelines | The dialog cannot confirm a complete cancellation set. | Show the error or skipped pipelines and retry discovery before confirming. |
| A cancellation batch fails or returns partial failures | Some runs remain active while earlier batches may already be complete. | Keep the action available for retry and show one summary with successful and failed targets. |
| A new provider column is absent from the saved table order | The user can miss a newly available run field. | Append schema columns that are not in saved order after known saved columns. |
| A workflow trigger fails | The user gets an error notification and no new run is shown. | Surface the provider error and keep the history unchanged. |
| A second build watch starts while one is active | The new watch is refused. | Stop the current watch before starting another. |
| Local core, provider, or app session changes during watch | The watch is interrupted. | Recheck watch ownership and start it again for the current session. |
| A late native notice belongs to an old watch session | A replacement watch could be stopped or its provider work could be cancelled. | Match notices to the current session before cancelling it. |
Key files
| File | Why to read it |
|---|---|
| src/…/PipelineDetailRoute.tsx | Defines the pipeline detail route and History/Metrics tab state. |
| src/…/RunHistoryPage.tsx | Connects history data, filters, events, actions, and the Metrics tab. |
| src/…/useRunHistoryPageData.ts | Shows how filters, provider sort state, scan depth, and desktop/mobile history queries fit together. |
| src/…/useBulkCancelRuns.tsx | Defines history selection scope and the confirmation entry point for bulk cancellation. |
| src/…/CancelActiveRunsModal.tsx | Shows cancellation target discovery, empty and error states, and retry behavior. |
| src/…/useCancelRuns.ts | Coordinates cancellation batches, resumable progress, result summaries, and run-history refresh. |
| src/…/CancelActiveRunsModal.test.ts | Shows guarantees for discovery errors, retry, bounded batches, and partial cancellation results. |
| src/…/useWorkflowQueries.ts | Shows how a successful workflow trigger refreshes the related run history and how trigger errors reach the user. |
| src/…/WorkflowLogsModal.tsx | Connects run details, log access, actions, and mobile behavior. |
| src/…/WorkflowLogTabs.tsx | Defines the desktop Logs/Details boundary and log-viewer keyboard focus path. |
| src/…/RunDetailsContent.tsx | Shows live run status, detail fields, archived notices, and build-watch entry. |
| src/…/RunLogsPanel.tsx | Connects the job tree to the selected log viewer and job rerun control. |
| src/…/RerunJobBar.tsx | Shows when a selected job can be rerun and passes its identity to the action. |
| src/…/useRunHistoryQueries.ts | Defines job-rerun confirmation and refreshes after a successful job rerun. |
| src/…/RerunJobBar.test.tsx | Shows guarantees for allowed and denied job rerun actions and log refresh. |
| src/…/useTableColumns.dom.test.ts | Shows how saved table choices handle new provider columns. |
| src/…/columnCustomization.test.ts | Shows the user-facing order and visibility rules for run columns. |
| src/…/LogViewer.tsx | Defines the states a user sees while a job log opens or fails. |
| src/…/ReadyViewer.tsx | Connects log search, line access, live tail, selection, copy, and download behavior. |
| src/…/lineCache.ts | Shows how visible log lines are requested, reused, retried, and evicted. |
| src/…/useRunLogQueries.ts | Shows log query states and event-driven updates. |
| crates/…/documents.rs | Defines the shared log document lifecycle and provider access. |
| crates/…/tests.rs | Shows the guarantees for live reads, revisions, tree refresh, failure recovery, and search isolation. |
| crates/…/run_logs.rs | Defines the HTTP contract for log access. |
| src/…/logs.ts | Maps web-client log actions to the HTTP contract and download flow. |
| src/…/useBuildWatchQueries.ts | Defines local watch ownership, native updates, and run-query refresh. |
| src/…/BuildWatchControls.tsx | Shows how users start, stop, and recover a build watch. |
| crates/…/tests.rs | Shows guarantees for single-watch ownership, session-safe interruption, cancellation, and native run links. |