Skip to content

feat: allow to filter compose policies based on policy id#8246

Merged
olblak merged 5 commits into
updatecli:mainfrom
olblak:feat/compose/id
Apr 1, 2026
Merged

feat: allow to filter compose policies based on policy id#8246
olblak merged 5 commits into
updatecli:mainfrom
olblak:feat/compose/id

Conversation

@olblak

@olblak olblak commented Mar 31, 2026

Copy link
Copy Markdown
Member

Add a new policy parameter "id" such as

policies:
  - name: Local Updatecli Policies
    id: local
    config:
      - updatecli/updatecli.d/
    values:
      - updatecli/values.d/scm.yaml

which can then be filtered using either the cli flag --ignored-policy-ids or --only-policy-ids such as

updatecli compose show --only-policy-ids "local" --file updatecli-compose.yaml 

Test

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

cd pkg/core/compose/
go test

Additional Information

Checklist

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

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added enhancement New feature or request update-compose All things related to update compose labels Mar 31, 2026
Signed-off-by: Olblak <me@olblak.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds support for assigning an id to compose policies and filtering which compose policies are processed via new CLI flags, enabling selective execution of policies within a compose file.

Changes:

  • Extend compose policy spec with an id field and add CLI flags --only-policy-ids / --ignored-policy-ids on compose {show,diff,apply}.
  • Implement filtering logic in Compose.GetPolicies based on policy IDs.
  • Add tests and new compose testdata covering “only” and “ignore” policy ID filtering.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/core/compose/testdata/policies/updatecli-compose.yaml New compose fixture defining multiple policies, some with id, for filter tests.
pkg/core/compose/spec.go Adds compose-level Values/Secrets and policy-level ID fields to the compose spec.
pkg/core/compose/main.go Updates GetPolicies signature; applies policy ID filtering and prepends global values/secrets to each policy.
pkg/core/compose/main_test.go Adds test cases for onlyPolicyIDs and ignorePolicyIDs filtering behavior.
cmd/compose_show.go Adds --only-policy-ids / --ignored-policy-ids flags and passes them into GetPolicies.
cmd/compose_diff.go Adds --only-policy-ids / --ignored-policy-ids flags and passes them into GetPolicies.
cmd/compose_apply.go Adds --only-policy-ids / --ignored-policy-ids flags and passes them into GetPolicies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/core/compose/main.go
Comment thread pkg/core/compose/spec.go
olblak and others added 2 commits March 31, 2026 20:37
@olblak olblak enabled auto-merge (squash) March 31, 2026 19:02
@olblak olblak merged commit 2a69a93 into updatecli:main Apr 1, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request update-compose All things related to update compose

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants