Lewati ke konten utama

Execution Model

Pipeline Execution Model

Implementation-Aligned

Telusuri active runtime dari resolved CLI configuration hingga registered step terakhir.

Commandcusty run PROFILE

Category

Pipelines

Quick Command

CLI input → profile resolution → build → sequential execution

resolverregistrycontextfailure behavior

Ringkasan​

Run command tidak menjalankan profile name secara langsung. Command ini me-resolve CLI dan project configuration, memperluas selected profile names menjadi step definitions, membangun concrete step objects, lalu meneruskan satu shared runtime context melalui resulting sequence.


Runtime Lifecycle

Dari Command hingga Selesai

1
Resolve command inputs
Gabungkan command options, project configuration, serta global dry-run, debug, dan logging values.
completed
2
Register step classes
Daftarkan setiap built-in step name sebelum pipeline dibangun.
completed
3
Resolve profiles
Expand nested profiles; merged profiles di-deduplicate dan diurutkan secara global.
completed
4
Build services and context
Buat workflow engine dan bungkus dalam shared GitContext.
completed
5
Build the pipeline
Instantiate setiap resolved step melalui StepRegistry.
completed
6
Execute sequentially
Jalankan setiap step dengan context yang sama sambil memperbarui Rich progress display.
current

Single dan Multiple Profiles

Resolver Behavior

One Profile

Nested profile references di-expand dengan declared order tetap dipertahankan.

Several Profiles

Expanded steps digabungkan, duplicate names dihapus, dan global phase order diterapkan.

Unknown Name

Resolution gagal sebelum pipeline dibangun.

Circular Reference

Nested profile expansion menghasilkan error ketika cycle terdeteksi.

Exact Ordering Rule

  • Dengan satu recognized profile, Custy memperluas nested profile references dan mempertahankan declared sequence. Single result tidak di-sort ulang dengan STEP_ORDER.
  • Dengan dua atau lebih profiles, Custy memperluas setiap profile, menggabungkan steps, mempertahankan first occurrence setiap name, lalu menerapkan stable numeric sort menggunakan STEP_ORDER.
  • Step tanpa priority entry menerima fallback value 999 saat merged-profile sort.

Lihat Step Priority and Ordering untuk seluruh 27 entries dan complete worked example.


Shared Runtime Context

Setiap step menerima GitContext yang sama. Context menyediakan workflow engine, Git service, optional Commitizen helper, dan mutable runtime values seperti resolved tag, workflow case, serta files yang dipilih untuk staging. Satu step dapat menyiapkan state untuk later step tanpa membuat ulang services.


Progress dan Failure Semantics

Active Run pipeline menampilkan Rich progress indicator dan hanya maju setelah step berhasil. Saat step menghasilkan exception, Custy menghentikan progress, mengidentifikasi failed step, melempar ulang error, dan tidak menjalankan later steps.


Dua Pipeline Presentations

custy run menggunakan progress-enabled Pipeline. Beberapa focused commands menggunakan SimplePipeline, yang menjalankan registered step contract sama dengan logging lebih sederhana. Perbedaan ini memengaruhi presentation, bukan kewajiban setiap step untuk menerapkan execute(context).


Lanjutkan