Adding a CI/CD provider to Pipedash. Covers the scaffold command, generated files, metadata, registration, local IDs, backend presentation, the Plugin trait, health and HTTP hooks, run log hooks, shared helpers, contract tests and the retry policy.
A provider in Pipedash is a Rust crate that implements the Plugin trait from pipedash-plugin-api. It requires 7 methods and provides defaults for optional capabilities.
Plugin boundaries
The plugin owns the provider's API calls, the mapping to Pipedash types, the config schema and the provider-specific copy. The core owns scheduling, caching, filtering, sorting, pagination, validation and action policy.
Provider-specific behavior stays in the provider crate. Core code, transports, TypeScript, Swift and Kotlin do not branch on provider names.
Plugins compile into the application. Pipedash does not load provider crates at runtime, so a new provider requires a new build.
Scaffold a provider
Run the interactive generator from the repository:
mise run new:pluginFor a noninteractive REST plugin:
mise run new:plugin -- \
--id sample-ci \
--name "Sample CI" \
--description "Monitor and trigger Sample CI pipelines" \
--archetype rest \
--id-shape numeric \
--capabilities trigger,cancel,logs \
--no-input--no-input requires --id and --description. Without a terminal, the generator also uses noninteractive mode.
| Argument | Default | Description |
|---|---|---|
--id | Required in noninteractive mode | Lowercase kebab-case provider ID |
--name | Title-cased ID | Display name |
--description | Required in noninteractive mode | Manifest description, also shown in the interface |
--archetype | rest | rest or kubernetes |
--id-shape | numeric for REST, namespaced for Kubernetes | numeric, path or namespaced |
--capabilities | trigger,cancel,logs | Comma-separated capabilities |
--read-only | Off | Disables all three generated capabilities. Conflicts with --capabilities |
--aliases | Empty | Comma-separated alternate provider names for the structure guard |
--token-prefixes | Empty | Comma-separated token prefixes that let Pipedash recognize token-shaped values. REST only |
--token-label | API Token | Token field label. REST only |
--token-help | API token from your <name> account settings | Token field help. REST only |
--ping-path | /api/user | Absolute GET path for credential validation. REST only |
--icon | Generated placeholder SVG | Path to an SVG file |
--no-input | Off | Disables prompts |
--yes, -y | Off | Skips the final interactive confirmation |
--dry-run | Off | Prints proposed file paths and the dependency line without writing them |
IDs and aliases cannot reuse an existing provider ID, alias or plugin crate name. --yes does not fill missing noninteractive arguments.
The generated operations contain todo! calls. Replace them with the provider implementation before enabling or submitting the plugin. The generator does not create a finished integration.
Generated files
The generator creates these files in crates/pipedash-plugin-<id>/:
| File | Purpose |
|---|---|
Cargo.toml | Package metadata, dependencies and workspace lint settings |
assets/icon.svg | Embedded provider icon |
src/lib.rs | Modules and register_plugin! |
src/metadata.rs | Config schema, capabilities and provider metadata |
src/schema.rs | Table schema |
src/config.rs | Connection config and local ID parsing |
src/config/tests.rs | Config and ID parser tests |
src/plugin.rs | Plugin implementation and provider operations |
src/client.rs | REST client. REST archetype only |
The REST archetype produces 9 files and Kubernetes produces 8, including the icon. The generator also adds the dependency to crates/pipedash-plugins/Cargo.toml and formats the new crate. It checks for new structure-guard name collisions when the initial audit passes.
Providers add further files as they need them. Examples are mapper.rs for the conversion between provider API data and domain models, types.rs for provider-specific types, permissions.rs in the GitHub crate and health.rs in the FluxCD crate.
Metadata and registration
metadata() returns a PluginMetadata. The plugin builds it once and stores it.
PluginMetadata::new(name, config_schema, table_schema, capabilities) initializes permissions and features as empty lists. It creates default presentation data and a default history policy.
register_plugin! supplies provider_type, version, description, author and icon from the crate manifest and assets/icon.svg. The provider ID is the crate name without pipedash-plugin-. The icon becomes an embedded SVG data URL. Do not duplicate these values in metadata.rs.
Add alternate provider spellings under [package.metadata.pipedash] aliases = [...]. These names extend the structure guard. They do not add registry IDs.
A provider builds its metadata like this:
pub fn create_metadata() -> PluginMetadata {
PluginMetadata::new(
"Sample CI",
create_config_schema(),
schema::create_table_schema(),
PluginCapabilities::standard(),
)
}| Field | Type |
|---|---|
name | String |
provider_type | String |
version | String |
description | String |
author | Option<String> |
icon | Option<String> |
config_schema | ConfigSchema |
table_schema | TableSchema |
capabilities | PluginCapabilities |
required_permissions | Vec<Permission>, default empty |
features | Vec<Feature>, default empty |
run_history | RunHistoryPolicy |
token_prefixes | Vec<String>, default empty |
presentation | PluginPresentation |
PluginCapabilities has 8 Boolean fields: trigger, cancel, force_cancel, retains_run_history, logs, sign_in, uses_http_proxy and async_trigger.
PluginCapabilities::default() sets every field to false. PluginCapabilities::standard() enables trigger, cancel, logs and uses_http_proxy.
The default history policy sets bounded = false, order = RunNumber and tracks_overdue = true. A plugin can use StartedAt ordering and override whether a missing history record can be archived through can_archive_run.
token_prefixes lists the prefixes of the provider's tokens. Pipedash uses them to recognize token-shaped values. Literal tokens in config.toml are still accepted, and the security page describes the safe forms.
ConfigSchema holds fields, an auth_modes map and a no_auth flag. Each field declares a ConfigSection: Authentication, Connection or Settings. Settings appear under Advanced settings in the Provider step. Connection and authentication fields appear in Credentials.
Use add_auth_field to associate a field with AuthMode::Token, AuthMode::SignIn or several modes. The wizard only renders and validates fields for the selected mode. allow_no_auth() adds the No auth choice. A connection with auth_mode = "none" is read-only. The core blocks its mutating actions and rejects mutation requests independently of the interface.
ConfigField field | Type |
|---|---|
key | String |
label | String |
description | Option<String> |
field_type | ConfigFieldType |
required | bool |
default_value | Option<serde_json::Value> |
options | Option<Vec<String>> |
validation_regex | Option<String> |
validation_message | Option<String> |
section | ConfigSection |
ConfigFieldType has 7 values: Text, Password, TextArea, Boolean, Select, MultiSelect and Number.
Registration
A new provider adds one crate and one dependency line in crates/pipedash-plugins/Cargo.toml. mise run new:plugin creates both.
The root workspace already includes crates/*. The registry build script discovers provider dependencies and generates their registration calls. CI packaging and the release provider matrix discover crates that call register_plugin!. The architecture page shows the generated registry.
The provider crate registers its factory in src/lib.rs:
pipedash_plugin_api::register_plugin!(MyPlugin);The plugin type implements Default. The macro supplies the crate manifest and embedded SVG icon to PluginRegistry::register.
PluginRegistry exposes register, get, create, metadata, metadata_of, is_registered, provider_types and count.
Local IDs
Plugins receive and return local IDs. They do not compose or parse the global <type>__<provider_id>__<local> prefix.
The core adapter adds and removes that prefix. It fills the domain pipeline's provider_id and provider_type. A local ID can contain __; the adapter preserves it.
Actions and presentation
The backend supplies action eligibility and provider-specific copy. The core Presenter calls the plugin's presentation hooks before returning pipelines and runs.
Start with pipedash_plugin_api::plugin::defaults and change only provider-specific behavior:
pipeline_actionssets pipeline actions, rerun strategy, trigger icon and optional target context.run_actionssets run actions and whether the backend watches an active run.run_displaysets the run title, message, context fields and start-time label.trigger_valuesinitializes declared trigger parameters from a previous run and parameter defaults.configured_repositoriessupplies configured repository names for navigation.selection_requiredcontrols whether setup requires a selection.can_archive_rundecides whether a missing history record can remain as an archived record.
Default run actions allow cancellation for running or pending runs, except runs awaiting review. Force cancellation requires a running run and the capability. Rerun requires a finished run and the trigger capability.
Default run display uses #<run_number>, the label "Started" and nonempty Branch and Actor fields.
Default trigger values replay saved inputs. A previous branch supplies ref when neither branch nor ref has a truthy value. Only declared parameters enter the result.
PluginPresentation supplies terminology, status labels, wizard copy, view copy, trigger and rerun copy, history notices and run-detail labels. A provider does not add frontend branches for these differences.

The Plugin trait
Plugin: Send + Sync uses #[async_trait]. The trait has 40 methods. Seven require an implementation. Methods marked async use #[async_trait]. NotSupported means Err(PluginError::NotSupported(...)).
| Signature | Required or default |
|---|---|
fn metadata(&self) -> &PluginMetadata | Required |
fn initialize(&mut self, provider_id: i64, config: HashMap<String, String>, http_client: Option<std::sync::Arc<reqwest::Client>>) -> PluginResult<()> | Required |
fn client_options(&self, config: &HashMap<String, String>) -> ClientOptions | ClientOptions::default() |
fn status_source(&self) -> Option<&StatusSource> | None |
async fn check_health(&self) -> PluginResult<Vec<ComponentHealth>> | Ok(Vec::new()) |
async fn validate_credentials(&self) -> PluginResult<bool> | Required |
async fn fetch_available_pipelines(&self, params: Option<PaginationParams>) -> PluginResult<PaginatedAvailablePipelines> | Ok(PaginatedResponse::empty()) |
async fn fetch_organizations(&self) -> PluginResult<Vec<Organization>> | Ok(Vec::new()) |
async fn fetch_pipeline_catalog(&self) -> PluginResult<PipelineCatalog> | NotSupported: Pipeline catalog not supported by this provider |
async fn ids_with_ci(&self, ids: Vec<String>) -> PluginResult<Vec<String>> | Ok(ids) |
fn log_dialect(&self) -> &'static dyn LogDialect | &PlainDialect |
fn log_tree_version(&self) -> u32 | 0 |
async fn fetch_log_nodes(&self, run: RunRef<'_>) -> PluginResult<Vec<LogNode>> | NotSupported: Run logs not supported by this provider |
async fn read_log(&self, run: RunRef<'_>, node_id: &str, from: Option<&LogCursor>, sink: &mut LogSink) -> PluginResult<LogRead> | NotSupported: Run logs not supported by this provider |
async fn fetch_available_pipelines_filtered(&self, org: Option<String>, search: Option<String>, params: Option<PaginationParams>) -> PluginResult<PaginatedAvailablePipelines> | Calls discovery, filters its returned items by organization and search, then rebuilds the pagination metadata |
async fn fetch_pipelines(&self) -> PluginResult<Vec<Pipeline>> | Required |
async fn fetch_run_history(&self, pipeline_id: &str, limit: usize) -> PluginResult<Vec<PipelineRun>> | Required |
async fn fetch_run_details(&self, pipeline_id: &str, run_number: i64) -> PluginResult<PipelineRun> | Required |
async fn fetch_recent_runs(&self, pipeline_ids: &[String], limit: usize) -> PluginResult<HashMap<String, Vec<PipelineRun>>> | NotSupported: Batched run history not supported by this provider |
async fn trigger_pipeline(&self, params: TriggerParams) -> PluginResult<TriggerResult> | Required |
async fn cancel_run(&self, pipeline_id: &str, run_number: i64) -> PluginResult<()> | NotSupported: Run cancellation not supported by this provider |
async fn force_cancel_run(&self, pipeline_id: &str, run_number: i64) -> PluginResult<()> | NotSupported: Force cancellation not supported by this provider |
async fn review_run(&self, pipeline_id: &str, run_number: i64, decision: ReviewDecision) -> PluginResult<()> | NotSupported: Run review not supported by this provider |
async fn rerun_failed_jobs(&self, pipeline_id: &str, run_number: i64) -> PluginResult<()> | NotSupported: Re-running failed jobs not supported by this provider |
async fn rerun_run(&self, pipeline_id: &str, run_number: i64) -> PluginResult<()> | NotSupported: Re-running runs not supported by this provider |
async fn enable_pipeline(&self, pipeline_id: &str) -> PluginResult<()> | NotSupported: Enabling pipelines not supported by this provider |
async fn fetch_workflow_parameters(&self, workflow_id: &str) -> PluginResult<Vec<WorkflowParameter>> | Ok(Vec::new()) |
async fn fetch_rate_limit(&self) -> PluginResult<Option<RateLimit>> | Ok(None) |
async fn get_field_options(&self, field_key: &str, config: &HashMap<String, String>) -> PluginResult<Vec<String>> | Ok(Vec::new()) |
async fn sign_in_client(&self, config: &HashMap<String, String>, http_client: &reqwest::Client) -> PluginResult<SignInClient> | NotSupported: Sign-in is not supported by this provider |
fn sign_in_refresh_rejections(&self) -> &'static [SignInRefreshRejection] | &[] |
async fn check_permissions(&self) -> PluginResult<PermissionStatus> | Marks declared permissions as granted, sets all_granted to true, uses the current time, empty metadata and no credential label |
fn get_feature_availability(&self, status: &PermissionStatus) -> Vec<FeatureAvailability> | Compares feature requirements with granted permission names |
fn can_archive_run(&self, pipeline_metadata: &HashMap<String, serde_json::Value>, run_metadata: &HashMap<String, serde_json::Value>, status: PipelineStatus) -> bool | false |
fn selection_required(&self, config: &HashMap<String, String>) -> bool | true |
fn configured_repositories(&self, config: &HashMap<String, String>) -> Vec<String> | Comma-separated values from selected_items |
fn pipeline_actions(&self, pipeline: &PipelineFacts<'_>) -> PipelineActionState | plugin::defaults::pipeline_actions with the declared capabilities |
fn run_actions(&self, pipeline: &PipelineFacts<'_>, run: &RunFacts<'_>) -> RunActionState | plugin::defaults::run_actions with the declared capabilities |
fn run_display(&self, pipeline: &PipelineFacts<'_>, run: &RunFacts<'_>) -> RunDisplay | plugin::defaults::run_display |
fn trigger_values(&self, pipeline: &PipelineFacts<'_>, previous: Option<&RunFacts<'_>>, parameters: &[WorkflowParameter]) -> serde_json::Map<String, serde_json::Value> | plugin::defaults::trigger_values |
TriggerResult has optional run_id and run_number fields. A trigger can return without either value when the provider accepts the request before it creates a run.
Errors use PluginError, which has the variants AuthenticationFailed, PermissionDenied, ApiError, InvalidConfig, PipelineNotFound, ProviderNotSupported, NetworkError, SerializationError, DatabaseError, NotSupported, Internal, RateLimited, ServiceUnavailable and Tls. RateLimited and ServiceUnavailable carry an optional retry_after duration. The core uses it to schedule the next fetch.
Discovery, selection and history policy
ids_with_ci receives the repositories a user selected and returns those that have CI. The core calls it when it saves a provider and drops the rest. The check is provider-specific. GitHub and Gitea check for workflows, GitLab and Bitbucket check runs and CI configuration, and Azure DevOps checks for build definitions. A check that fails keeps the repository.
fetch_available_pipelines feeds the Pipelines step of the wizard. fetch_available_pipelines_filtered applies the organization filter and the search term. fetch_pipeline_catalog returns organizations and available pipelines together when implemented.
selection_required and configured_repositories tell the core whether setup requires a selection and which names are already configured. can_archive_run and the run_history policy decide how the core treats history records that the provider no longer returns.
fetch_rate_limit returns the remaining API quota. The core pauses a provider whose quota falls under 10% until the reset time.
Health and HTTP hooks
Three methods tell the core how a provider behaves on the network. The core does the polling, caching, backoff and wording.
client_options: returns aClientOptionsvalue with an optionaloriginURL and anaccept_invalid_certsflag. The core shares one HTTP client for each origin and TLS setting. ArgoCD setsaccept_invalid_certsfor a server with a self-signed certificate.status_source: returns aStatusSourcethat names the public status page feed of the provider. It holds the page URL, the feed URL, aFeedFormat(StatuspageorStatusIo) and aComponentFilter. The filter isAllor a list of component IDs, and it selects the components that CI depends on.check_health: returns a list ofComponentHealthvalues for problems the plugin sees on the instance. An example is a Tekton or Flux controller that is down. Each value has a name, aHealthLeveland an optional detail.
HealthLevel has 5 values in order of severity: Operational, Maintenance, Degraded, PartialOutage and MajorOutage.
For a self-hosted instance, status_page_field() returns an optional config field with the key status_page_url. custom_status_source(config) turns its value into a Statuspage source that reads /api/v2/summary.json below that URL. The value must be an https URL without credentials, query or fragment. A plain http URL works only for a literal loopback address.
collect_controller_health merges the results of several controller checks. It reports a permission error when any check hits a permission error. It reports a missing error when every controller is absent. The Tekton and Flux plugins use it with the feature ID controller_health. The provider health page describes what users see.
Run log hooks
A provider shows job logs inside Pipedash when it sets the logs capability and implements the log hooks below. The core does the download bookkeeping, parsing, caching on disk, paging, search and eviction. The Run logs page describes what users see.
fetch_log_nodes(run): returns the run's tree as a flat list ofLogNodevalues, parents before children. Each node has a stableid, an optionalparent_idand akind:Stage,JoborStep. It also has a name, status, start and end times, an optional web URL and alogvalue.logisSome(Ready)for a finished log,Some(Partial)for a growing log orSome(Pending)before output exists. A node without its own log usesNone.read_log(run, node_id, from, sink): streams one node's raw bytes into theLogSinkand returnsLogRead.fromholds the previous provider-ownedLogCursor, orNonefor the first read. ReturnLogReadMode::Appendfor bytes after that cursor andLogReadMode::Replacefor a complete replacement. The returnedcursorholds the next position, orNonefor snapshot reads.sink.pipe(response)copies areqwest::Responsechunk by chunk. It fails with aNetworkErrorwhen no chunk arrives for 60 seconds.sink.write(bytes)sends one chunk.log_dialect(): returns theLogDialectthat parses each line. Implementparse(line)to return aParsedLinewith an optional timestamp, aLineMarkerand the body without the marker.PlainDialectreturns the whole line with no timestamp and the markerPlain.is_step_start(line)defaults tofalse.infers_errors()defaults totrue, so the core checks plain lines for common error patterns. Returnfalsewhen the dialect's own markers should define all errors.
Call sink.restart() before writing bytes when a resumed read must replace the whole log. Calling it after writing fails. The core rejects a read whose returned mode does not match whether ingestion resumed. sink.pipe_range(response, offset) and sink.pipe_resumed(offset, fetch) handle HTTP range reads and fallback to a full read.
LogCursor::new(position) serializes a provider's position into opaque JSON. cursor.parse::<T>() reads it back and returns None when it does not match that type.
LineMarker describes both line styles and sections:
| Markers | Effect |
|---|---|
Plain | Plain output, subject to error inference when the dialect permits it |
Error, Warning, Notice, Debug, Command | Set the line style |
GroupStart, GroupEnd | Open and close nested sections |
SectionStart { open } | End existing sections and start a section with the requested open state |
OpenSection | Open the current section |
Increase log_tree_version() when a plugin change makes a finished run's saved tree incomplete. The core rebuilds an older tree on its next read. Failed listing keeps the previous tree without advancing its version. A refreshed tree keeps saved nodes missing from the new response, so downloaded logs stay accessible.
RunRef carries the pipeline ID, the run number, the run ID and the metadata of the run. Nodes without a log of their own that sit below a node with a log become step sections of its log. The core places them with the step start lines of the dialect, then with their start times. GroupStart and GroupEnd lines become nested sections. A Stage node is a header only.
The model fits each provider shape. GitHub has a job with a log and its steps as sections. GitLab can map stages to headers, jobs to logs and collapsible sections to groups. Tekton and Bitbucket steps can have logs of their own, and Jenkins can return one log for the root node.
Shared Actions helpers
The pipedash-plugin-actions crate holds helpers for plugins that use the GitHub Actions workflow format. The GitHub and Gitea plugins use both dispatch functions.
dispatch_inputs(workflow_source): reads theworkflow_dispatchinputs of a workflow file and returns them asWorkflowParametervalues. Each name receives the prefixinputs.. The label keeps the plain input name.dispatch_body(inputs): builds the dispatch request body. It readsreffrom the values and defaults tomain. It strips theinputs.prefix from the other names and puts them underinputs.ActionsLogDialect: theLogDialectof Actions logs. It strips the byte order mark and the leading RFC 3339 timestamp and reads the##[group],##[endgroup],##[error],##[warning],##[notice],##[debug],##[command]and[command]markers. A##[group]Run …line and thePost job cleanup.line start a step. The GitHub plugin uses it.
Other plugins need only the contract in pipedash-plugin-api and their own provider mapping.
Shared Kubernetes helpers
Enable the kubernetes feature of pipedash-plugin-api for the shared kubeconfig loader.
KubeconfigSource::from_config prefers nonempty pasted content in token. Otherwise it reads the configured path. Without a configured path it reads $KUBECONFIG and then the user's .kube/config.
Path lists use : on Unix and ; on Windows. Paths expand ~ and environment variables. The loader merges files that exist and returns an error when none exists.
available_contexts loads context names on a blocking task, sorts them and removes duplicates. ensure_supported_auth rejects exec credential plugins on mobile. A token or client certificate works there.
Contract tests and checks
crates/pipedash-plugins/tests/ checks every registered provider. The shared tests cover:
- Registry entries and manifest-owned metadata
- Embedded icons, table schemas, unique config keys and presentation labels
- Metadata serialization, validation regexes and auth-mode field references
- Action availability against declared capabilities
- Run titles, start-time labels and trigger values
- Empty repository selection and declared token prefixes
- Separate plugin instances from the factory
- Local and global ID round-trips and rejection of foreign IDs
- Rejection of force cancellation when the capability is off
Run the provider's tests and shared contract tests:
cargo test -p pipedash-plugin-sample-ci -p pipedash-pluginsProvider unit tests cover its API mapping, config parsing and other provider-specific behavior. The shared suite also holds integration tests for provider services, log ingestion and history-order migration. The development page lists the full check sequence before a pull request.
Retry policy
RetryPolicy in pipedash-plugin-api retries an async operation. Its defaults are below.
| Field | Default |
|---|---|
max_retries | 3 |
initial_delay | 100 ms |
exponential_backoff | true, so the delay doubles after each failed attempt |
The policy retries only transient errors: NetworkError, ServiceUnavailable and RateLimited. It skips a retry when the retry_after hint is longer than the current delay. Any other error returns at once.
Next step
The existing plugins serve as references, including Tekton, ArgoCD, FluxCD and Prow. Prow implements shared discovery and run-history batches for Deck. The providers index lists every provider, and the contributing page covers how a change reaches the repository.