Skip to content

Fix timezone-aware --since filtering in fetch-workflow-logs - #2159

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
fix-2158-since-timezone-boundary-3d699d8e7637e05d
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
fix-2158-since-timezone-boundary-3d699d8e7637e05d

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

This fixes incorrect --since filtering in scripts/fetch-workflow-logs.py when the since value includes a timezone offset (for example, 2025-01-01T00:00:00-05:00).

Root cause: the script compared timestamps as raw strings, which is not chronologically correct across differing timezone representations.

What changed

  • Replaced string-based boundary comparisons with timezone-aware datetime comparisons in UTC.
  • Added _parse_iso8601_utc() to parse ISO 8601 timestamps (including Z and explicit offsets) and normalize to UTC.
  • Added _normalize_since() for date-only --since values so they are interpreted as start-of-day UTC (T00:00:00Z), mirroring the existing date-only --until normalization.
  • Added a regression test covering the reported case where 2025-01-01T04:30:00Z must be excluded for --since 2025-01-01T00:00:00-05:00.

Validation

UV_CACHE_DIR=/tmp/gh-aw/agent/uv-cache uv run --extra test pytest -q tests/test_fetch_workflow_logs.py
make lint

Closes #2158.


What is this? | From workflow: Trigger Bug Hunter

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug-hunter] fetch-workflow-logs --since misfilters timezone-offset ISO8601 values

0 participants