Pipeline Generation¶
pipeline
¶
GitLab child pipeline YAML generation.
Generates YAML for child pipelines that process one ticket (or work item) per job. The templates are parameterised so any project can use the same slot-distribution and noop-pipeline patterns.
distribute_slot(key, max_concurrency, prefix='slot')
¶
Deterministically assign a key to a resource-group slot.
Distributes keys evenly across max_concurrency numbered slots
using a SHA-256 hash.
Source code in src/agentic_ci/pipeline.py
noop_pipeline(message)
¶
Generate a minimal pipeline that prints a message and exits.
Source code in src/agentic_ci/pipeline.py
generate_child_pipeline(items, *, job_name_fn=None, job_body_fn=None, default_job_yaml='', max_concurrency=3, slot_prefix='slot', noop_message='No items to process')
¶
Generate a GitLab child pipeline with one job per item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items
|
list[dict]
|
List of dicts, each must have a |
required |
job_name_fn
|
Callable[..., str] | None
|
|
None
|
job_body_fn
|
Callable[..., str] | None
|
|
None
|
default_job_yaml
|
str
|
YAML for the |
''
|
max_concurrency
|
int
|
Number of resource-group slots. |
3
|
slot_prefix
|
str
|
Prefix for resource-group slot names. |
'slot'
|
noop_message
|
str
|
Message for the noop pipeline when items is empty. |
'No items to process'
|
Returns:
| Type | Description |
|---|---|
str
|
Complete YAML string. |