Repository navigation
build(deps): replace chrono with jiff - #436
Merged
Merged
Conversation
A negative `younger_than_days` or `min_bug_age_days` loaded without complaint. For the matcher it asks for a cutoff in the future: the rule matched nothing, until the count was large enough for the date arithmetic to overflow, and from there it matched every bug, because an unrepresentable cutoff reads as "every bug is young". Where that flip happens depends on the date library's range, so the meaning of such a value is not something the policy file controls. A negative `min_bug_age_days` was inert; it is refused so that one sign rule covers both. Policy::validate now refuses them, naming the rule or the global key. Zero stays legal in both places. A policy file that carried a negative count stops the server from starting until the value is changed, and the README says what each rewrite means.
chrono is unmaintained (RUSTSEC-2026-0543), and deny.toml fails on an unmaintained crate that a workspace crate depends on directly. Both crates did, for one type and three operations: an instant, parsing it, subtracting days from it and formatting it. jiff 0.2 covers those with its defaults switched off, so no time zone database comes along, and schemars emits the same `date-time` schema for jiff::Timestamp as for chrono's DateTime: `initialize` and `tools/list` are served byte-identical. Measured against chrono 0.4.45 with jiff 0.2.46, over 64 timestamp strings, a grid of day counts and 20,012 instants: - Parsing follows jiff's ISO 8601 grammar. It accepts strings chrono refused (no seconds, `+02`, a bracketed zone name) and refuses some chrono accepted (ten or more fractional digits, a Unicode minus, the last hours of year 9999; on the tool parameters also surrounding whitespace and unpadded fields). A second 60 reads as 59. Bugzilla's own shape reads as the same instant, and an unparsable `creation_time` is still unknown and fails closed (I4). - `age_cutoff` gives the same cutoff wherever both can represent it. jiff stops at year -9999 where chrono went some 262,000 years back; for a cutoff before that, both criteria reach the verdict they reached with chrono. A cutoff after year 9999 takes a negative count, which the loader now refuses; built past it, the matcher matches nothing. - The audit `ts` is byte-identical. So is the query string sent to Bugzilla from year 0000 on; before it jiff writes `-001` where chrono wrote `-0001`. - The reply to an unusable `new_since` or `changed_since` carries jiff's wording, which quotes the unparsed rest of the client's own string, escaped. At the default log level none of it is logged; under debug rmcp's `response message` line carries it, as it does for every parameter error. The two parameters' own log fields print fractions without trailing zeros. chrono stays in the dependency tree through rmcp, which depends on it and enables schemars' chrono04. bugwarden-core's public API takes jiff::Timestamp where it took chrono::DateTime<Utc>, a breaking change for that crate: its next release has to be 0.8.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the unmaintained chrono (RUSTSEC-2026-0543), which fails the required
rust-denycheck on every PR, withjiff0.2;initializeandtools/listare served byte-identical, and the second commit's message lists every parsing and formatting difference measured against chrono. The first commit refuses a negativeyounger_than_daysormin_bug_age_daysat load, because the swap keeps every verdict only without them; it cannot land on its own whilerust-denyis red, socargo denyfirst passes at the second commit.bugwarden-core's public API now takesjiff::Timestamp, so its next release has to be 0.8.0.Closes #432