- Home
- Skills
- Tencentblueking
- Bk Ci
- Yaml Pipeline Transfer
yaml-pipeline-transfer_skill
- Kotlin
2.5k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill tencentblueking/bk-ci --skill yaml-pipeline-transfer- SKILL.md43.1 KB
Overview
This skill documents YAML pipeline conversion for a CI platform, covering bidirectional conversions between YAML and pipeline models, Pipeline as Code (PAC) implementation, template references, and trigger configuration. It targets developers implementing YAML parsing, model generation, template handling, and syntax validation for pipelines. The guidance focuses on concrete components, mapping rules, and integration points.
How this skill works
It inspects YAML pipeline files and converts them to an internal pipeline Model and back to YAML using a TransferMapper and ModelTransfer components. ElementTransfer, StageTransfer, ContainerTransfer, TriggerTransfer, and VariableTransfer handle mapping of steps, stages, containers, triggers, and variables respectively. The TransferMapper provides serialization, formatting, merging (preserving comments and anchors), indexing, and custom quoting/anchor logic for robust PAC workflows.
When to use it
- Implement Pipeline as Code (PAC) support for CI pipelines
- Parse user-supplied YAML into executable pipeline models
- Serialize pipeline models back to YAML for storage or templating
- Merge user edits into existing YAML while preserving comments and anchors
- Validate YAML syntax, triggers, templates, and variable definitions
Best practices
- Use TransferMapper.formatYaml and custom quoting checker to produce predictable YAML output
- Preserve anchors and comments by using mergeYaml when updating user files
- Keep element and container mapping rules deterministic to avoid ambiguity between similar steps (e.g., run vs uses)
- Run yaml2Setting and yaml2Labels to centralize pipeline-level settings and concurrency rules
- Validate triggers via TriggerTransfer to ensure SCM and webhook triggers map to expected model elements
Example use cases
- Converting a repository-stored pipeline.yaml into an executable Model for runtime execution
- Exporting an in-memory pipeline Model to a YAML template for pipeline-as-code workflows
- Merging CI changes from a web UI into the repository YAML while preserving user comments and anchors
- Translating YAML trigger entries into concrete trigger elements (Git, GitHub, timers) for scheduler and webhook wiring
- Mapping job runs-on values to container implementations for cross-platform builds
FAQ
ModelTransfer is the central component for converting YAML to the pipeline Model and for producing settings and labels.
How are custom YAML anchors and comments preserved?
TransferMapper.mergeYaml applies a Myers diff-based merge and restores anchors and comments during event composition and anchor replacement.
How do I map a step that uses an action versus a script?
ElementTransfer distinguishes by the presence of uses (MarketBuildAtomElement or GitCheckout) versus run (LinuxScriptElement/WindowsScriptElement), and template entries become StepTemplateElement.