Skip to content

fix(release): repair self-update for <=0.62 clients after PyPI rename (#424)#439

Merged
padak merged 1 commit into
mainfrom
fix/selfupdate-rename-bridge-424
Jun 17, 2026
Merged

fix(release): repair self-update for <=0.62 clients after PyPI rename (#424)#439
padak merged 1 commit into
mainfrom
fix/selfupdate-rename-bridge-424

Conversation

@padak

@padak padak commented Jun 17, 2026

Copy link
Copy Markdown
Member

Problem

The PyPI rename keboola-agent-cli -> keboola-cli (#424) silently broke kbagent update for every user installed at <=0.62.0. Reproduced live in an isolated UV_TOOL_DIR:

$ kbagent version
kbagent v0.62.0  -> v0.63.0 available
$ kbagent update
kbagent v0.62.0 (already up to date)   # <- wrong: the update actually FAILED

Failure chain (all confirmed with data):

  1. Wheel fast-path 404 — pre-0.63 code probes …/v<latest>/keboola_agent_cli-<latest>-py3-none-any.whl; the renamed release only ships keboola_cli-*.whl (verified 404 vs 200). Falls back to git+.
  2. uv tool identity conflictgit+ builds the renamed keboola-cli, which uv treats as a NEW tool; its kbagent entry point collides: error: Executable already exists: kbagent. updated=False.
  3. Masking_compose_update_summary rendered any non-upgrade as already 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.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 next to keboola_cli-*.whl. The pre-0.63 path then finds its asset and runs uv tool install --force "keboola-agent-cli @ <url>" → in-place upgrade (same dist name = no entry-point collision).
  • Dynamic APP_NAME (constants.py): prefers keboola-cli, falls back to keboola-agent-cli, so kbagent version and 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.
  • Un-mask failures (_compose_update_summary): only an explicit up_to_date short-circuit prints "already up to date"; a failed update renders kbagent vX update FAILED: <reason> (full transcript stays in --json / --verbose).

Verification

  • Live repro of the break and of the manual workaround (uv tool install --force 'keboola-cli @ <0.63.0 wheel>').
  • End-to-end of the bridge: built both wheels locally like CI; installed the legacy-named keboola_agent_cli-0.63.1 wheel in isolation → uv tool list shows keboola-agent-cli v0.63.1, kbagent version reports v0.63.1, User-Agent is keboola-agent-cli/0.63.1. Without dynamic APP_NAME this path raises PackageNotFoundError.
  • Full suite green (4099 passed, 132 skipped); ruff + ty clean; changelog/version checks pass.

Notes / follow-ups

  • Bumps 0.63.0 → 0.63.1. The bridge only helps for updates whose target release carries the compat asset, so the first release that rescues <=0.62 users is 0.63.1 (the existing 0.63.0 release predates this workflow and cannot get a working compat wheel).
  • The legacy keboola-agent-cli tool name persists for migrated users; transitioning the uv-tool identity to keboola-cli (or dropping the compat wheel) is a separate, later cleanup once the <=0.62 fleet has moved on. A user-facing announcement with the one-time manual command is still worthwhile for users who don't auto-update.

Open in Devin Review

…#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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@padak padak merged commit fe7be5c into main Jun 17, 2026
5 checks passed
@padak padak deleted the fix/selfupdate-rename-bridge-424 branch June 17, 2026 12:19
@padak padak mentioned this pull request Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant