Repository navigation
feat(ci): UTC-timestamp gate + fix remaining slack-bridge instance - #917
Merged
Merged
Conversation
Follow-up to #909. Closes the two loose ends from the local-time- mislabeled-as-UTC timestamp bug: - src/slack-bridge.py:359 had the same bug #909 fixed in discord/ telegram bridges — the task `timestamp:` field written as local time with a literal `Z`. Fixed identically via time.gmtime(). - scripts/check-utc-z-strftime.py: an AST gate that flags single-arg time.strftime() with an ISO-datetime format mislabeled as UTC (`Z`). Wired as a CI step — no stock linter catches this (Ruff DTZ covers datetime, not time.strftime). Precise: requires the `Z` mislabel, so innocent local-time console-log timestamps are not flagged. Closes #916 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks done
sonichi
approved these changes
May 20, 2026
sonichi
left a comment
Owner
There was a problem hiding this comment.
AST gate looks solid — covers both f-string-{strftime}Z and embedded-Z-in-fmt cases, excludes the 2-arg gmtime form, skips itself to avoid docstring-example false-positives. Sandboxed to time.strftime (Ruff DTZ handles datetime.strftime). slack-bridge.py:359 fix matches the established UTC pattern from PRs #909 and the in-file priors. CI integration is clean — adds scripts/** to triggers + the new step. No deps, runs on stock python3. LGTM.
liususan091219
added a commit
to liususan091219/sutando-fork
that referenced
this pull request
May 28, 2026
Follow-up to sonichi#909. Closes the two loose ends from the local-time- mislabeled-as-UTC timestamp bug: - src/slack-bridge.py:359 had the same bug sonichi#909 fixed in discord/ telegram bridges — the task `timestamp:` field written as local time with a literal `Z`. Fixed identically via time.gmtime(). - scripts/check-utc-z-strftime.py: an AST gate that flags single-arg time.strftime() with an ISO-datetime format mislabeled as UTC (`Z`). Wired as a CI step — no stock linter catches this (Ruff DTZ covers datetime, not time.strftime). Precise: requires the `Z` mislabel, so innocent local-time console-log timestamps are not flagged. Closes sonichi#916 Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Follow-up to #909 — closes the two loose ends from the local-time-mislabeled-as-UTC timestamp bug.
src/slack-bridge.py:359had the same bug fix(bridges): write task timestamps in UTC, not local time #909 fixed in the Discord/Telegram bridges — tasktimestamp:written as local time with a literalZ. Fixed identically withtime.gmtime().scripts/check-utc-z-strftime.py— a new AST gate that flags single-argtime.strftime()calls whose ISO-datetime output is mislabeled as UTC. Wired as a CI step. No stock linter catches this — Ruff'sDTZrules coverdatetime, nottime.strftime.Detector precision
It flags a
time.strftime(<fmt>)call only when BOTH:Zin the format string, or in the enclosing f-string.So
time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())(2 args, genuine UTC) andtime.strftime('%H:%M:%S')in a console log line (no UTC claim) are not flagged. Verified: before the slack-bridge fix the gate flagged exactlyslack-bridge.py:359; after, it passes clean.Test plan
python3 scripts/check-utc-z-strftime.py— exits 1 on the buggy slack-bridge line, exits 0 after the fixtime.strftime('%H:%M:%S')console-log lines (e.g.src/github-webhook.py)Closes #916