Fix watcher timestamp handling for reused categorized runs

- interpret ATVM controller log timestamps in the controller's local timezone before converting to UTC so the watcher uses the correct current-run window
- prevent newly started categorized runs from immediately picking up older categorized artifacts just because the parent build name was reused
- keep the categorized watcher focused on artifacts from the current controller run instead of stale prior attempts
This commit is contained in:
2026-03-26 12:26:23 -04:00
parent 3ea732d63c
commit 1ba508169f

View File

@@ -27,6 +27,8 @@ RUN_STATES = {
"RUNNING",
}
LOCAL_TZ = datetime.now().astimezone().tzinfo or timezone.utc
@dataclass
class HostResult:
@@ -177,7 +179,7 @@ def parse_xml_timestamp(raw: Optional[str]) -> Optional[datetime]:
def parse_log_timestamp(raw: str) -> Optional[datetime]:
try:
return datetime.strptime(raw, "%Y-%m-%d %H:%M:%S,%f").replace(tzinfo=timezone.utc)
return datetime.strptime(raw, "%Y-%m-%d %H:%M:%S,%f").replace(tzinfo=LOCAL_TZ).astimezone(timezone.utc)
except ValueError:
return None