FJ-35: fix fj pr status panic on merged PRs (unbound $created_at) #43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/pr-status-merged-panic-FJ-35"
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?
FJ-35:
fj pr statuspanics on merged PRsProblem
fj pr status <n>panicked on merged PRs withResolver error: Unknown variable: $created_at, aborting atcrates/fj/src/prs.rsin the "Merged by {user} on {date}" path. Themsg-pr-status-mergedFluent template referenced$created_at, but the call site boundmerged_at, so the date placeholder rendered asDATETIME()and the shared error path panicked. Open PRs were unaffected. This broke unattended CI polling that grepsfj pr statusoutput, since the loop only saw panic text once a PR merged.Fix
$created_atto$merged_atin all four locales (en-US, de-DE, zh-Hans, tok), matching the existingmerged_atbinding (the semantically correct PR field for "Merged by X on Y").ftl_try_format!macro plustry_format_pattern, returningOption<String>. The merged-by path now degrades to an unformatted timestamp on any resolver error instead of aborting, so one bad template never kills the command.DATETIME(leaks.Acceptance criteria
fj pr status <n>on a merged PR exits 0 and shows "Merged by {user} on {date}" with a resolved dateVerification
cargo fmt --all --check,cargo clippy --all-targets --all-features(clean), andcargo test --workspace(3 new tests pass) all green. Reverting the template to$created_atmakes the merged test fail, confirming it guards the bug.🤖 Generated with Claude Code