Skip to content

build(deps): replace chrono with jiff (#1474) - #1475

Open
sdairs wants to merge 1 commit into
deps/1185-restore-credentials-loginfrom
deps/1474-jiff-api
Open

sdairs wants to merge 1 commit into
deps/1185-restore-credentials-loginfrom
deps/1474-jiff-api

Conversation

@sdairs

@sdairs sdairs commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Fixes #1474

Why

chrono is unmaintained (RUSTSEC-2026-0543), so cargo audit --deny warnings fails on main and on every lockfile PR.

What

  • Library (breaking): timestamp fields are jiff::Timestamp instead of chrono::DateTime<chrono::Utc>. Changelog entry with the caller migration.
  • Analyzer: matches Timestamp as a string scalar; the chrono type names are gone.
  • CLI: all call sites migrated. cloud/shared.rs gains parse_rfc3339 (checks the RFC 3339 shape before jiff, which also reads wider ISO 8601 forms) and format_rfc3339 (0, 3, 6 or 9 fraction digits, as before).
  • chrono is out of Cargo.lock; jiff is built without its time zone database.

One PR, not the two the issue planned: the type change breaks the CLI build, so the library cannot land alone.

Behaviour changes

  • Human tables that printed +00:00 (activity, API key and invitation expiry, Postgres created and earliest restore) now print Z.
  • Library requests write a fractional second with the fewest digits (.5Z, was .500Z). Whole seconds are unchanged. Checked live for API key expiry: key create and key update accept 1, 2, 4 and 9 fraction digits, and the API drops the fraction as it does for main's .500Z. Postgres restore, BYOC and Pub/Sub timestamps were not checked live.

QA

cargo fmt; clippy for the CLI (default and --no-default-features), both library crates, and --workspace --all-features; cargo test for all three crates plus --features deprecated-fields; cargo audit --deny warnings passes. local_structured_errors_test failed once under the full parallel run and passed on three reruns.

Needs the run-cloud-integration label.

🤖 Generated with Claude Code


Note

Medium Risk
Breaking public API types for all timestamp fields plus subtle wire/display formatting differences; large surface area but motivated by a security advisory and covered by changelog migration notes.

Overview
Removes the unmaintained chrono dependency (RUSTSEC-2026-0543) and standardizes on jiff for timestamps across clickhouse-cloud-api, clickhousectl, and clickhouse-openapi-analyzer.

Library (breaking): every API model timestamp field and aliases like PgCreatedAtProperty now use jiff::Timestamp instead of chrono::DateTime<chrono::Utc>. Cargo.toml and CHANGELOG.md document caller migration (parse, to_string(), as_second()). On the wire, RFC 3339 UTC is unchanged, but serialized fractions use the fewest digits (e.g. .5Z vs chrono’s padded .500Z).

CLI: chrono is dropped from clickhousectl; call sites use jiff. cloud/shared.rs adds parse_rfc3339 (stricter RFC 3339 shape than jiff alone) and format_rfc3339 for display and API flags. Activity date defaults, OAuth token expiry, Postgres windows, Pub/Sub seek times, BYOC access windows, and human tables now go through these helpers (UTC suffixes show Z where some tables used +00:00).

Analyzer: response schema checks treat Timestamp as the string scalar instead of DateTime / chrono types.

Tests and integration code are updated to parse and compare jiff::Timestamp values consistently.

Reviewed by Cursor Bugbot for commit 7ca24a3. Bugbot is set up for automated code reviews on this repo. Configure here.

@sdairs
sdairs requested a review from iskakaushik as a code owner November 17, 2026 14:16
@sdairs sdairs added the run-cloud-integration Run live Cloud integration tests for this PR head label Nov 17, 2026
@sdairs
sdairs temporarily deployed to cloud-integration November 17, 2026 14:19 — with GitHub Actions Inactive
chrono is unmaintained (RUSTSEC-2026-0543). Library timestamp fields are now
jiff::Timestamp, the analyzer matches that type, and the CLI parses and
formats through two shared helpers that keep RFC 3339 strictness and the
previous fraction-digit formatting.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@sdairs
sdairs force-pushed the deps/1474-jiff-api branch from 0848d79 to 7ca24a3 Compare November 17, 2026 18:11
@sdairs
sdairs changed the base branch from main to deps/1185-restore-credentials-login November 17, 2026 18:11
@sdairs
sdairs added this pull request to stack #1483 November 17, 2026 18:11
@sdairs
sdairs temporarily deployed to cloud-integration November 17, 2026 18:14 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
cloud-integration — 7ca24a32 Deployed Nov 17, 2026 by sdairs via Cloud integration tests #2035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-cloud-integration Run live Cloud integration tests for this PR head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace chrono (RUSTSEC-2026-0543, unmaintained)

1 participant