refactor(workspace): extract crates/youtrack-client (YT-17) #60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/extract-youtrack-client-YT-17"
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?
Subtask 2 of the workspace refactor epic (YT-15). Depends on the merged workspace-skeleton subtask (YT-16).
What
Extract the YouTrack core into a new reusable library crate
crates/youtrack-clientso a future MCP server can depend on the client / API / models without dragging in clap, comfy-table, or the CLI runtime flags. No behavior change to theytbinary; command surface and output are unchanged.How
Moved into the crate via
git mv(history preserved):client.rs(transport,Client,ClientError),models.rs,api.rs(ApiErrorplus every high-levelpub async fn,CreateIssueRequest,DailySyncOptions/DailySyncFailure),query.rs,duration.rs,sprint_resolution.rs. The data-shaped helpers fromoutput.rs(format_millis,parse_ymd_to_ms_utc,presentation,custom_field_presentation,custom_field_value_presentation,extract_assignee_names,author_name,tail) move into the crate'soutputmodule with their unit tests. The presentation-onlycompact_textstays behind incrates/yt-cli/src/yt/output.rsfor subtask 4 (YT-19).crates/youtrack-client/src/lib.rsmirrors the formercrate::ytmodule layout (pub mod api; pub mod models; pub mod client; ...; pub use client::Client;) so command imports rewrite 1:1 toyoutrack_client::.... Intra-corecrate::yt::paths collapse tocrate::inside the library.Library purity
crates/youtrack-clientispublish = falseand depends only on reqwest, serde, serde_json, thiserror, time, tokio, tracing, url, urlencoding (and wiremock as a dev-dependency). No clap, comfy-table, rpassword, or secrecy: token handling stays a config concern for subtask 3 (YT-18).Acceptance criteria
crates/youtrack-clientbuilds and its tests pass (run as part of the workspacecargo test --all-targets).Client,ClientError,ApiError, allapifunctions, allmodels,query,duration,sprint_resolution, and the data-shaped helpers.Cargo.tomlhas noclap/comfy-table/rpassworddependency.src/commands/imports referenceyoutrack_client::...;src/yt/no longer holds the moved modules (onlycompact_textremains).just pre-commitgreen (fmt, clippy -D warnings, build, 96 tests);ytoutput unchanged.🤖 Generated with Claude Code