fix(sprint): accept null start/finish from server (YT-2) #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/sprint-list-null-dates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
YouTrack returns
nullfor sprintstart/finishwhen a sprint has no scheduled dates set. Barei64with#[serde(default)]rejectsnullbecause serde default only fires for missing fields, not explicit JSON null, soyt sprint listcrashed withinvalid type: null, expected i64against any board that has a dateless sprint. This commit switchesSprint.startandSprint.finishtoOption<i64>so bothnulland missing becomeNone, and updates thedetermine_current_sprinttime-window check accordingly. The fallback comparator onb.finish.cmp(&a.finish)is unchanged becauseOption<T>ordersNonebelowSome(_), preserving the prior0-as-sentinel ordering.First of three items on YT-2. The
yt sprint createandyt sprint updatecommands are still open on that issue and will land in follow-up PRs.YouTrack
YT-2 (item 1 of 3, leaves issue in progress)
Test plan
list_sprints_tolerates_null_datesinsrc/yt/api.rsdeserializes a sprint with"start":null,"finish":nullvia wiremock; this would have failed pre-fix.just pre-commitruns fmt, clippy, build, test. One pre-existing unrelated test failure:commands::update::tests::check_writable_returns_friendly_message_on_readonly_dirfails onorigin/mainwithout these changes too. Looks like the test'sUSER=rootskip guard is insufficient inside the rust-builder docker container; worth a separate ticket but out of scope here.yt sprint list --board "Investigator Database"against the isimcha.myjetbrains.com instance to confirm the live repro captured in the YT-2 comment thread is fixed.