fix(logstore): normalize workflow datetimes to UTC - #40967
Closed
weike-zhang wants to merge 2 commits into
Closed
Conversation
Contributor
Pyrefly Type Coverage
|
asukaminato0721
approved these changes
Aug 19, 2026
weike-zhang
force-pushed
the
fix/logstore-utc-normalization
branch
from
August 20, 2026 05:27
f9dd61c to
14abd85
Compare
Contributor
Author
|
The Web Full-Stack E2E failure is a CI infrastructure timeout: the |
Contributor
Author
|
This fix is already merged upstream via #40947 (identical changes to the workflow run and node-execution repositories). Closing this PR as superseded — no further action needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #40943
What
Normalize LogStore workflow timestamps to naive UTC in both workflow run and workflow node execution repositories.
Why
The current code uses local-time datetime constructors for epoch and missing-value branches, which can shift timestamps by host timezone and produce incorrect or even negative elapsed times.
How
naive_utc_now()for missing timestampsensure_naive_utc(datetime.fromisoformat(...))for ISO stringsdatetime.fromtimestamp(..., tz=UTC).replace(tzinfo=None)for epoch valuesVerification
uv run --project api pytest -o addopts='--import-mode=importlib' api/tests/unit_tests/extensions/logstore/repositories/test_logstore_api_workflow_run_repository.py api/tests/unit_tests/extensions/logstore/repositories/test_logstore_api_workflow_node_execution_repository.py api/tests/unit_tests/extensions/logstore/repositories/test_logstore_workflow_node_execution_repository.py