Skip to content

Use UTC for scan timestamps and document ISO-8601 fields#217

Merged
zvigrinberg merged 1 commit intoRHEcosystemAppEng:mainfrom
batzionb:timezones
Mar 30, 2026
Merged

Use UTC for scan timestamps and document ISO-8601 fields#217
zvigrinberg merged 1 commit intoRHEcosystemAppEng:mainfrom
batzionb:timezones

Conversation

@batzionb
Copy link
Copy Markdown

Summary

Scan started_at and completed_at are now produced with UTC (datetime.now(timezone.utc).isoformat()), and the Pydantic field descriptions on ScanInfoInput state 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:00 suffix, so clients can reliably interpret the instant as UTC and convert to local time or compare with other UTC-normalized events.

Changes

  • register.py: set started_at / completed_at using UTC-aware datetimes.
  • exploit_iq_commons/data_models/input.py: document expected timestamp format on ScanInfoInput.

Made with Cursor

Copy link
Copy Markdown
Collaborator

@zvigrinberg zvigrinberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zvigrinberg
Copy link
Copy Markdown
Collaborator

/ok-to-test

@exploit-iq-pac
Copy link
Copy Markdown

Caution

There are some errors in your PipelineRun template.

PipelineRun Error
vulnerability-analysis-on-pr CEL expression evaluation error: expression "event == \"pull_request\" &&\n!body.pull_request.draft &&\n(target_branch == \"main\" || target_branch == \"rh-aiq-main\") &&\n(\"src/**\".pathChanged() || \"metrics_lib/**\".pathChanged() || \"pyproject.toml\".pathChanged() || \"uv.lock\".pathChanged() || \"Dockerfile\".pathChanged() || \".dockerignore\".pathChanged())\n" failed to evaluate: no such key: pull_request

@zvigrinberg
Copy link
Copy Markdown
Collaborator

/test vulnerability-analysis-on-pr

@zvigrinberg zvigrinberg merged commit 66fbbb8 into RHEcosystemAppEng:main Mar 30, 2026
3 checks passed
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.

2 participants