Skip to content

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Sep 4, 2025

Introduces a crate for time utilities (`serde-time-util`). The crate currently provides a trait `DurationExt` which provides a `friendly()` method for formatting a `Duration` as a human-readable string. It also allows parsing a human-friendly duration into a string.


Additionally, this removes the helpers from `DurationString` and keeps `restate-serde-util`'s DurationString as a serialization helper only.

Minor but relevant changes:
- Some debug traces that reported the response latency now use the `to_seconds_span()` since it's cheaper to compute.
- Fixed typos in restate CLI service config commands
- More efficient serialization for DurationString that avoids an extra String allocation.
- Used jiff's native span rounding feature to round a duration to "days" instead of the manual calculation.
- Added a `negated()` method to the time span types to support "ago" formatting.
- Migrateed all uses of `DurationString` to `DurationExt::friendly()` including in CLI argument parsing.
Copy link

github-actions bot commented Sep 4, 2025

Test Results

  7 files  ±0    7 suites  ±0   4m 0s ⏱️ +17s
 54 tests ±0   52 ✅  - 1  1 💤 ±0  1 ❌ +1 
223 runs  ±0  214 ✅  - 6  3 💤 ±0  6 ❌ +6 

For more details on these failures, see this check.

Results for commit dbfeebc. ± Comparison against base commit 358a3e8.

♻️ This comment has been updated with latest results.

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.

1 participant