Skip to content

fix: drop chrono, and cover the lines rust 1.100 counts - #6

Merged
fernandorocagonzalez merged 3 commits into
mainfrom
test/cover-rust-1.100-lines
Nov 17, 2026
Merged

fernandorocagonzalez merged 3 commits into
mainfrom
test/cover-rust-1.100-lines

Conversation

@fernandorocagonzalez

@fernandorocagonzalez fernandorocagonzalez commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Two things that have to land together, because each one is blocking the other's checks.

chrono is gone. Since today cargo deny fails on main with RUSTSEC-2026-0543 (chrono is unmaintained). The only use was formatting a file's modification time as RFC 3339 in the config listing. It now uses jiff 0.2, which is the line croner uses, so services end up with a single jiff. The string stays exactly as chrono gave it: +00:00 instead of Z, and the fraction in groups of 3, 6 or 9 digits. I compared it against chrono on 200,000 instants, including some before 1970, with zero differences, and a unit test pins that shape.

Coverage back to 100%. The test check also fails on main with no code change, because the runner moved to rust 1.100:

  1. The never-taken else of the if let that sets the session cookie now counts as a line. The header goes in through extend and behaviour doesn't change.
  2. The copy of a tracing event that goes to the log crate when there is no tracing subscriber now counts too. axum turns tracing's log feature on, so that path is real. tests/log_fallback_test.rs (its own binary, since the logger is global) checks that the audit event and the missing index.html warning reach a log logger.
  3. llvm-cov's summary keeps, per function, the single copy that covers the most lines (unit test build, integration build, generic instantiation), not their union. header_block and UiAssets::new were only fully covered across copies, so I extended the existing tests until one copy covers every line.

Checked in a container with the same toolchain as CI (rust 1.100.0, cargo-llvm-cov 0.9.1): 100% lines, all tests green.

Rust 1.100 counts two things as lines that older compilers did not: the implicit else of an if let, and the copy of a tracing event that goes to the log crate when no tracing subscriber is set. The coverage check went from 100% to 99.75% on main with no code change.

The cookie header is now set through an extend instead of an if let, and a test in its own binary installs a log logger with no tracing subscriber, checking that the audit event and the missing index.html warning still reach a service that logs through the log crate. A second test checks that warning under a tracing subscriber.
llvm-cov's summary keeps, per function, the single copy (unit test build, integration build, generic instantiation) that covers the most lines, not their union. header_block and UiAssets::new were covered only across copies, which the summary counts as a missed line even though every line runs.
chrono is flagged unmaintained (RUSTSEC-2026-0543), which fails cargo deny. The one use, a file's modification time as RFC 3339, moves to jiff 0.2 (the line croner uses, so services carry a single jiff), keeping the exact string chrono gave: a +00:00 offset and the fraction in groups of three digits. Checked against chrono on 200,000 instants, before 1970 included.
@fernandorocagonzalez fernandorocagonzalez changed the title test: cover the lines rust 1.100 counts fix: drop chrono, and cover the lines rust 1.100 counts Nov 17, 2026
@fernandorocagonzalez
fernandorocagonzalez merged commit 78984e2 into main Nov 17, 2026
3 checks passed
@fernandorocagonzalez
fernandorocagonzalez deleted the test/cover-rust-1.100-lines branch November 17, 2026 18:18
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026
fernandorocagonzalez pushed a commit that referenced this pull request Nov 17, 2026
🤖 I have created a release *beep* *boop*
---


## [0.3.1](v0.3.0...v0.3.1)
(2026-11-17)


### Fixed

* drop chrono, and cover the lines rust 1.100 counts
([#6](#6))
([78984e2](78984e2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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