fix(issue): surface description on issue inspect (YT-1) #43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-inspect-description"
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?
Fixes YT-1: https://niceguyit.myjetbrains.com/issue/YT-1.
yt issue inspect <ID>was silently dropping thedescriptionfield. The web UI and the raw REST API both return it (LC-123, for example, has a ~5,500-char planning description), but the CLI's selector requested onlyidReadable,summary,customFields(...)and theIssuemodel had nodescriptionfield anyway, so serde would have dropped it even if the server returned it.Changes:
src/yt/models.rs: adddescription: StringtoIssuewith#[serde(default, deserialize_with = "null_or_missing_to_default")]so a missing ornullvalue decodes as"", matching howProject::descriptionis already handled.src/yt/api.rs::inspect_issue: includedescriptionin the field selector.src/commands/issue/inspect.rs::render: print aDescription:block between the title line andFields:. Empty description renders as(none); non-empty prints the full markdown verbatim (one line per source line, no wrapping, no truncation; pipe through a pager if needed).--jsonoutput picks up the new field automatically via the existingSerializederive.Out of scope: list / search / sprint-resolution selectors stay narrow on purpose. Pulling the full description into a 100-row table view would balloon responses with no benefit; users who want it run
yt issue inspect.Tests:
yt::api::inspect_issue_aggregates_all_subfetchesnow asserts the description round-trips.yt::api::inspect_issue_null_description_decodes_as_emptycovers the"description": nullcase.commands::issue::inspect::render_smoke_handles_empty_descriptionexercises the empty-description rendering path.Issue { ... }literals incommands/list.rstests that did not use..Default::default()(they would otherwise have stopped compiling after the struct gained a field).Verification:
just check(fmt + clippy-D warnings+ builder-stage docker build) is green.just test: 220 passed, 0 failed.https://niceguyit.myjetbrains.com/api/issues/LC-123after merge will confirm end-to-end behavior matches the test assertions.The CLI requested only idReadable / summary / customFields when inspecting an issue and never deserialized the description, so `yt issue inspect <ID>` silently dropped the body that the web UI and raw REST API both return. Added a `description` field on the `Issue` model with the null/missing-tolerant deserializer (same pattern as `Project::description`), included `description` in the inspect field selector, and rendered a `Description:` block in the formatted output (`(none)` when empty, full markdown verbatim otherwise). The `--json` output picks it up via serde. List/search/sprint-resolution selectors deliberately stay narrow. Tests: extended the existing `inspect_issue_aggregates_all_subfetches` to assert description round-trips, added `inspect_issue_null_description_decodes_as_empty`, and a render smoke test for the empty-description path. Also patched three `Issue { ... }` literals in `commands/list.rs` tests that did not use `..Default::default()` and would otherwise have stopped compiling. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>