Skip to content

fix(host-grants): handle YAML timestamps in config hashing - #1105

Merged
pengfei-threemoonslab merged 3 commits into
ThreeMoonsLab:mainfrom
Subodh-17:fix/issue-1100-yaml-timestamps
Nov 6, 2026
Merged

pengfei-threemoonslab merged 3 commits into
ThreeMoonsLab:mainfrom
Subodh-17:fix/issue-1100-yaml-timestamps

Conversation

@Subodh-17

Copy link
Copy Markdown
Contributor

Summary

Fixes #1100.

PyYAML resolves unquoted ISO-8601 timestamp scalars into Python datetime.datetime and datetime.date objects. These values previously caused host configuration hashing to fail during canonical JSON serialization.

Changes

  • Normalize date and datetime values using deterministic ISO-8601 representations.
  • Preserve strict serialization errors for unsupported object types.
  • Preserve secret-redaction precedence.
  • Add focused regression coverage for YAML timestamps, dates, timezone offsets, hashing determinism, and unsupported values.
  • Add an end-to-end synthetic Git repository CLI regression test.

Testing

  • 9 focused timestamp regression tests passed.
  • 76 related tests passed.
  • Synthetic CLI regression verified successfully.
  • Ruff checks passed.
  • Git diff checks passed.

@pengfei-threemoonslab pengfei-threemoonslab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

…-f20006

# Conflicts:
#	tests/shard_seconds.json
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.

Host diff crashes on YAML timestamps resolved as datetime

2 participants