Sprint 10: install progress, --no-use opt-out, and install/use/upgrade UX fixes (1.9.0)#19
Merged
Merged
Conversation
… version Sprint 10 UX feedback pass, phase 1 (tasks 1, 2, 6 of the plan). - upgrade: remove "Restart your terminal" — phpvm.ps1 is re-executed in full on every invocation, so the next command already runs the new code. Consistent with B1 (1.8.2). The Linux counterpart stays: phpvm.sh is sourced into the shell and genuinely needs a re-source. - use: print only the first line of `php --version`, matching Linux. `current` keeps the full banner on both OSes — that parity was already correct. - install: reject anything that is not a full x.y.z before Resolve-PHPURL. `phpvm install composer` used to reach Get-VSVersion's [int] cast and leak a raw PowerShell exception; it now prints "Invalid version" plus a hint toward `phpvm composer`. Same guard added on Linux, where the input did not crash but failed later as a misleading "Download failed". devhardiyanto
…t-out Sprint 10 UX feedback pass, phases 2 and 3. Bumps 1.8.3 -> 1.9.0. Progress (phase 2). Both sides went quiet for minutes during an install with no sign of life. Modelled on fnm's approach (indicatif over the response stream): byte-level progress, drawn on stderr so stdout stays pipe-clean, and only when the content length is known. - windows: Invoke-Download streams the response in chunks and prints a throttled percent / size / speed / ETA line, replacing $ProgressPreference=SilentlyContinue. Payloads under 5 MB (Xdebug DLL, ext zips) stay silent — a bar there is flicker. Falls back to Invoke-WebRequest when the size is unknown. - linux: new _phpvm_run_logged wraps configure / make / make install with a spinner plus elapsed time, and reports the real exit code. A trap takes the build down on Ctrl+C instead of orphaning it. - Both auto-disable when stderr is not a terminal, so CI and the test suites see the output they saw before. --no-use (phase 3). Auto-use on install (1.8.0) is kept as the default; this only adds an opt-out, so nobody's existing habit breaks. Accepted in either argument position on both OSes; usage, error and hint strings are identical across them. devhardiyanto
A trailing backslash inside single quotes reads as an escape attempt. Double quotes with \ produce the same four frames without the ambiguity. devhardiyanto
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.
What
Sprint 10 UX feedback pass, from real usage reports on both OSes. Fixes one real crash, two output annoyances, adds live install progress, and gives
installan opt-out from auto-switching. Bumps 1.8.3 -> 1.9.0.Plan:
docs/reports/arch/sprint10-ux-feedback-plan.md.Why
Five complaints came out of actual use of
phpvm install/ext install/use/upgrade. Each was traced to the source before being scoped, and the two that turned out not to be phpvm bugs were left out rather than patched blindly:phpvm install composerprinted a raw PowerShell stack trace. Real bug.phpvm useon Windows dumped the entire five-line PHP banner.phpvm upgradeon Windows still told users to restart their terminal, which stopped being true.Out of scope:
ext install sqlsrv(needs the real error output first — the PECL logic verifies as correct, so this is likely a missing system ODBC driver, not a phpvm bug).How
Install crash.
Invoke-Installhanded any non-version string straight toGet-VSVersion, whose[int]cast threw with nothing catching it. A version guard now rejects anything that is notx.y.zbefore the URL resolver runs, with aDid you mean: phpvm composerhint on that specific typo. Linux never crashed here, but failed later as a misleading "Download failed" — it gets the same guard so the error names the real problem.Progress. Modelled on how fnm does it (
indicatifwrapped around the response stream): byte-level progress, drawn on stderr so stdout stays pipe-clean, and only when the content length is known.Invoke-Downloadstreams the response in chunks and prints a throttled percent / size / speed / ETA line, replacing$ProgressPreference = "SilentlyContinue". Payloads under 5 MB (Xdebug DLL, ext zips) stay silent — a bar there is just flicker. Falls back toInvoke-WebRequestwhen the size is unknown._phpvm_run_loggedwrapsconfigure/make/make installwith a spinner and elapsed time, returns the command's real exit code, and trapsINTso Ctrl+C takes the build down instead of orphaning it.--no-use. Auto-use stays the default; this is purely an opt-out, so no existing habit breaks. Accepted in either argument position on both OSes.Changes
windows/phpvm.ps1— version guard inInvoke-Install;--no-useparsing;Invoke-Downloadrewritten to stream with progress (+Format-Bytes/Format-Duration);phpvm useprints one line; stale restart hint dropped fromInvoke-Upgrade.linux/phpvm.sh— matching version guard and--no-use; new_phpvm_run_loggedspinner over the three build steps.tests/— 4 new Pester tests, 9 new bats tests (guard, flag parsing in both positions, exit-code propagation, and that the spinner never reaches a non-tty stream).README.md,version.txt,windows/install.ps1,linux/install.sh— docs + 1.9.0.Deliberately not mirrored across OSes
Three divergences are intentional, not missed ports:
phpvm.ps1is re-executed in full on every invocation, so the next command already runs new code;phpvm.shis sourced into the shell and genuinely needs a re-source.phpvm current: still prints the full banner on both. Onlyusewas over-verbose;currentwas already at parity.Testing Done
Networktag, so the rewrittenInvoke-Downloadhas never actually pulled a file in CI — HTTP redirects, a missingContent-Length, or a non-interactive host would not be caught by the suite. Worth running.\windows\phpvm.ps1 install <ver> --no-usebefore merge.