Components / Developer tools
Pipeline
A CI or CD run: each stage is a column of its jobs with their status and duration, and connectors run between the stages.
Functions: cui_pipeline

Usage
static const char *stages[] = { "Build", "Test", "Deploy" };
static const cui_pipeline_job jobs[] = { /* name, stage, status, seconds (-1: not run), allow_failure */
{ "linux-x64", 0, CUI_JOB_PASSED, 142 },
{ "unit", 1, CUI_JOB_RUNNING, 95 },
{ "lint", 1, CUI_JOB_FAILED, 12, true },
{ "production", 2, CUI_JOB_PENDING, -1 },
};
static int selected = -1;
cui_pipeline_result r = cui_pipeline(ui, "run", stages, 3, jobs, 4, .selected = &selected);
if (r.clicked >= 0) show_log(&jobs[r.clicked]);
A stage's header sums up its jobs: failed beats running, then pending; a failure with allow_failure shows a warning and does not fail the stage. Running jobs show a spinner. Below 560 points the stages stack top to bottom.
Returns a cui_pipeline_result: clicked is the job clicked this frame and hovered the job under the pointer, both indices into jobs, or -1. jobs is your flat array and is only read; each job names its stage by an index into stages. duration is in seconds, and a negative value means the job has not run and shows no time, so use -1 there: 0 shows as a time. selected points at your int: the pipeline marks that job and writes the index on a click.
Keyboard
- Tab moves through the jobs, and Enter or Space clicks the focused one.
Options of cui_pipeline
| Option | Type | Default | Description |
|---|---|---|---|
.width | cui_size | Width: CUI_FILL, CUI_FIT, CUI_PX(n) or CUI_PCT(n); unset uses the component's own. | |
.selected | int * | job shown selected, set on a click |
cui_pipeline_job
| Field | Type | Description |
|---|---|---|
name | const char * | shown on the job's row and in its tooltip |
stage | int | index into the stage names |
status | cui_job_status | One of CUI_JOB_PENDING, CUI_JOB_RUNNING, CUI_JOB_PASSED, CUI_JOB_FAILED, CUI_JOB_SKIPPED or CUI_JOB_CANCELED. |
duration | float | seconds; negative when it has not run |
allow_failure | bool | a failure does not fail the stage |
cui_job_status: CUI_JOB_PENDING, CUI_JOB_RUNNING, CUI_JOB_PASSED, CUI_JOB_FAILED, CUI_JOB_SKIPPED, CUI_JOB_CANCELED
cui_pipeline_result
| Field | Type | Description |
|---|---|---|
clicked | int | job clicked this frame (or chosen with Enter or Space), or -1 |
hovered | int | job under the pointer, or -1 |
Related
- Query builder: A filter built from conditions joined by all or any, in groups that nest.
- Problems panel: Compiler and linter output grouped by file, with each file's count.
- Schedule picker: A cron schedule edited through plain choices instead of the expression, with the next runs listed.
- Key-value editor: Rows of key and value fields for HTTP headers, query parameters or environment variables.