Skip to main content

Pipeline Engine

Pipeline Engine

Application Orchestration

Trace a profile name into expanded, registered, ordered, and sequentially executed step objects.

Commandapp/core/pipeline/

Category

Architecture

Quick Command

profiles -> resolver -> registry -> builder -> pipeline

profilesSTEP_ORDERStepRegistryGitContext

Overview

The pipeline package separates workflow definition from execution. Profiles declare names, the resolver expands nested definitions, the registry maps final names to classes, builders instantiate those classes, and a pipeline runs every step against one shared context.


Pipeline Components

Profile Definitions

profiles.py

PIPELINE_PROFILES defines reusable step sequences. STEP_ORDER defines the global priority used only when two or more profiles are composed.

Command Resolver

command_resolver.py

Expands nested profiles, detects cycles, rejects unknown names, preserves one profile's declared order, and normalizes merged profiles.

Step Registry

registry.py and step_registry.py

Stores unique name-to-class mappings and creates step instances. Built-in registration must occur before pipeline construction.

Builders

builder.py

Convert resolved dictionaries into step objects and select either the Rich progress pipeline or the simpler logged pipeline presentation.

Pipeline

pipeline.py

Executes step objects in list order, advances progress after success, stops at the first exception, and re-raises the original failure.

Shared Context

context.py

Provides the workflow engine, its Git service, optional Commitizen helper, and mutable fields intended for cross-step runtime state.


Profile to Execution

Workflow Timeline

1
Select profile names
A direct command chooses an internal profile or custy run accepts one or more typed public names.
completed
2
Register built-in classes
register_all_steps maps every known string name to a concrete BaseStep subclass.
completed
3
Expand profiles
CommandResolver recursively replaces nested profile references with final step definitions.
completed
4
Normalize composition
Merged profiles are deduplicated by first occurrence and stably sorted by STEP_ORDER.
completed
5
Build step objects
PipelineBuilder asks StepRegistry to create each class with any configured constructor args.
current
6
Execute with GitContext
The pipeline invokes execute(context) one step at a time.
pending

Single and Merged Ordering

Single Profile

profile namedeclared sequence

Expand nested references recursively.


declared sequencepipeline config

Preserve the exact profile order without global re-sorting.

Multiple Profiles

profile namesexpanded steps

Concatenate each expanded sequence in input order.


expanded stepsunique steps

Keep only the first occurrence of each name.


unique stepsordered config

Apply a stable STEP_ORDER sort; unknown priorities use 999.



Public and Internal Boundaries

PIPELINE_PROFILES contains validation fragments, direct-command profiles, aggregate maintenance profiles, and six supported Run profiles. The typed public Run boundary accepts only commit, tag, push, dev, release, and full. A registry entry makes a step constructible; a profile entry makes it composable; neither action alone exposes new public CLI syntax.


Presentation Variants

PipelineBuilder creates a Rich progress-enabled Pipeline and can hide its progress task for selected commands. SimplePipelineBuilder creates a SimplePipeline with logged step messages. Both use the same registry and execute(context) contract, so presentation does not change the resolved business sequence.


Continue