Skip to content

feat(core): allow to filter pipeline based on labels#7621

Merged
olblak merged 9 commits intoupdatecli:mainfrom
olblak:feat/addlabelfiltering
Jan 30, 2026
Merged

feat(core): allow to filter pipeline based on labels#7621
olblak merged 9 commits intoupdatecli:mainfrom
olblak:feat/addlabelfiltering

Conversation

@olblak
Copy link
Member

@olblak olblak commented Jan 28, 2026

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

name: Test debian
pipelineid: debian
labels:
  "os": "debian"

targets:
  default:
    name: Update Debian
    kind: shell
    spec:
      command: "echo debian"

It's now possible to use the command updatecli apply --config updatecli.d/ --labels="os:alpine" to only apply pipeline with the corresponding label

Test

To test this pull request, you can run the following commands:

cd pkg/core/config/ 
go test .

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

@olblak olblak added enhancement New feature or request core All things related to Updatecli core engine labels Jan 28, 2026
Signed-off-by: Olblak <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Labels field 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 --labels command-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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 olblak enabled auto-merge (squash) January 30, 2026 08:07
@olblak olblak merged commit 3cd1c91 into updatecli:main Jan 30, 2026
5 checks passed
@olblak olblak changed the title feat: allow to filter pipeline based on labels feat(core): allow to filter pipeline based on labels Feb 5, 2026
@lemeurherve
Copy link
Member

@olblak could the list of labels to skip be passed in updatecli values file?

Use case: skip on labels only in specific repositories.

@olblak
Copy link
Member Author

olblak commented Mar 6, 2026

If I understand correctly you would like something like

      --ignore-labels stringArray         Filter pipelines to apply by their labels, accepted as a comma separated list (key:value)

in addition to the currently supported

      --labels stringArray         Filter pipelines to apply by their labels, accepted as a comma separated list (key:value)

@lemeurherve
Copy link
Member

Yes, and the possibility to pass this argument via the values file.

@lemeurherve
Copy link
Member

Opened #7871 & #7872

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core All things related to Updatecli core engine enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants