Repository navigation
fix(cli): show full task and parent IDs in rich views (#1340) - #1658
prateeknitcse wants to merge 2 commits into
Conversation
markramm
left a comment
There was a problem hiding this comment.
Thank you for taking #1340. The change is the small one the groom asked for: the 12-character slices are gone from _render_list (ID and Parent) and from the child lines in _render_task, and the columns use overflow="fold" so long IDs wrap instead of being cut. The diff to pyrite/cli/task_commands.py is only +5/-5, built on current dev, which is exactly right. One blocking item: the new test file will trip a repository guard test.
Blocking
tests/test_task_rich_ids.py, fixturelong_id_task_cli_env:with patch("pyrite.cli.context.load_config", return_value=config):is a patch ofload_config, whichtests/test_production_wiring_guard.py::test_no_file_adds_a_sitecounts (baseline 0) and fails on ("1 load_config site(s), baseline 0"). Patching it skips config parsing and the untrusted-config rules the real command runs. Please switch to thecli_worldfixture fromtests/conftest.py, which runs the realload_configagainst a throwaway config. Create the parent and child tasks throughworld(or the task service it exposes) and callworld.cli("task", "list", ...). To set the width, passCOLUMNSthe way other tests in the repo do withcli_world; look at how a neighbouring test sets terminal width. The guard test is in the shards still running as I write (see CI below), so I expect it to go red.
Non-blocking
- The narrow-terminal test (
COLUMNS=60) asserts"write-th" in res.output and "form" in res.output. That depends on where Rich chooses to fold, and could break on a Rich upgrade. Asserting that the full ID can be reassembled (strip newlines, borders and spaces from each row, then check) is more robust. The groom also says the Title column should give up width first; addingmin_widthto the ID column (orno_wrap=Falseplus aratioon Title) would make that explicit, but folding already avoids the truncation the issue is about. - The fixture's inline comments name IDs ("parent-epic-for-login", "exactly twel") that are only illustrative; the IDs are generated from the titles. The 12-char case is titled "Exactly twel" but the generated ID is probably a slug of different length. If you want a real 12-character ID, assert
len(exact_id) == 12in the fixture so the test checks what it claims. - Optional: a task with no parent (empty Parent cell) is a regime the groom lists; the
exacttask covers it implicitly, but an assertion that the cell is empty would be explicit. - This reuses a pattern from
tests/test_task_cli_get.py:30(task_cli_env); you could import or extend that fixture rather than build a new one.
Duplicate: #1341 (HarshRajSinghania, opened 2026-10-25) also closes #1340. It has been reviewed twice and is state: needs-author; its branch is based on a very stale dev and conflicts, with a large unrelated rewrite of task_commands.py. This PR is the cleaner of the two, so the maintainer will likely prefer it once the test is fixed. Please mention #1341 in your PR description so the maintainer can close it.
CI: changes, lock, collect, mypy (advisory), experimental and test (3.12, 1) passed; test (3.12, 2) and test (3.12, 3) were pending when I looked. A coverage/e2e/frontend/kb/smoke jobs were skipped.
Triggers: none. 3 files, CLI rich rendering only; no flag, REST field, MCP argument or file format changes, and nothing in pyrite/server/, storage/, schema/ or auth. JSON output (the default) is untouched, and MCP/REST are unaffected, as the groom states. The only wrinkle is the competing PR #1341.
There is a changelog fragment (changelog.d/1340-task-rich-full-ids.fixed.md).
Recommendation: request changes.
Closes #1340. Supercedes stale duplicate #1341.
Summary of Changes
pyrite/cli/task_commands.py:_render_list(task list --format rich): removed 12-character slicing on task ID and parent ID, replacingmax_width=12withoverflow="fold"so full IDs display without truncation._render_task(task get --format rich): removed 12-character slicing on child task IDs.tests/test_task_rich_ids.pyusingcli_worldfixture (without patchingload_config), verifying full IDs and narrow terminal column reassembly.changelog.d/1340-task-rich-full-ids.fixed.md.