refactor(workspace): convert to Cargo workspace, move binary to crates/yt-cli (YT-16) #59

Merged
David merged 1 commit from refactor/cargo-workspace-yt-cli-YT-16 into main 2026-05-27 11:43:57 +02:00
Owner

Converts the repo to a Cargo workspace and relocates the binary crate to crates/yt-cli, per YT-16. Pure structural change: no source logic moves, library crates land in later subtasks (YT-17 onward).

Changes

Root Cargo.toml becomes workspace-only (resolver = "2", members = ["crates/*"]) with the shared dependency versions/features hoisted to [workspace.dependencies]. The binary crate now lives at crates/yt-cli (package name youtrack-cli, [[bin]] name = "yt") and references each shared dep via workspace = true.

src/, build.rs, and tests/article_roundtrip.rs move under crates/yt-cli/. build.rs git-dir rerun triggers repoint to ../../.git so the YOUTRACK_CLI_GIT_HASH / YOUTRACK_CLI_BUILD_DATE injection still fires from the new location.

oci-build/Dockerfile and oci-build/Dockerfile.windows copy the workspace plus member manifests, prime dependencies against crates/yt-cli/, and copy source from there. The build output path (/build/target/release/yt[.exe]) is unchanged, so the export and runtime stages keep working. The build-linux.yml / build-windows.yml path filters now watch crates/**. The justfile create-release recipe reads/writes the version in crates/yt-cli/Cargo.toml now that the root carries no [package] table.

Verification

  • cargo build --release from the repo root produces target/release/yt; yt --version shows the injected git hash and build date.
  • cargo test --all-targets: 308 unit tests pass; the relocated article_roundtrip integration test passes.
  • cargo fmt --check and cargo clippy --all-targets -- -D warnings both clean.
  • just check-docker (builder stage of oci-build/Dockerfile) builds green; the dependency-priming cache layer still works (only youtrack-cli recompiles in the final layer) and the binary lands at /build/target/release/yt.

Note on the commit trailer

The commit references the issue with a bare #YT-16 (link only, no State command). Per the repo workflow, the Forgejo VCS integration applies trailer commands at push time, not merge time, so a State Done trailer would resolve the issue prematurely while this PR is still in review. State Done is left as a post-merge action.

#YT-16

🤖 Generated with Claude Code

Converts the repo to a Cargo workspace and relocates the binary crate to `crates/yt-cli`, per YT-16. Pure structural change: no source logic moves, library crates land in later subtasks (YT-17 onward). ## Changes Root `Cargo.toml` becomes workspace-only (`resolver = "2"`, `members = ["crates/*"]`) with the shared dependency versions/features hoisted to `[workspace.dependencies]`. The binary crate now lives at `crates/yt-cli` (package name `youtrack-cli`, `[[bin]] name = "yt"`) and references each shared dep via `workspace = true`. `src/`, `build.rs`, and `tests/article_roundtrip.rs` move under `crates/yt-cli/`. `build.rs` git-dir rerun triggers repoint to `../../.git` so the `YOUTRACK_CLI_GIT_HASH` / `YOUTRACK_CLI_BUILD_DATE` injection still fires from the new location. `oci-build/Dockerfile` and `oci-build/Dockerfile.windows` copy the workspace plus member manifests, prime dependencies against `crates/yt-cli/`, and copy source from there. The build output path (`/build/target/release/yt[.exe]`) is unchanged, so the `export` and `runtime` stages keep working. The `build-linux.yml` / `build-windows.yml` path filters now watch `crates/**`. The `justfile` `create-release` recipe reads/writes the version in `crates/yt-cli/Cargo.toml` now that the root carries no `[package]` table. ## Verification - `cargo build --release` from the repo root produces `target/release/yt`; `yt --version` shows the injected git hash and build date. - `cargo test --all-targets`: 308 unit tests pass; the relocated `article_roundtrip` integration test passes. - `cargo fmt --check` and `cargo clippy --all-targets -- -D warnings` both clean. - `just check-docker` (builder stage of `oci-build/Dockerfile`) builds green; the dependency-priming cache layer still works (only `youtrack-cli` recompiles in the final layer) and the binary lands at `/build/target/release/yt`. ## Note on the commit trailer The commit references the issue with a bare `#YT-16` (link only, no `State` command). Per the repo workflow, the Forgejo VCS integration applies trailer commands at push time, not merge time, so a `State Done` trailer would resolve the issue prematurely while this PR is still in review. `State Done` is left as a post-merge action. #YT-16 🤖 Generated with [Claude Code](https://claude.com/claude-code)
refactor(workspace): move binary crate to crates/yt-cli
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 32s
Create release / Create release from merged PR (pull_request) Has been skipped
fa29b94a88
Convert the repo to a Cargo workspace and relocate the binary crate, a pure structural change with no source logic moved. Library crates land in later subtasks.

Root Cargo.toml is now workspace-only (resolver = "2", members = ["crates/*"]) with the shared dependency versions/features hoisted to [workspace.dependencies]; the member crate references each via `workspace = true`.

The binary crate moves to crates/yt-cli (package name youtrack-cli, [[bin]] name yt). src/, build.rs, and tests/article_roundtrip.rs relocate under it; `cargo build` from the repo root still produces target/release/yt and the article integration test still runs.

build.rs git-dir rerun triggers repoint to ../../.git/HEAD and ../../.git/refs so the YOUTRACK_CLI_GIT_HASH / YOUTRACK_CLI_BUILD_DATE injection still fires from the new crate location.

oci-build/Dockerfile and oci-build/Dockerfile.windows copy the workspace plus member manifests, prime dependencies against crates/yt-cli/, and copy actual source from crates/yt-cli/; the build output path (/build/target/release/yt[.exe]) is unchanged so the export and runtime stages keep working.

The build-linux.yml and build-windows.yml path filters watch crates/** instead of src/** + build.rs. The justfile create-release recipe reads and writes the package version in crates/yt-cli/Cargo.toml now that the workspace root carries no [package] table.

#YT-16
David merged commit 123f208fc9 into main 2026-05-27 11:43:57 +02:00
David deleted branch refactor/cargo-workspace-yt-cli-YT-16 2026-05-27 11:43:58 +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!59
No description provided.