Skip to content

Commit d5fa48f

Browse files
authored
feat: add skip field to policy group attachments (#2564)
Signed-off-by: Miguel Martinez <[email protected]>
1 parent bbb8cab commit d5fa48f

File tree

14 files changed

+557
-99
lines changed

14 files changed

+557
-99
lines changed

app/cli/pkg/action/testdata/contract_v2.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ spec:
3333
attestation:
3434
- ref: file://attestation-policy.yaml
3535
policyGroups:
36-
- ref: file://testdata/policy_group.yaml
36+
- ref: sbom-quality
37+
with:
38+
user_name: "test-user"
39+
skip:
40+
- policy-to-skip

app/controlplane/api/gen/frontend/workflowcontract/v1/crafting_schema.ts

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/workflowcontract.v1.PolicyGroupAttachment.jsonschema.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/gen/jsonschema/workflowcontract.v1.PolicyGroupAttachment.schema.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/workflowcontract/v1/crafting_schema.pb.go

Lines changed: 79 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/controlplane/api/workflowcontract/v1/crafting_schema.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ message PolicyGroupAttachment {
344344
string ref = 1 [(buf.validate.field).string.min_len = 1];
345345
// group arguments
346346
map<string, string> with = 2;
347+
// policy names to skip (matched against metadata.name)
348+
repeated string skip = 3;
347349
}
348350

349351
// Represents a group or policies

app/controlplane/configs/config.devel.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ prometheus_integration:
9898
- org_name: "development"
9999

100100
# Policy providers configuration
101-
policy_providers:
102-
- name: chainloop
103-
default: true
104-
url: http://localhost:8002/v1
101+
# policy_providers:
102+
# - name: chainloop
103+
# default: true
104+
# url: http://localhost:8002/v1
105105

106106
enable_profiler: true
107107
# federated_authentication:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: chainloop.dev/v1
2+
kind: Contract
3+
metadata:
4+
name: contract-with-empty-skip
5+
description: Test contract with empty skip list
6+
spec:
7+
materials:
8+
- name: my-sbom
9+
type: SBOM_CYCLONEDX_JSON
10+
runner:
11+
type: GITHUB_ACTION
12+
policyGroups:
13+
- ref: file://../testdata/policy_group_with_embedded.yaml
14+
skip: []
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: chainloop.dev/v1
2+
kind: Contract
3+
metadata:
4+
name: contract-with-valid-skip
5+
description: Test contract with valid policy skip list
6+
spec:
7+
materials:
8+
- name: my-sbom
9+
type: SBOM_CYCLONEDX_JSON
10+
runner:
11+
type: GITHUB_ACTION
12+
policyGroups:
13+
- ref: file://../testdata/policy_group_with_embedded.yaml
14+
skip:
15+
- sbom-version-policy

0 commit comments

Comments
 (0)