feat: bootstrap accountability-root fabric snapshot
This commit is contained in:
parent
7956415924
commit
735867392e
13 changed files with 9105 additions and 12 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
|
@ -67,8 +68,7 @@ def financial_export_from_legacy(
|
|||
],
|
||||
"unresolved": [],
|
||||
}
|
||||
if legacy_graph.get("generated_at"):
|
||||
graph["generated_at"] = legacy_graph["generated_at"]
|
||||
graph["generated_at"] = legacy_graph.get("generated_at") or _utc_now()
|
||||
materialized = materialize_financial_graph_export(graph)
|
||||
errors = financial_graph_errors(materialized)
|
||||
if errors:
|
||||
|
|
@ -135,3 +135,7 @@ def _has_value(value: Any) -> bool:
|
|||
if isinstance(value, list):
|
||||
return any(_has_value(item) for item in value)
|
||||
return value not in (None, "")
|
||||
|
||||
|
||||
def _utc_now() -> str:
|
||||
return datetime.now(timezone.utc).replace(microsecond=0).isoformat().replace("+00:00", "Z")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue