릴리스 DAG와 실현 성과 게이트 연결
This commit is contained in:
@@ -82,7 +82,7 @@ def main() -> int:
|
||||
def add_to_closure(nid):
|
||||
if nid not in closure:
|
||||
closure.add(nid)
|
||||
for dep in nodes[nid].get("depends_on") or []:
|
||||
for dep in sorted(nodes[nid].get("depends_on") or []):
|
||||
if dep in nodes:
|
||||
add_to_closure(dep)
|
||||
|
||||
@@ -99,14 +99,14 @@ def main() -> int:
|
||||
raise ValueError(f"Cycle detected involving {nid}")
|
||||
if nid not in visited:
|
||||
temp.add(nid)
|
||||
for dep in nodes[nid].get("depends_on") or []:
|
||||
for dep in sorted(nodes[nid].get("depends_on") or []):
|
||||
if dep in closure:
|
||||
visit(dep)
|
||||
temp.remove(nid)
|
||||
visited.add(nid)
|
||||
order.append(nid)
|
||||
|
||||
for nid in closure:
|
||||
for nid in sorted(closure):
|
||||
if nid not in visited:
|
||||
try:
|
||||
visit(nid)
|
||||
@@ -116,6 +116,8 @@ def main() -> int:
|
||||
|
||||
steps_run = []
|
||||
success = True
|
||||
warning_failed = False
|
||||
warning_failures: list[dict[str, object]] = []
|
||||
|
||||
LINEAGE_LOG.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -180,6 +182,11 @@ def main() -> int:
|
||||
print(proc.stderr)
|
||||
if node.get("warn_only", False):
|
||||
print(f"Node {nid} is warn_only - continuing")
|
||||
warning_failed = True
|
||||
warning_failures.append({
|
||||
"node_id": nid,
|
||||
"returncode": proc.returncode,
|
||||
})
|
||||
else:
|
||||
success = False
|
||||
if node.get("strict", True) or args.strict:
|
||||
@@ -191,17 +198,23 @@ def main() -> int:
|
||||
"formula_id": "RELEASE_DAG_RUN_V4",
|
||||
"mode": args.mode,
|
||||
"steps": steps_run,
|
||||
"gate": "PASS" if success else "FAIL"
|
||||
"warning_failures": warning_failures,
|
||||
"gate": "PASS" if success and not warning_failed else "PASS_WITH_WARNINGS" if success else "FAIL"
|
||||
}, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||
|
||||
print(json.dumps({
|
||||
"formula_id": "RELEASE_DAG_RUN_V4",
|
||||
"mode": args.mode,
|
||||
"step_count": len(steps_run),
|
||||
"gate": "PASS" if success else "FAIL"
|
||||
"warning_failure_count": len(warning_failures),
|
||||
"gate": "PASS" if success and not warning_failed else "PASS_WITH_WARNINGS" if success else "FAIL"
|
||||
}, ensure_ascii=True, indent=2))
|
||||
|
||||
return 0 if success else 1
|
||||
if not success:
|
||||
return 1
|
||||
if args.strict and warning_failed:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user