Skip to content

fix(installation): upgrade mise-managed installs - #95

Merged
filipeforattini merged 2 commits into
mainfrom
fix/mise-install-upgrade
Sep 3, 2026
Merged

filipeforattini merged 2 commits into
mainfrom
fix/mise-install-upgrade

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Sep 3, 2026 •

Copy link
Copy Markdown

Problema

O red-dev instala o redcode pelo mise com backend GitHub (github:reddb-io/redcode), que descompacta o binário do release em <MISE_DATA_DIR>/installs/github-reddb-io-redcode/<versão>/. O Installation.method() só reconhecia globais de npm/yarn/pnpm/bun (via npm list -g etc.), então essas instalações viravam unknown:

  • auto-update em background (patch): cli/upgrade.ts retorna em silêncio quando o método é unknown. Nada acontece.
  • prompt "Update Available" na TUI: global.upgrade responde 400 "Unknown installation method", e o toast só dizia "Update failed".

Correção

  • Detecta mise pelo caminho do executável (mise/installs) ou por mise ls --json github:reddb-io/redcode.
  • Upgrade com mise upgrade github:reddb-io/redcode, precedido de mise cache clear (lista de versões cacheada faz o upgrade concluir que não há nada a fazer), e confirmação de que a versão alvo ficou instalada. Se o pin no mise for exato (não latest), falha com instrução: mise use -g github:reddb-io/redcode@latest.
  • Toast de falha na TUI mostra o erro real do servidor.

Verificação

  • bun test test/installation/installation.test.ts: 10 pass (4 novos: detecção via mise ls, unknown sem o tool, upgrade com confirmação, falha quando a versão não muda)
  • typecheck redcode e tui: ok

Nota: o red-dev pina github:reddb-io/redcode@latest (useRuntimes), então mise upgrade sem --bump já move para a versão nova.

https://claude.ai/code/session_011zK7bzkqqTFRHCLD8xk4xY


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

filipeforattini and others added 2 commits September 3, 2026 13:24
red-dev installs Redcode through mise's GitHub backend
(github:reddb-io/redcode). Installation.method() only knew npm, yarn, pnpm
and bun globals, so those installs resolved to "unknown": the background
auto-update bailed out silently for patch releases, and choosing "update"
in the TUI prompt failed with "Unknown installation method".

- Detect mise from the executable path (<data>/mise/installs/...) or from
  `mise ls --json github:reddb-io/redcode`.
- Upgrade with `mise upgrade github:reddb-io/redcode` after clearing mise's
  cached version list, then confirm the target version is installed.
- Surface the server's error text in the TUI "Update Failed" toast.

Claude-Session: https://claude.ai/code/session_011zK7bzkqqTFRHCLD8xk4xY
@filipeforattini
filipeforattini merged commit 550623f into main Sep 3, 2026
7 checks passed
@filipeforattini
filipeforattini deleted the fix/mise-install-upgrade branch September 3, 2026 17:38
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