Spaces:
Paused
Paused
delete phases/ci_guard.py
Browse files- phases/ci_guard.py +0 -29
phases/ci_guard.py
DELETED
|
@@ -1,29 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import sys
|
| 3 |
-
|
| 4 |
-
def run_ci():
|
| 5 |
-
rules = json.load(open("artifacts/normalized_rules.json"))
|
| 6 |
-
findings = json.load(open("artifacts/rule_findings.json"))
|
| 7 |
-
|
| 8 |
-
critical_rules = {
|
| 9 |
-
r["id"] for r in rules["rules"]
|
| 10 |
-
if r.get("severity") == "critical"
|
| 11 |
-
}
|
| 12 |
-
|
| 13 |
-
violated = {
|
| 14 |
-
f["rule"] for f in findings
|
| 15 |
-
if f["status"] == "VIOLATED"
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
failed = critical_rules & violated
|
| 19 |
-
|
| 20 |
-
if failed:
|
| 21 |
-
print("❌ CI FAILED")
|
| 22 |
-
print("Critical rule violations:", failed)
|
| 23 |
-
sys.exit(1)
|
| 24 |
-
|
| 25 |
-
print("✅ CI PASSED")
|
| 26 |
-
sys.exit(0)
|
| 27 |
-
|
| 28 |
-
if __name__ == "__main__":
|
| 29 |
-
run_ci()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|