feat: scaffold deployment-policies monorepo
OPA/Rego deployment gateway policies: 5 rules (valid-environment, require-approvals, no-self-approval, block-weekends, freeze-window), a deploy-gate combining them, JSON schemas, scenario-driven tests, Gitea Actions CI (verify + publish to generic registry), changesets versioning, Makefile and scripts.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package rules.block_weekends_test
|
||||
|
||||
import data.rules.block_weekends as rule
|
||||
import rego.v1
|
||||
|
||||
test_scenarios[scenario_name] if {
|
||||
some scenario_name, scenario in data.scenarios
|
||||
actual := {code | code := rule.violations[_].code} with input as scenario.input with data.deploygate as scenario.data
|
||||
expected := {code | code := scenario.expect.violations[_]}
|
||||
actual == expected
|
||||
rule.allow == scenario.expect.allow with input as scenario.input with data.deploygate as scenario.data
|
||||
}
|
||||
Reference in New Issue
Block a user