fix Fabric authority import compatibility
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 21s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a053ff-1d6f-7fe2-ac1c-a6eb40a42a0c
This commit is contained in:
tegwick 2026-08-31 23:00:39 +02:00
parent 903a2fb090
commit cf40c7bb4e
5 changed files with 87 additions and 4 deletions

View file

@ -324,7 +324,10 @@ async def _record_invalid_import(
import_run = FabricGraphImport(
source_repo_slug=source_repo_slug,
source_url=source_url,
source_commit=_source_value(payload, "commit"),
# Invalid payloads are retained for diagnostics, but their
# denormalized provenance must not make the rejection path fail.
# The complete input remains available in ``graph_json``.
source_commit=_bounded_source_value(payload, "commit", max_length=255),
source_path=_source_value(payload, "path"),
api_version=str(payload.get("apiVersion")) if payload.get("apiVersion") else None,
export_kind=str(payload.get("kind")) if payload.get("kind") else None,
@ -620,6 +623,13 @@ def _source_value(payload: dict[str, Any], field: str) -> str | None:
return str(value) if value else None
def _bounded_source_value(
payload: dict[str, Any], field: str, *, max_length: int
) -> str | None:
value = _source_value(payload, field)
return value[:max_length] if value is not None else None
def _parse_datetime(value: Any) -> datetime | None:
if not isinstance(value, str) or not value:
return None