Skip to content

Preserve fractional seconds in ISO8601 log record exports - #634

Merged
RazerM merged 2 commits into
getlogbook:mainfrom
oyeong011:fix/iso8601-fraction-padding
Sep 12, 2026
Merged

Preserve fractional seconds in ISO8601 log record exports#634
RazerM merged 2 commits into
getlogbook:mainfrom
oyeong011:fix/iso8601-fraction-padding

Conversation

@oyeong011

Copy link
Copy Markdown
Contributor

format_iso8601() renders microsecond=1 as .1, which represents 100000 microseconds. Pad the fractional part to six digits so JSON-safe LogRecord exports survive an exact timestamp round trip. Seven regression cases include zero and six-digit fractions.

Validation: Original regression: five parameter cases failed against the unmodified implementation (1/12/123/1234/12345 microseconds); see logbook-red.log. Full suite: 260 passed, 38 skipped in 5.10s (logbook-green.log). Final formatted test rerun: 9 passed. Ruff check and Ruff format checks passed on both changed files.

Manual QA: PASS: six LogRecord JSON export/import timestamps preserve exact microseconds

Limitations: macOS CPython 3.14.6, pure Python fallback; 38 optional/backend tests skipped; native Rust backend and other Python versions were not tested.

AI disclosure: OpenAI Codex generated and locally tested this patch and regression tests.

oyeong011 and others added 2 commits September 8, 2026 11:49
Constraint: Preserve existing supported Python syntax and public API behavior.
Confidence: high
Scope-risk: narrow
Tested: 260 tests passed, 38 optional tests skipped; public LogRecord JSON round-trip
Not-tested: Other Python versions and operating systems.
@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.36%. Comparing base (628800b) to head (37daf60).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #634      +/-   ##
==========================================
+ Coverage   85.34%   85.36%   +0.01%     
==========================================
  Files          45       45              
  Lines        5806     5813       +7     
  Branches      465      465              
==========================================
+ Hits         4955     4962       +7     
  Misses        721      721              
  Partials      130      130              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RazerM
RazerM merged commit ffccdce into getlogbook:main Sep 12, 2026
49 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