fix(issue): surface description on issue inspect (YT-1) #43

Merged
David merged 1 commit from fix/issue-inspect-description into main 2026-05-17 02:07:27 +02:00
Owner

Fixes YT-1: https://niceguyit.myjetbrains.com/issue/YT-1.

yt issue inspect <ID> was silently dropping the description field. 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 only idReadable,summary,customFields(...) and the Issue model had no description field anyway, so serde would have dropped it even if the server returned it.

Changes:

  • src/yt/models.rs: add description: String to Issue with #[serde(default, deserialize_with = "null_or_missing_to_default")] so a missing or null value decodes as "", matching how Project::description is already handled.
  • src/yt/api.rs::inspect_issue: include description in the field selector.
  • src/commands/issue/inspect.rs::render: print a Description: block between the title line and Fields:. 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).
  • --json output picks up the new field automatically via the existing Serialize derive.

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_subfetches now asserts the description round-trips.
  • New yt::api::inspect_issue_null_description_decodes_as_empty covers the "description": null case.
  • New commands::issue::inspect::render_smoke_handles_empty_description exercises the empty-description rendering path.
  • Patched three Issue { ... } literals in commands/list.rs tests 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.
  • Not yet exercised against a live YouTrack instance; a follow-up smoke run against https://niceguyit.myjetbrains.com/api/issues/LC-123 after merge will confirm end-to-end behavior matches the test assertions.
Fixes YT-1: <https://niceguyit.myjetbrains.com/issue/YT-1>. `yt issue inspect <ID>` was silently dropping the `description` field. 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 only `idReadable,summary,customFields(...)` and the `Issue` model had no `description` field anyway, so serde would have dropped it even if the server returned it. Changes: - `src/yt/models.rs`: add `description: String` to `Issue` with `#[serde(default, deserialize_with = "null_or_missing_to_default")]` so a missing or `null` value decodes as `""`, matching how `Project::description` is already handled. - `src/yt/api.rs::inspect_issue`: include `description` in the field selector. - `src/commands/issue/inspect.rs::render`: print a `Description:` block between the title line and `Fields:`. 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). - `--json` output picks up the new field automatically via the existing `Serialize` derive. 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_subfetches` now asserts the description round-trips. - New `yt::api::inspect_issue_null_description_decodes_as_empty` covers the `"description": null` case. - New `commands::issue::inspect::render_smoke_handles_empty_description` exercises the empty-description rendering path. - Patched three `Issue { ... }` literals in `commands/list.rs` tests 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. - Not yet exercised against a live YouTrack instance; a follow-up smoke run against `https://niceguyit.myjetbrains.com/api/issues/LC-123` after merge will confirm end-to-end behavior matches the test assertions.
fix(issue): surface description on issue inspect (YT-1)
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 16s
Create release / Create release from merged PR (pull_request) Has been skipped
05385d7b68
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>
David merged commit 479f407d4b into main 2026-05-17 02:07:27 +02:00
David deleted branch fix/issue-inspect-description 2026-05-17 02:07:27 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/youtrack-cli!43
No description provided.