feat(version): add release trains and --train to yt version update #97

Merged
Claude-Run merged 1 commit from feat/YT-39-release-train-update into main 2026-07-03 18:08:16 +02:00
Member

Bake the release train the binary was built on and update along it by default, matching fj. build.rs emits a new YOUTRACK_CLI_TRAIN compile-time var alongside the existing git-hash / build-date / update-url vars; CI derives it from the workflow trigger with the same logic that already picks the publish channel (tag push -> release, main push -> latest) and threads it through as a --build-arg in both build-linux.yml and build-windows.yml, plus an ARG/ENV pair in both Dockerfiles. Local cargo builds leave the var unset and default to latest, since local dev tracks main.

Add a clap Train { Release, Latest } value-enum and a --train flag to UpdateArgs; when omitted it resolves to the baked train. Help text mirrors fj ("Override which release train to pull from; defaults to the train this binary was built on", [possible values: release, latest]) and the subcommand summary now reads "Replace the running binary with the latest build on its train".

Resolve the download target per train in update::run: the latest train keeps {base}/latest/{filename} and downloads unconditionally (every main push republishes latest at the same CARGO_PKG_VERSION, so semver cannot detect "newer"); the release train resolves the highest published v<semver> via YT-37's fetch_latest_version, short-circuits when it is not newer than the running version (bypassed by --force), and downloads {base}/v<max>/{filename} via the new build_release_url. --url still overrides the base for both trains.

Tests cover default-train resolution from the baked value, --train override for each value, the release-train versioned URL, the latest-train /latest/ URL and its unconditional download, and the release-train short-circuit / no-release error paths.

#YT-39

Bake the release train the binary was built on and update along it by default, matching `fj`. `build.rs` emits a new `YOUTRACK_CLI_TRAIN` compile-time var alongside the existing git-hash / build-date / update-url vars; CI derives it from the workflow trigger with the same logic that already picks the publish channel (tag push -> `release`, `main` push -> `latest`) and threads it through as a `--build-arg` in both build-linux.yml and build-windows.yml, plus an ARG/ENV pair in both Dockerfiles. Local cargo builds leave the var unset and default to `latest`, since local dev tracks `main`. Add a clap `Train { Release, Latest }` value-enum and a `--train` flag to `UpdateArgs`; when omitted it resolves to the baked train. Help text mirrors `fj` ("Override which release train to pull from; defaults to the train this binary was built on", `[possible values: release, latest]`) and the subcommand summary now reads "Replace the running binary with the latest build on its train". Resolve the download target per train in `update::run`: the `latest` train keeps `{base}/latest/{filename}` and downloads unconditionally (every `main` push republishes `latest` at the same CARGO_PKG_VERSION, so semver cannot detect "newer"); the `release` train resolves the highest published `v<semver>` via YT-37's `fetch_latest_version`, short-circuits when it is not newer than the running version (bypassed by `--force`), and downloads `{base}/v<max>/{filename}` via the new `build_release_url`. `--url` still overrides the base for both trains. Tests cover default-train resolution from the baked value, `--train` override for each value, the release-train versioned URL, the latest-train `/latest/` URL and its unconditional download, and the release-train short-circuit / no-release error paths. #YT-39
feat(version): add release trains and --train to yt version update
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m5s
Create release / Create release from merged PR (pull_request) Has been skipped
ed7fd427a1
Bake the release train the binary was built on and update along it by default, matching `fj`. `build.rs` emits a new `YOUTRACK_CLI_TRAIN` compile-time var alongside the existing git-hash / build-date / update-url vars; CI derives it from the workflow trigger with the same logic that already picks the publish channel (tag push -> `release`, `main` push -> `latest`) and threads it through as a `--build-arg` in both build-linux.yml and build-windows.yml, plus an ARG/ENV pair in both Dockerfiles. Local cargo builds leave the var unset and default to `latest`, since local dev tracks `main`.

Add a clap `Train { Release, Latest }` value-enum and a `--train` flag to `UpdateArgs`; when omitted it resolves to the baked train. Help text mirrors `fj` ("Override which release train to pull from; defaults to the train this binary was built on", `[possible values: release, latest]`) and the subcommand summary now reads "Replace the running binary with the latest build on its train".

Resolve the download target per train in `update::run`: the `latest` train keeps `{base}/latest/{filename}` and downloads unconditionally (every `main` push republishes `latest` at the same CARGO_PKG_VERSION, so semver cannot detect "newer"); the `release` train resolves the highest published `v<semver>` via YT-37's `fetch_latest_version`, short-circuits when it is not newer than the running version (bypassed by `--force`), and downloads `{base}/v<max>/{filename}` via the new `build_release_url`. `--url` still overrides the base for both trains.

Tests cover default-train resolution from the baked value, `--train` override for each value, the release-train versioned URL, the latest-train `/latest/` URL and its unconditional download, and the release-train short-circuit / no-release error paths.

#YT-39
Claude-Run deleted branch feat/YT-39-release-train-update 2026-07-03 18:08:16 +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!97
No description provided.