Pipeline monitoring
Pipedash gives an engineer one place to see current pipeline state, past runs, live run progress, and longer-term health trends. The backend reads provider data, keeps a usable local view, and sends changes through a shared event boundary. The React client turns that data into filterable pipeline views and links each signal to history, run detail, logs, or metrics.
Monitoring model
Pipedash treats a pipeline as the link between a provider resource and its runs. A pipeline carries its current status and last-run signal. It can also carry a learned run cadence, which helps show when a normally active pipeline has gone quiet. A run adds the detail needed to explain one execution. Metrics add a time view over many runs. crates/…/cadence.rs• L24-51
| Signal | Purpose |
|---|---|
| Pipeline state | Shows what needs attention now. |
| Run history | Shows how one pipeline behaved over time. |
| Live execution | Shows whether a pending or running execution has moved. |
| Cadence | Shows whether a pipeline has stopped running near its usual schedule. |
| Metrics | Shows longer trends in duration, success, and run frequency. |
The main status values split into active work and finished work. Failed and degraded states need attention. A live run can also carry pace signals: it can be past its usual duration, or it can be overdue under the stronger overdue rule. A pending run can be waiting in the queue or marked as stuck when it passes the provider queue limit. A pipeline can be quiet when the time since its last run exceeds twice its learned usual gap. crates/…/pipeline.rs• L22-60 crates/…/pipeline.rs• L63-130 crates/…/timing.rs• L13-33 crates/…/cadence.rs• L199-221
Pipeline state
The pipeline state view is the main monitoring surface. It combines provider-backed pipeline data with saved views, pins, hidden items, filters, and sections so an engineer can focus on the pipelines that matter.
Pipeline views
A pipeline view is a named selection of pipelines. It can show all pipelines, pinned pipelines, or a custom set built from rules and direct members. Custom views can sit below other views, which lets the navigation reflect the way a team groups its work. crates/…/pipeline_view.rs• L148-206 crates/…/page.rs• L146-225
The backend resolves membership before it builds a page. It then applies provider, status, organization, date, and text filters. The page can group the result by repository, organization, provider, status, or no section. The client keeps these choices in the URL, so a view can be shared and restored without changing its meaning. crates/…/filters.rs• L12-85 crates/…/page.rs• L256-386 src/…/usePipelineViewModel.ts• L99-145
References: crates/…/pipeline_view.rs• L148-206 crates/…/page.rs• L146-225 crates/…/filters.rs• L12-85 src/…/usePipelineViewModel.ts• L99-145
Navigation and display
The client presents views, providers, and pinned shortcuts as one navigation tree. Search keeps matching views and their parent paths visible. Sidebar expansion persists locally and reopens the path to the active view, so an engineer can move through a saved hierarchy without losing context. The compact navigation rail also shows the total pipeline count only after the all-provider data is available, so a load or read error is not shown as a count. src/…/Navbar.tsx• L47-132 src/…/NavbarTree.tsx• L68-113 src/…/useSidebarExpansion.ts• L22-57 src/…/NavbarRail.tsx• L119-158
The same page can use a table, cards, or a mobile list while keeping pipeline state and actions the same. Sections can expand or collapse. Pinned pipelines and repositories remain visible as a separate focus area. On mobile, pinned pipelines support direct history access and manual ordering when the view uses manual sort. The card view adapts its columns to the available width and keeps long lists usable through virtual scrolling. Provider presentation metadata supplies the labels and terms used for different provider resource types. src/…/usePipelineViewModel.ts• L142-190 src/…/PipelineRowsTable.tsx• L172-220 src/…/PipelineCardGrid.tsx• L35-70 src/…/PipelineCardGrid.tsx• L136-165 src/…/MobilePipelineCards.tsx• L198-221 src/…/IosPinnedList.tsx• L84-176 src/…/PipelinePinnedArea.tsx• L65-119
Views are also a user-managed organization layer. Engineers can create views, add pipelines to several views, nest sub-views, pin views or repositories, and change the order of views or pinned pipelines. The client holds the new order while the backend saves it, then restores the prior order if the save fails. src/…/AddToViewModal.tsx• L52-126 src/…/ViewEditorModal.tsx• L63-129 src/…/useViewReorderQueries.ts• L22-92
References: src/…/Navbar.tsx• L47-132 src/…/NavbarTree.tsx• L68-227 src/…/useSidebarExpansion.ts• L22-57 src/…/usePipelineViewModel.ts• L142-190 src/…/PipelineRowsTable.tsx• L172-220 src/…/PipelineCardGrid.tsx• L35-70 src/…/PipelineCardGrid.tsx• L136-165 src/…/MobilePipelineCards.tsx• L198-221 src/…/IosPinnedList.tsx• L84-176 src/…/PipelinePinnedArea.tsx• L65-119 src/…/useViewReorderQueries.ts• L22-92
Provider freshness
The backend fetches provider state on a schedule and also supports a focused refresh for one or more providers. A refresh uses a shared deadline, joins an in-flight forced fetch when possible, and reports recent, rate-limited, pending, or failed outcomes. A full refresh clears cached run history only for providers that do not retain history, then asks the health service to force overdue feeds. After a successful fetch, the service also recalculates overdue and cadence signals and publishes the changed pipeline view. crates/…/refresh.rs• L36-74 crates/…/refresh.rs• L76-199
The fetch path limits concurrent work, applies its provider deadline, and records the result as provider health. A failed fetch keeps the last usable pipeline cache while recording the new failure. A fetch from an old provider generation is discarded instead of replacing newer state. crates/…/fetch.rs• L39-99 crates/…/fetch.rs• L122-181 crates/…/refresh.rs• L85-129
The client keeps loading, no-provider, empty-view, hidden-only, provider-failure, and recovery states distinct. This distinction prevents an engineer from treating missing data as proof that no pipelines exist. src/…/PipelineViewStatus.tsx• L68-135 src/…/PipelineViewStatus.tsx• L152-267
A successful fetch publishes the provider’s pipeline set. It also reports real pipeline changes, newly attention-worthy pipelines, and newly finished pipelines. Unchanged fetches do not repeat those change signals. crates/…/fetch.rs• L184-273
References: crates/…/refresh.rs• L36-74 crates/…/refresh.rs• L76-199 crates/…/fetch.rs• L39-99 crates/…/fetch.rs• L122-181 crates/…/fetch.rs• L184-273 src/…/PipelineViewStatus.tsx• L68-267
Pipeline cadence
The cadence signal estimates a pipeline’s usual gap from the start times of recent runs. It needs enough run gaps to form a reliable median. When the time since the last run is more than twice that gap, the pipeline is marked quiet. Pipelines with too little history keep the signal unknown rather than appearing quiet. crates/…/cadence.rs• L199-221 crates/…/tests.rs• L94-155
Cadence learning runs per provider after a pipeline fetch. The service stages learned gaps before it applies them, limits new history fetches in one pass, and gives failed pipelines later chances so one provider problem does not block the rest. A run-cache invalidation drops a result learned from an older cache state, so the next pass can learn again. crates/…/cadence.rs• L53-186 crates/…/tests.rs• L194-321 crates/…/cache.rs• L34-53
References: crates/…/cadence.rs• L42-91 crates/…/cadence.rs• L96-186 crates/…/tests.rs• L94-155 crates/…/cache.rs• L34-53
Run history
Run history moves from a current pipeline signal to the executions that explain it. The backend fetches provider history, merges new and changed runs into the local cache, and keeps provider-specific retention rules in view. A bounded provider history can mark a cached run as archived instead of losing the fact that the run existed. crates/…/history.rs• L23-63 crates/…/history.rs• L66-181
History queries
The history view filters by status, branch, actor, and text. It sorts by provider-approved columns and paginates after filtering, so the count and page boundaries describe the matching history rather than only the first provider response. crates/…/query.rs• L33-63 crates/…/query.rs• L166-210
Some filters and value sorts need more history than the first provider page. The backend scans in bounded steps and reports an incomplete scan instead of presenting a partial result as a complete global sort. The client can then ask for a deeper scan. crates/…/query.rs• L65-164 crates/…/tests.rs• L272-409
References: crates/…/query.rs• L33-63 crates/…/query.rs• L65-164 crates/…/tests.rs• L272-409
History retention
The cache merge compares run content and metadata. It adds new runs, updates changed runs, removes stale runs when the provider no longer exposes them, and preserves runs that the provider can safely archive. A provider that retains history does not lose local runs when the pipeline changes or disappears briefly. crates/…/history.rs• L66-145 crates/…/cache.rs• L34-53
Run actions invalidate history only after the provider accepts the action. Providers that retain run history keep their cache and still publish a focused history invalidation event. Other providers clear the cache so the next history read cannot reuse stale runs. Actions on a run use fresh provider details before checking run capabilities, so an old cached action state cannot authorize an invalid operation. crates/…/actions.rs• L77-205 crates/…/cache.rs• L34-64
The client uses the selected pipeline as the context for history, run detail, logs, and metrics. The related pages describe the next steps in that path: Pipeline dashboard, Run detail and logs, and Metrics observability.
References: crates/…/history.rs• L66-181 crates/…/cache.rs• L34-64 crates/…/actions.rs• L77-205
Live execution
Live execution keeps an active run useful while its provider is still changing it. The backend can watch one run, check that the provider still refers to the selected pipeline and run number, and return a common snapshot for the client. The watch ends when the run reaches a terminal state. crates/…/run_watch.rs• L73-121 crates/…/watch_view.rs• L27-71
The watch also respects provider limits and session changes. A rate limit produces a retry condition. A changed provider generation makes the old watch invalid instead of allowing old data to replace newer state. crates/…/run_watch.rs• L123-234
Run pace gives the live view a useful time signal. A running run is past its usual duration when its elapsed time exceeds a positive typical duration. A pending run is counted as waiting in the queue unless it awaits review, and it is stuck when its elapsed time exceeds the provider queue limit. The service derives a typical duration from at least three successful runs with positive durations. Its stronger overdue signal marks a running run only when its elapsed time exceeds three times the median of those durations. If history is unavailable or the provider does not support the policy, the view leaves the timing signal unknown. crates/…/timing.rs• L13-33 crates/…/tests.rs• L23-65 crates/…/overdue.rs• L242-287
The overdue check uses cached recent runs when they exist. For uncached pipelines, it can obtain recent runs for a provider in one batch, then uses bounded concurrent checks for the remaining work. A failed lookup does not create a false overdue signal. crates/…/overdue.rs• L124-220
Monitoring actions
Monitoring can lead to provider actions. Pipedash checks the provider’s saved read-only mode and the current pipeline or run capabilities before it triggers, cancels, force-cancels, reviews, reruns, or enables work. A job rerun also verifies that the selected job belongs to the selected run. After the provider accepts an action, Pipedash invalidates the affected history and emits the event needed by related views. crates/…/actions.rs• L24-205
Bulk cancellation first scans provider history for unfinished runs. It uses bounded pages and deeper scans when needed, then groups targets by pipeline, skips unsupported pipelines, reports unreadable or incomplete scans, and splits discovery into batches of at most 1,000 runs. Individual cancellation calls use bounded concurrency, remove duplicate targets, and keep going after individual failures. The client refreshes affected providers after the request. crates/…/cancellation.rs• L25-101 crates/…/cancellation.rs• L140-218 src/…/useCancelActiveRuns.tsx• L20-49
References: crates/…/actions.rs• L24-205 crates/…/cancellation.rs• L25-218 crates/…/tests.rs• L115-205 crates/…/tests.rs• L221-407 src/…/useCancelActiveRuns.tsx• L20-49
Pipeline and run changes travel through the event bus. The backend emits pipeline updates, status changes, run triggers, cancellations, metric changes, and run updates. The client consumes these events through its shared service boundary and updates the related cached view or starts a focused refresh. crates/…/event.rs• L36-81
The following flow shows how provider state reaches the current view and then supports history, live detail, and metrics.
flowchart LR
A[Provider state and run changes] --> B[Pipeline service]
B --> C[Local pipeline and run data]
C --> D[Pipeline view]
D --> E[Run history]
E --> F[Live run detail and logs]
E --> G[Metrics view]
B --> H[Events]
H --> D
H --> E
H --> G
Metrics history
Metrics turn completed run data into a time-based view of pipeline health. Pipedash supports run duration, success rate, and run frequency. A global setting supplies defaults, while a pipeline can use its own enabled flag and retention period. Background extraction runs once per pipeline at a time and emits a metric event only when it stores new observations. crates/…/metrics.rs• L10-32 crates/…/metrics_service.rs• L34-101 crates/…/background.rs• L24-65
Metric collection
After run data is available, the backend can extract and store metrics in background work. History reads can supply either newly fetched or already cached runs. The service avoids duplicate metric work for one pipeline and emits a metric event when new observations exist. crates/…/query.rs• L104-120 crates/…/background.rs• L24-75 crates/…/event.rs• L69-81
References: crates/…/query.rs• L104-120 crates/…/background.rs• L24-75 crates/…/event.rs• L69-81
Metric views
The metrics view selects a time range, metric type, aggregation period, and aggregation method. It fills missing time periods so a quiet period remains visible. The available range cannot exceed the configured retention period. crates/…/dashboard.rs• L22-86 crates/…/metrics.rs• L48-66
References: crates/…/dashboard.rs• L22-86 crates/…/metrics.rs• L48-66
Metrics are optional. The client must distinguish disabled collection from enabled collection with no observations. When data exists, the same pipeline context connects the summary view to its detailed chart and table. Metrics observability covers the metric view in more detail.
Monitoring data flow
The service API is the contract between the backend and the React client. The backend returns pipeline pages, run history, run details, and metric dashboards. The client gives each data family its own cache identity, so a change can refresh the matching screens without rebuilding unrelated views. Provider refresh results also preserve the distinction between a completed refresh, a recent result, a pending result, and a missing provider. src/…/usePipelineViewQueries.ts• L112-187 crates/…/pipeline_view_service.rs• L68-81 crates/…/refresh.rs• L76-141
The monitoring cycle follows this order:
- A provider fetch supplies pipeline state and run data.
- The backend checks the provider result and updates local data only for the current provider generation. A forced refresh joins or waits for the current provider fetch instead of starting duplicate work.
- The backend recalculates timing and cadence signals, then emits an event for changed pipeline, run, or metric state.
- The client refreshes or updates the matching cached query.
- The engineer moves from state to history, live detail, logs, or metrics.
View edits, membership changes, pins, and reorders use the same contract. After a change, the client invalidates pages, views, navigation, pins, selections, editor data, and member data together so the navigation and the visible page do not disagree. Reorder mutations hold the user’s new order until the server confirms or rejects it. src/…/usePipelineViewQueries.ts• L51-60 src/…/useViewReorderQueries.ts• L22-92
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the pipeline page query aligned across URL state, backend filters, view facets, grouping, display options, and client row construction. A mismatch can leave a valid-looking URL with the wrong page.
- When provider fetch results or pipeline view membership change, keep page, view list, navigation, pin, selection, member, and editor queries in the same invalidation set.
- Preserve provider generation checks when changing scheduled refresh, forced refresh, run history, or live watch behavior. Old provider data must not replace current data.
- Preserve the shared refresh flight, forced-fetch claim, deadline, and rate-limit outcomes when changing refresh behavior. Concurrent refresh requests must return one coherent result.
- Keep cadence learning aligned with run-cache epochs, provider history order, the minimum history needed for a gap, and the quiet threshold. A stale or partial learning pass must not mark a pipeline quiet.
- Keep the run-history scan notice aligned with pagination, sorting, filter matching, and the client’s deeper-scan request. A partial scan must not look complete.
- Keep cancellation discovery aligned with history continuation and deeper-scan rules. An active run beyond the first scan budget must remain discoverable, while an unreadable scan must remain visible as incomplete.
- Keep provider retention policy aligned with cache merge, action invalidation, archived-run detail, and history query freshness.
- Keep capability checks aligned between saved provider read-only mode, fresh run details, pipeline actions, and client action menus. Accepted actions must invalidate the right history and announce the affected run.
- Keep run pace aligned with the distinction between running and queued runs, review waits, the provider queue limit, the minimum successful history needed for a baseline, and the median overdue rule.
- Keep metric extraction, metric events, retention limits, and dashboard range options aligned. A new metric can otherwise collect data that the view cannot select or explain.
- Keep optimistic view and pinned ordering aligned with the reorder payload, mutation lock, rollback, and final query invalidation.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A provider fetch fails or times out | The page can show old data while the provider is no longer fresh | Keep the last cache, record fetch health, and show the provider error with its recovery action |
| A provider generation changes during a fetch or history read | Old pipelines, runs, or metrics can overwrite current state | Commit only through the current provider lease and generation |
| Several callers request a forced refresh at the same time | The provider can receive duplicate work or callers can see different refresh results | Share one refresh flight and join the current forced fetch |
| A cadence history read fails or finishes after its run cache was invalidated | The pipeline can keep an old cadence or miss a later quiet change | Stage the result, check the cache epoch, bound retries, and learn again on a later pass |
| A pipeline has too few usable run gaps | The monitor can make an unsupported claim about its normal schedule | Leave cadence unknown until enough run starts produce a median gap |
| A history filter or value sort needs data beyond the scan budget | The page can show a partial or wrongly ordered result | Return an incomplete-scan notice and require a deeper scan |
| A bounded provider drops an old run from its response | A run can appear missing even though Pipedash has enough data to preserve it | Archive only provider-approved completed runs |
| A view or pinned reorder is rejected | The client can leave a user with an order the server did not save | Roll back the optimistic order, show one error, and invalidate the related queries |
| A read-only provider, stale run capability, or unsupported run action is selected | The action can fail or act on a state that the provider no longer supports | Check saved provider mode and fresh pipeline or run capabilities before calling the provider |
| A cancellation scan cannot read all history pages, or a batch contains unreadable, unsupported, or failing targets | Some runs remain active while the result looks like one all-or-nothing action | Scan beyond the first page, report incomplete pipelines and skips, continue per target, and cap each batch |
| A running pipeline has no supported overdue policy or fewer than three successful timed runs | The monitor cannot establish a reliable typical pace and shows no overdue signal | Require provider support and enough positive successful durations before marking a run overdue |
| A pending run awaits review but the monitor treats every pending run as queue work | The run can appear stuck even though it is waiting for a review decision | Exclude review-waiting runs from queue pace and stuck checks |
| Metrics are disabled or outside retention | The metrics panel has no usable observations | Show the disabled or empty state and limit selectable ranges to retention |
Key files
| File | Why to read it |
|---|---|
| crates/…/fetch.rs | Shows how provider state enters the monitoring model, survives fetch failures, and becomes health and pipeline events. |
| crates/…/refresh.rs | Shows how focused and full refreshes share provider work and report refresh state. |
| crates/…/cadence.rs | Shows how Pipedash learns usual run gaps and marks quiet pipelines. |
| crates/…/tests.rs | Shows the contract for quiet thresholds, sparse history, retries, and schedule changes. |
| crates/…/overdue.rs | Shows how the service decides whether a running pipeline has exceeded its normal pace and how it obtains recent runs. |
| crates/…/timing.rs | Shows the shared pace signals for live and queued runs. |
| crates/…/history.rs | Shows how provider run history becomes cached history and how bounded history is preserved. |
| crates/…/query.rs | Shows how filtering, sorting, pagination, deeper scans, and metric collection fit together. |
| crates/…/actions.rs | Shows the capability boundary for actions that change live pipeline or run state. |
| crates/…/cancellation.rs | Shows how Pipedash discovers and processes unfinished runs across pipelines. |
| crates/…/background.rs | Shows how background metric work is bounded, de-duplicated, and tied to the current provider generation. |
| crates/…/page.rs | Shows how memberships, filters, sections, pins, and facets become one pipeline page. |
| crates/…/dashboard.rs | Shows how metric queries become ranges, series, and summary data. |
| crates/…/event.rs | Defines the cross-client events that keep monitoring surfaces current. |
| src/…/UnifiedPipelinesView.tsx | Shows the client assembly of navigation, filters, build watch, actions, and results. |
| src/…/NavbarTree.tsx | Shows how views, pins, providers, search, and sidebar expansion form the main navigation. |
| src/…/NavbarRail.tsx | Shows the compact navigation state, provider failures, and all-provider count behavior. |
| src/…/IosPinnedList.tsx | Shows the mobile pinned pipeline focus area and its manual ordering behavior. |
| src/…/PipelineCardGrid.tsx | Shows the responsive card presentation for pipeline state and actions. |
| src/…/usePipelineViewModel.ts | Shows how URL state and backend page data become desktop and mobile monitoring models. |
| src/…/usePipelineViewQueries.ts | Shows query identities and the invalidation rules for view changes, marks, pins, and memberships. |
| src/…/useViewReorderQueries.ts | Shows optimistic ordering, mutation locking, rollback, and reconciliation. |
| src/…/PipelineViewStatus.tsx | Shows the difference between loading, empty, hidden, provider failure, recovery, and missing-view states. |
| crates/…/pipeline.rs | Defines the shared pipeline, run, status, and run-pace concepts. |
| crates/…/pipeline_view.rs | Defines views, memberships, sections, pins, filters, and the page contract. |
| crates/…/metrics.rs | Defines metric types, retention settings, aggregation choices, and dashboard data. |