fix(release): repair self-update for <=0.62 clients after PyPI rename (#424)#439
Merged
Conversation
…#424) The keboola-agent-cli -> keboola-cli rename broke `kbagent update` for every client already installed at <=0.62.0. Their immutable pre-0.63 code probes the release for the OLD wheel name `keboola_agent_cli-<version>-py3-none-any.whl` (404 on the renamed release), falls back to a git+ build, and uv aborts with `Executable already exists: kbagent`. The failure was masked as "already up to date". Reproduced live in an isolated UV_TOOL_DIR. Bridge so existing users can self-update in place: - release.yml builds a SECOND, legacy-named compat wheel (`keboola_agent_cli-<version>-py3-none-any.whl`, identical code, only [project].name differs) and uploads it alongside `keboola_cli-*.whl`, so the pre-0.63 self-update path finds its asset and upgrades in place. - APP_NAME is resolved dynamically (prefers `keboola-cli`, falls back to `keboola-agent-cli`) so `kbagent version` and the User-Agent keep working under either distribution. The on-disk config dir (`~/.config/keboola-agent-cli/`) is a separate fixed literal and intentionally unchanged. - `_compose_update_summary` no longer masks a FAILED update as "already up to date"; only an explicit `up_to_date` short-circuit prints that line, and failures render as `kbagent vX update FAILED: <reason>` (full transcript in `--json` / `--verbose`). Bump 0.63.0 -> 0.63.1 + changelog. Tests cover dynamic APP_NAME resolution and the failure-vs-up-to-date summary rendering. End-to-end verified: the legacy-named 0.63.1 wheel installs as `keboola-agent-cli` and `kbagent version` reports 0.63.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The PyPI rename
keboola-agent-cli->keboola-cli(#424) silently brokekbagent updatefor every user installed at <=0.62.0. Reproduced live in an isolatedUV_TOOL_DIR:Failure chain (all confirmed with data):
…/v<latest>/keboola_agent_cli-<latest>-py3-none-any.whl; the renamed release only shipskeboola_cli-*.whl(verified404vs200). Falls back togit+.git+builds the renamedkeboola-cli, which uv treats as a NEW tool; itskbagententry point collides:error: Executable already exists: kbagent.updated=False._compose_update_summaryrendered any non-upgrade asalready up to date, hiding the failure.Blast radius: all <=0.62.0 users are stuck on 0.62.0 and told they're current.
Fix — a migration bridge
Pre-0.63 clients have immutable update code, so the bridge gives them exactly the asset they blindly look for:
release.ymlbuilds a second, legacy-named compat wheelkeboola_agent_cli-<version>-py3-none-any.whl(identical code; only[project].namediffers) and uploads it next tokeboola_cli-*.whl. The pre-0.63 path then finds its asset and runsuv tool install --force "keboola-agent-cli @ <url>"→ in-place upgrade (same dist name = no entry-point collision).APP_NAME(constants.py): preferskeboola-cli, falls back tokeboola-agent-cli, sokbagent versionand the User-Agent work under either distribution. The on-disk config dir (~/.config/keboola-agent-cli/) is a separate fixed literal and is intentionally unchanged._compose_update_summary): only an explicitup_to_dateshort-circuit prints "already up to date"; a failed update renderskbagent vX update FAILED: <reason>(full transcript stays in--json/--verbose).Verification
uv tool install --force 'keboola-cli @ <0.63.0 wheel>').keboola_agent_cli-0.63.1wheel in isolation →uv tool listshowskeboola-agent-cli v0.63.1,kbagent versionreportsv0.63.1, User-Agent iskeboola-agent-cli/0.63.1. Without dynamicAPP_NAMEthis path raisesPackageNotFoundError.Notes / follow-ups
<=0.62users is 0.63.1 (the existing 0.63.0 release predates this workflow and cannot get a working compat wheel).keboola-agent-clitool name persists for migrated users; transitioning the uv-tool identity tokeboola-cli(or dropping the compat wheel) is a separate, later cleanup once the<=0.62fleet has moved on. A user-facing announcement with the one-time manual command is still worthwhile for users who don't auto-update.