- Home
- Skills
- Tencentblueking
- Bk Ci
- Pipeline Variable Management
pipeline-variable-management_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 pipeline-variable-management- SKILL.md10.3 KB
Overview
This skill is a complete guide for pipeline variable management covering the full lifecycle and field extension of variables in CI pipelines. It focuses on creation, initialization, updating, storage, passing, querying, and how to extend variable fields, types, scope, and inheritance. It is written for developers implementing or debugging variable functionality in a Kotlin-based CI platform. The guide emphasizes practical steps, core classes, and integration points between YAML and internal models.
How this skill works
The skill explains two core models: the internal BuildFormProperty (database and service model) and the YAML Variable model, plus a VariableTransfer converter that maps between them. It documents how variable definitions are read from pipeline configuration, initialized at build start, stored as build-level instances, and inherited or updated across stages and jobs. It also covers field extension: adding new properties, type definitions, conversion logic, backward compatibility, and frontend synchronization.
When to use it
- When implementing variable initialization or runtime update logic for builds.
- When adding new fields or types to variable definitions and ensuring model conversions.
- When debugging variable passing, scope, or inheritance issues across stages and jobs.
- When integrating plugin code that must read or modify pipeline variables.
- When migrating YAML definitions to internal models or ensuring compatibility.
Best practices
- Use the VariableTransfer converter to keep YAML and internal models synchronized and test both directions.
- Treat new fields as optional and implement backward compatibility for historical data.
- Add unit and integration tests for lifecycle flows: creation, inheritance, updates, and persistence.
- Log variable initialization and transfer events to aid debugging and include DB row checks for T_PIPELINE_BUILD_VAR.
- Coordinate frontend updates (Vue) when adding fields and validate JSON serialization behavior.
Example use cases
- Add a new allowModify boolean field to variables: define in BuildFormProperty and Variable, update VariableTransfer, add frontend support, and run compatibility tests.
- Implement dynamic variable initialization at build start using PipelineVariableService and persist initial instances to T_PIPELINE_BUILD_VAR.
- Diagnose missing variable values during execution by tracing start-up initialization, cross-job transfer util (VariableAcrossInfoUtil), and build-level storage.
- Extend a variable type to support a value list: update YAML model, converter, and ensure DB schema or serialization handles new structure.
FAQ
They are the same underlying model (BuildFormProperty); parameters are variables provided at pipeline start by users while variables cover internal definitions and runtime values.
How do I pass variables across stages or jobs?
Follow the lifecycle guidance: variables are initialized at build start, persisted to build-level storage, and cross-job transfer utilities handle inheritance and explicit passing; review VariableAcrossInfoUtil usage.
New field added but frontend doesn't show it—what to check?
Ensure the YAML Variable and BuildFormProperty include the field, update VariableTransfer, then synchronize the frontend Vue components and verify JSON serialization and API responses.