fix(sprint): use brace grouping for Board/sprint command (YT-3) #46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/sprint-set-command-braces"
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
yt issue sprint set --board "Investigator Database" --sprint "Sprint 1" IDB-87 [...]returned HTTP 400Unknown command: Board "Investigator Database" "Sprint 1"from the YouTrack/api/commandsendpoint. Root cause:build_apply_sprint_commandinsrc/yt/query.rsemitted Go-style double-quoted values (ported verbatim from the Go CLI), but YouTrack's command-language parser groups multi-word values with curly braces, not double quotes. Same root cause confirmed against the rawyt issue apply --command 'Sprints "Sprint 1"'passthrough, which also 400'd against the live server.Fix is one-line at the format-string level: emit
Board {<board>} {<sprint>}instead ofBoard "<board>" "<sprint>". This matches the brace convention already used elsewhere in the same file (build_queryfor the sprint search filter atsrc/yt/query.rs:68). Thego_quotehelper is no longer used and was dropped.Escape behavior for literal
{or}inside a board or sprint name is intentionally left undefined; real-world names do not contain those characters and the existingbuild_querymakes the same simplification. Easy to revisit if a user reports it.YouTrack
YT-3 (closes)
Test plan
apply_sprint_command_brace_groups_both_names(was..._quotes_both_names) insrc/yt/query.rsasserts the new wire format. Addedapply_sprint_command_brace_groups_single_word_namesto lock in single-word handling.apply_sprint_command_escapes_inner_quotes_and_backslashessince the Go-style escape behavior no longer applies; nothing in the new builder needs that level of escaping.src/yt/api.rs::apply_command_posts_query_and_issue_ids,src/yt/api.rs::set_issues_sprint_builds_command_and_posts, and threesrc/commands/issue/sprint_set.rs::tests::*) to pin the newBoard {X} {Y}shape. These would now fail loudly if the builder regressed to Go-style quotes.just pre-commitpasses (fmt, clippy, build, test). One pre-existing unrelated failure remains:commands::update::tests::check_writable_returns_friendly_message_on_readonly_dir, also fails onorigin/main, unrelated to this change.`yt issue sprint set` failed with HTTP 400 `Unknown command: Board "Investigator Database" "Sprint 1"` because the command-language builder emitted Go-style double-quoted values (ported verbatim from the Go CLI). YouTrack's `/api/commands` parser groups multi-word values with curly braces, not double quotes, so the rendered command was rejected outright. Switch `build_apply_sprint_command` in `src/yt/query.rs` to emit `Board {<board>} {<sprint>}`, matching the brace convention already used by `build_query` for the sprint search filter (`Board <b>: {<s>}`). Drop the now-unused `go_quote` helper. Update the three wiremock body-match tests in `src/yt/api.rs` and `src/commands/issue/sprint_set.rs` that pinned the old wire format. Escape behavior for literal `{` or `}` inside a board or sprint name is left undefined; no real-world names hit that case and the existing `build_query` makes the same simplification. Worth revisiting if a user reports it. #YT-3 State Done