Skip to content

fix(deps): replace unmaintained chrono with jiff - #67

Merged
kleinbem merged 1 commit into
mainfrom
drop-chrono
Nov 17, 2026
Merged

kleinbem merged 1 commit into
mainfrom
drop-chrono

Conversation

@kleinbem

@kleinbem kleinbem commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Why

osv-scanner now reports RUSTSEC-2026-0543: every chrono release is marked unmaintained, with no fixed version. That fails fleet-lint on every PR in this repo (first seen on #65). Tracking: #66.

An ignore entry would only postpone it, and the dependency is easy to drop: revue is the only crate in Cargo.lock that uses chrono, in three places, all for the current UTC time as a string.

What

  • chrono → jiff (0.2, std feature only), one of the alternatives the advisory names.
  • New db::now_rfc3339() replaces the three Utc::now().to_rfc3339() calls. It keeps the +00:00 offset chrono wrote, so new created_at values sort correctly next to existing rows (the column is text and indexed for ORDER BY created_at DESC).
  • Cargo.lock: chrono and the nine crates only it needed are gone; jiff and four helpers come in. No other version changes.

One difference: jiff prints only as many fractional-second digits as needed, chrono padded to 3, 6 or 9. Nothing in the Rust code parses the value back.

Tests

  • New unit test now_rfc3339_matches_stored_format.
  • cargo test --all-targets: 97 passed, 0 failed, 1 ignored (the live Ollama benchmark).
  • cargo clippy --all-targets -- -D warnings and cargo fmt --check clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Review and feedback records now use consistent UTC timestamps, including the +00:00 offset.
    • Newly created review records follow the same timestamp format, helping keep their dates consistent and correctly ordered alongside previously stored records.

RUSTSEC-2026-0543 marks every chrono release as unmaintained, which fails
osv-scanner in fleet-lint on every PR. chrono was only used for the current
UTC time as an RFC 3339 string; that now goes through db::now_rfc3339(),
which keeps the +00:00 offset so created_at text still sorts by time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@kleinbem kleinbem added the cr-review Ask CodeRabbit to review this PR label Nov 17, 2026
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The project replaces chrono with jiff and adds a shared UTC timestamp formatter. Review, feedback and pending review records use the formatter for created_at.

Changes: UTC timestamp formatting

Layer / File(s) Summary
Add the shared UTC formatter
Cargo.toml, src/db.rs
The project replaces chrono with jiff and adds a public helper that formats the current timestamp with a UTC +00:00 offset.
Use the formatter for created_at
src/db.rs, src/server.rs
Review, feedback and pending review records use the helper. A test checks the timestamp format and its text ordering against an earlier timestamp.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

  • kleinbem-dev/revue#66: The issue reports a chrono advisory and an osv-scanner fleet-lint failure. This change replaces chrono with jiff.
Merge Risk: Minimal · up to 7e1d1

The dependency swap preserves the stored created_at format and offset. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: replacing the chrono dependency with jiff. The raw summary confirms Cargo.toml swaps chrono for jiff 0.2, and src/db.rs and src/server.rs now use the new now_rfc3339 h…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: replacing the chrono dependency with jiff. The raw summary confirms Cargo.toml swaps chrono for jiff 0.2, and src/db.rs and src/server.rs now use the new now_rfc3339 helper for created_at. The 'fix(deps)' prefix matches the dependency-maintenance intent, which the objectives tie to RUSTSEC-2026-0543 and the osv-scanner failure.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Additional comments: 1

Cargo.toml-40-40: 1

40-40: Minor · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Add the upstream reference for this dependency fix.

The commit attributes this replacement to RUSTSEC-2026-0543, but Line 40 has no comment linking the upstream issue or PR. Add that reference beside the dependency so maintainers can trace the security-related replacement.

As per path instructions, “Every workaround or fix for someone else's bug … needs a comment linking the upstream issue or PR it waits on”.

Source: Path instructions

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 682e19ce-fcd6-44f7-957e-db8bf492aa62
Commits

Reviewing files that changed from the base of the PR and between 3c36528 and 7e1d185.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock, !**/Cargo.lock
Files selected for processing: 3

  • Cargo.toml
  • src/db.rs
  • src/server.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@kleinbem

Copy link
Copy Markdown
Member Author

Review body comment (link beside the jiff line in Cargo.toml): not adding one. The link rule is for workarounds that wait on an upstream fix, so they can be dropped later. This is a permanent swap to a regular dependency with nothing to revert; the advisory and #66 are named in the commit message and the PR body.

@kleinbem
kleinbem merged commit 10295c7 into main Nov 17, 2026
6 checks passed
@kleinbem
kleinbem deleted the drop-chrono branch November 17, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cr-review Ask CodeRabbit to review this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant