Use UTC for scan timestamps and document ISO-8601 fields#217
Merged
zvigrinberg merged 1 commit intoRHEcosystemAppEng:mainfrom Mar 30, 2026
Merged
Use UTC for scan timestamps and document ISO-8601 fields#217zvigrinberg merged 1 commit intoRHEcosystemAppEng:mainfrom
zvigrinberg merged 1 commit intoRHEcosystemAppEng:mainfrom
Conversation
Collaborator
|
/ok-to-test |
|
Caution There are some errors in your PipelineRun template.
|
Collaborator
|
/test vulnerability-analysis-on-pr |
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
Scan
started_atandcompleted_atare now produced with UTC (datetime.now(timezone.utc).isoformat()), and the Pydantic field descriptions onScanInfoInputstate that values are ISO-8601 with a UTC offset (e.g....+00:00).Why this matters for clients
Without an explicit offset, timestamps from
datetime.now().isoformat()are naive: they look like local wall-clock time but carry no timezone indicator, so API consumers cannot tell whether the value is UTC, local server time, or another zone. That breaks correct ordering, auditing, and display when clients are in different regions.ISO-8601 strings from
datetime.now(timezone.utc).isoformat()include a+00:00suffix, so clients can reliably interpret the instant as UTC and convert to local time or compare with other UTC-normalized events.Changes
register.py: setstarted_at/completed_atusing UTC-aware datetimes.exploit_iq_commons/data_models/input.py: document expected timestamp format onScanInfoInput.Made with Cursor