Commit ad9d2a2
committed
feat: add skip field to policy group attachments
Add support for explicitly disabling specific policies within a policy group
by specifying their metadata names in a skip list. This allows users to
selectively exclude policies from evaluation without modifying the policy
group itself.
Changes:
- Add skip field to PolicyGroupAttachment protobuf message
- Implement getPolicyName() helper to extract policy names from attachments
- Filter skipped policies in both material and attestation evaluation paths
- Add validateSkipList() to warn about non-existent policy names
- Add comprehensive test coverage for skip functionality
Example usage:
```yaml
policyGroups:
- ref: file://groups/sbom-quality.yaml
with:
bannedLicenses: AGPL-3.0
skip:
- sbom-present
- license-check
```
Policies are matched by metadata.name. Unknown policy names in the skip list
generate warnings but allow execution to continue.
Closes #2557
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>1 parent 7e7e77d commit ad9d2a2
8 files changed
Lines changed: 403 additions & 76 deletions
File tree
- app
- cli/pkg/action/testdata
- controlplane/api
- gen
- frontend/workflowcontract/v1
- jsonschema
- workflowcontract/v1
- pkg/policies
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 79 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| 347 | + | |
| 348 | + | |
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
| |||
0 commit comments