fix: restore backward compatibility with v3.0.12 configs and fix the released version string - #268
Merged
viniciussanchez merged 2 commits intoAug 3, 2026
Conversation
A configuration written by Boss up to v3.0.12 stores the credentials under x/y/z. Startup saves the configuration once before the migrations run, and that save serialises the current struct, so the legacy fields are dropped from the file. Migration 7 then re-reads the file, finds nothing to convert, and leaves keypass empty. Decrypting an empty keypass fails with "cipher text block size is too short", and since the getters call msg.Die the whole process exits 1 -- every install and update on a machine that had ever run `boss login -s` stops working, and the credential is gone from disk for good. Three changes: - Auth carries the legacy x/y/z fields, so saving an unmigrated configuration round-trips them instead of destroying them. - The getters treat an empty stored value as "not set" and return early. An SSH key without a passphrase legitimately stores nothing in keypass. - Migration 7 reads the legacy values off the in-memory configuration rather than the file, warns instead of dying when one cannot be decrypted, and saves what it converted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The ldflags in .goreleaser.yaml are missing the -X prefix, so the linker never receives them and the released binary keeps the defaults from internal/version: `boss version` reports v0.0.1 with an empty git commit. v3.0.13 is the first release built by GoReleaser -- v3.0.12 and earlier came from the Makefile, which sets -X correctly -- so this surfaced only now. Also set version.version rather than version.metadata: metadata is appended to version, so the previous line would have produced "v0.0.1+3.0.13" even with the -X in place. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #268 +/- ##
=======================================
Coverage ? 28.28%
=======================================
Files ? 90
Lines ? 5675
Branches ? 0
=======================================
Hits ? 1605
Misses ? 3933
Partials ? 137
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Aug 3, 2026
Merged
viniciussanchez
pushed a commit
that referenced
this pull request
Aug 3, 2026
The Lint job was already red when #268 merged, on two findings from that PR: setup/migrations.go:59: cognitive complexity 25 of func `seven` (gocognit) pkg/env/legacy_auth_test.go:76: declaration of "err" shadows line 70 (govet) `seven` grew past the threshold because the rewrite dropped the //nolint the original carried. Rather than put the suppression back, the per-entry work moves into migrateLegacyAuth and the decrypt-or-warn step into decryptLegacy, which reads better than the three near-identical blocks it replaces and takes the complexity down on its own. No behaviour change: `go test ./...` stays green. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
viniciussanchez
added a commit
that referenced
this pull request
Aug 3, 2026
fix(lint): clear the two findings #268 left on main
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.
O Vinicius reportou dois problemas depois do v3.0.13. Fomos atrás, reproduzimos os dois na mão e a correção está aqui, com teste de regressão.
Nenhum dos dois vem do #263 — o
git diffdaquele PR não encosta empkg/env/,utils/crypto/,internal/version/nem.goreleaser.yaml. Os dois estavam dormentes nomaine apareceram junto porque o v3.0.13 foi o primeiro release tagueado em muito tempo.1.
boss install/boss updatemorrem comFailed to decrypt PassPhraseAtinge qualquer usuário que já tenha rodado
boss login -snuma versão <= v3.0.12. E é destrutivo: a credencial some do arquivo, então toda execução seguinte falha igual — não adianta rodar de novo.A cadeia
x/y/z. O77196eetrocou parauser/pass/keypasse criou a migração 7 para converter.initializeDelphiVersion()roda antes demigration()(setup/setup.go:43vs:46) e chamaSaveConfiguration()quandodelphi_pathestá vazio. Esse save serializa a struct nova — e apaga ozdo arquivo.setup/migrations.go:52) relê o arquivo do disco. Ozjá não está lá, então ela não converte nada e okeypassfica vazio.GetPassPhrase()chamaDecrypt(key, ""). Base64 de""são 0 bytes, menor queaes.BlockSize→ o erro acima.31e581dtrocoumsg.Errpormsg.Dienesses getters, então o que era log virouexit 1.Vale registrar que nenhum dos dois commits sozinho quebra o usuário. Com o
77196eesozinho, o boss logava o erro e seguia (foi o que medimos rodando o v3.0.12). Com o31e581dsozinho, okeypassnunca ficaria vazio. A combinação é que fecha o caminho. A ordeminitializeDelphiVersion()antes demigration()é de 2019 e ficou correta por seis anos — só virou armadilha quando o formato mudou.Como reproduzimos
Com o
ormbre o release oficial v3.0.13 no Windows:installconfig_version: 6+z, semdelphi_path)zjá foi apagadoA correção
Authpassa a carregar os campos legadosx/y/z, então salvar uma config ainda não migrada faz round-trip em vez de destruí-los.keypass.Depois do patch, no mesmo ambiente:
keypassvazio,zperdido)v6+z, semdelphi_path)z→keypassmigrado, exit 02.
boss -vreportandov0.0.1com o commit em brancoConfirmado baixando o asset oficial do v3.0.13 — não é a máquina de quem reportou.
Os
ldflagsdo.goreleaser.yamlestão sem o-X, então o linker nunca recebe os valores e o binário fica com os defaults deinternal/version. OMakefile:32faz certo; só o GoReleaser, que é quem gera o release, não.Ficou 17 meses invisível porque o v3.0.13 é o primeiro release construído pelo GoReleaser — dá para ver pelo nome dos assets:
boss-windows-amd64.zip-Xcorretoboss_Windows_x86_64.zip-XausenteTambém trocamos para
version.versionem vez deversion.metadata: ometadataé concatenado aoversion, então a linha anterior produziriav0.0.1+3.0.13mesmo com o-Xno lugar.Depois do patch:
Testes
go test ./...verde nos 29 pacotes. Três testes novos empkg/env/legacy_auth_test.go:TestAuthGettersTreatEmptyValuesAsUnset— o caso que derrubava o processoTestAuthRoundTripsEncryptedValues— garante que o early-return não quebrou o caminho normalTestLegacyAuthFieldsSurviveLoadAndSave— carrega uma config no formato v3.0.12, salva, e verifica quex/y/zcontinuam no arquivoUma observação sobre processo
A suíte nunca exercita um
~/.bosslegado, então os dois commits passaram no CI e no review sem sinal nenhum. O terceiro teste acima cobre exatamente esse buraco. Se fizer sentido, dá para ampliar num teste de upgrade de ponta a ponta.Um achado que deixamos de fora
Com auth SSH configurada para
github.com, o boss falha todos os pulls cominvalid auth methode mesmo assim imprime✅ Installation completed successfully!com exit 0. O v3.0.12 pelo menos tentava SSH de verdade. Afeta quem usa repositórios privados. Não mexemos aqui para manter o escopo — abrimos issue separada se preferirem.🤖 Generated with Claude Code