Repository navigation
fix: align current output and uninstall version spelling - #744
linghengqian merged 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #744 +/- ##
==========================================
+ Coverage 51.60% 51.87% +0.26%
==========================================
Files 111 111
Lines 8276 8276
==========================================
+ Hits 4271 4293 +22
+ Misses 3585 3561 -24
- Partials 420 422 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
linghengqian
left a comment
There was a problem hiding this comment.
Thanks. This is the right fix for #390: current adds a v and uninstall doesn't accept one, and this changes both. The new tests fail on main and pass here. info has the same problem, see 7.
A few things to sort out before I merge:
- Three comments still say
vfox currentprints a leadingv, which isn't true anymore:cmd/commands/alias.go:72,cmd/commands/alias_cli_test.go:38andcmd/commands/commands_unit_test.go:58. We still accept thev, so only the wording needs to change. AGENTS.md:80lists the commands whereResolveVersionNamedecides what to do with a leadingv.uninstallandinfo(see 7) belong in that list now.- The commit message has both
Fixes #390andRefs #390, and the description only hasRefs. Please useFixes #390in both places and drop theRefsline. The graal part of that issue was fixed in vfox-java 0.6.3, so nothing is left open after this. - In the description,
go test ./internal/sdk -vdoesn't cover anything this PR touches, and "the vfox currentCmd change" in two of the bullets doesn't match the diff, which changes more thancurrent. Please cut it down to what you ran for this change. - The new CLI tests are skipped on Windows (the fixture needs a POSIX shell), and #390 was reported on Windows. If you tried
vfox un java@v...there, say so. If not, no problem, I'll check it myself. - The release notes are built from commit titles, and this title doesn't say what users will notice. Something like
fix: drop the leading v from vfox current, accept it in vfox uninstall and vfox infowould. vfox info [email protected]+13has the same problem asuninstall: it printsnotfoundfor an installed21.0.2+13(exit code 0, and"installed": falsewith--json), whileuse,install,execanddoctortake thev. I'd rather fix it here than in a follow-up.infocallsResolveAliasatcmd/commands/info.go:188, and switching that toResolveVersionName, likeuninstallnow does, should be enough. Please add a test tocmd/commands/info_cli_test.gofor thevspelling, plus the as-typed cases you already have foruninstall(an installedv1.0.0, a linkedvendor, an aliasv1).--jsonshould report the name without thev, the way it does for aliases.
Otherwise good to go.
…l and vfox info `current` now prints the stored name unchanged. `uninstall` and `info` use `ResolveVersionName`, so they accept a prefixed version while keeping exact aliases and installed names that begin with `v`. `info --json` reports the name without the `v`. Regression tests cover both current output forms, prefixed and as-typed names for uninstall and info, alias cleanup, linked targets, and unknown versions. Fixes version-fox#390
b03f9f5 to
1785400
Compare
|
Thanks for the review. These are in 1785400, amended into the one commit so the message is clean.
Locally on macOS, |
|
Many thanks, @linghengqian. Copying a version straight from vfox current into uninstall or info should just work now. |
Background
Copying a version from
vfox currentintovfox uninstallcan report that it is not installed.currentalso displays an extravcompared withlistandsearch.vfox infohas the same problem asuninstall:vfox info [email protected]+13printsnotfoundfor an installed21.0.2+13.currentprependsvto the stored version name in both output forms.uninstallandinforesolve aliases without using the version-name resolver that handles a conventional leadingv.Summary of the fix
currentnow prints the stored name unchanged.uninstallandinfouseResolveVersionNameto accept prefixed versions while preserving exact aliases and installed names that begin withv, andinfo --jsonreports the name without thev. Regression tests cover both current output forms, prefixed and as-typed names for uninstall and info, alias cleanup, linked targets, and unknown versions.Verification
On macOS with Go 1.26.5:
gofmt -lon the changed Go files reported no formatting differences.go vet ./cmd/commands/... ./internal/...completed without diagnostics.go build ./...passed.go test ./cmd/commands/...passed.TestCurrentPrintsVersionAsStored,TestUninstallAcceptsConventionalVersionPrefixandTestInfoAcceptsConventionalVersionPrefixfail withcurrent.go,uninstall.goandinfo.gofrom main, and pass with this change.The CLI tests are skipped on Windows, and I have not tried this on Windows.
Fixes #390