feat(core): allow to filter pipeline based on labels#7621
feat(core): allow to filter pipeline based on labels#7621olblak merged 9 commits intoupdatecli:mainfrom
Conversation
Signed-off-by: Olblak <[email protected]>
e0690c7 to
b70b72d
Compare
Signed-off-by: Olblak <[email protected]>
There was a problem hiding this comment.
Pull request overview
This pull request introduces label-based filtering for Updatecli pipelines. Users can define labels in their manifests and filter which pipelines to execute using the --labels flag. Labels are also propagated to autodiscovery-generated pipelines.
Changes:
- Added
Labelsfield to pipeline specifications, reports, and engine options to support label metadata - Implemented label filtering logic in the configuration loader to skip pipelines that don't match specified labels
- Added
--labelscommand-line flag across all relevant commands (apply, diff, prepare, show, compose, manifest) to enable runtime filtering - Updated tests to verify label and pipeline ID filtering behavior
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/core/config/main.go | Added Labels field to Spec struct; implemented label filtering logic; converted multiline comments to single-line format |
| pkg/core/reports/report.go | Added Labels field to Report struct to track pipeline labels |
| pkg/core/engine/options.go | Added Labels field to Options struct for filtering configuration |
| pkg/core/engine/configuration.go | Updated config.New() call to pass labels filter parameter |
| pkg/core/engine/autodiscovery.go | Added logic to propagate parent pipeline labels to autodiscovery-generated pipelines |
| pkg/core/pipeline/main.go | Updated pipeline initialization to copy labels from config to report |
| pkg/core/pipeline/main_test.go | Updated test to provide new labels parameter to config.New() |
| pkg/core/config/main_test.go | Added test cases for label and pipeline ID filtering scenarios |
| cmd/*.go | Added --labels flag to all relevant commands and implemented label parsing logic in root.go |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olblak <[email protected]>
Signed-off-by: Olblak <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olblak <[email protected]>
Signed-off-by: Olblak <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Olblak <[email protected]>
|
@olblak could the list of labels to skip be passed in updatecli values file? Use case: skip on labels only in specific repositories. |
|
If I understand correctly you would like something like in addition to the currently supported |
|
Yes, and the possibility to pass this argument via the values file. |
Introduce the ability to specify labels within Updatecli manifest and then filter pipeline at runtime by using the new flag "--labels"
For example, let's take the following manifest
It's now possible to use the command
updatecli apply --config updatecli.d/ --labels="os:alpine"to only apply pipeline with the corresponding labelTest
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement