Skip to content

Commit 9e5605d

Browse files
committed
Update test cases with example hotfix branch patterns
1 parent 38775f0 commit 9e5605d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

policy/release/git_branch/git_branch_test.rego

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ single_test_case(branch, expected_results) if {
88
# regal ignore:line-length
99
mock_input := {"attestations": [{"statement": {"predicate": {"buildConfig": {"tasks": [{"invocation": {"environment": {"annotations": {"build.appstudio.redhat.com/target_branch": branch}}}}]}}}}]}
1010

11-
mock_rule_data := ["^c10s$", "^rhel-10.[0-9]+$", "^rhel-[0-9]+-main$"]
11+
mock_rule_data := ["^c10s$", "^rhel-10.[0-9]+$", "^rhel-[0-9]+-main$", "branch[0-9]+-rhel-[0-9]+.[0-9]+.[0-9]+$"]
1212

1313
mock_tasks := mock_input.attestations[0].statement.predicate.buildConfig.tasks
1414

@@ -30,6 +30,13 @@ test_allow_with_c10s_branch if {
3030
single_test_case("c10s", [])
3131
}
3232

33+
test_allow_with_hotfixbranch if {
34+
single_test_case("kernel-5.14.0-570.42.1.el9_6-branch1-rhel-9.6.0", [])
35+
single_test_case("kernel-5.14.0-570.42.1.el9_6-branch1-rhel-9.6.0", [])
36+
single_test_case("kernel-5.14.0-570.42.1.el10_3-branch1-rhel-10.3.1", [])
37+
single_test_case("kernel-5.14.0-570.42.1.el11_2-branch13-rhel-11.2.9", [])
38+
}
39+
3340
test_deny_with_disallowed_branch if {
3441
expected := {{
3542
"code": "git_branch.git_branch",

0 commit comments

Comments
 (0)