Repair the tools\np path literal the PATH registration is built from - #223
Merged
Conversation
An editing slip in the change that shipped the operator clients split 'tools\np' across two lines: the string ended up containing a literal newline, so Join-Path produced a path Test-Path rejects with "Illegal characters in path". The surrounding catch downgraded that to a warning, the install and the update succeeded either way, and `np` silently never reached the machine PATH. Present in all three scripts, therefore in both 1.2.8 and 1.2.9. Observed on the lab install: updating to 1.2.9 wrote "[update] Could not update the machine PATH: Illegal characters in path" and finished green. The clients themselves were never affected -- they are part of the signed artifact and land under tools\ regardless. The contract test asserted only that each script calls the shared helper, which a mangled argument satisfies perfectly. It now pins the directory literal on one line as well, in all three scripts. Verified by re-introducing the newline: the check fails, and passes again once repaired.
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.
Problem
An editing slip in #219 split
'tools\np'across two lines — the string ended up containing a literal newline:Join-Paththen produced a pathTest-Pathrejects with "Illegal characters in path", the surroundingcatchdowngraded it to a warning, and the install/update finished green withnpnever reaching the machine PATH.Present in all three scripts (
Install-,Update-,Uninstall-NodePilot.ps1), therefore in both 1.2.8 and 1.2.9. Observed while updating the lab installation to 1.2.9:The clients themselves were never affected — they are part of the signed artifact and land under
tools\regardless. Only the convenience of typingnpinstead of the full path was missing.Why the guard did not catch it
Test-DeploymentTemplates.ps1asserted that each script callsAdd-NodePilotPathEntry/Remove-NodePilotPathEntryand dot-sourcesMachinePath.ps1. A mangled argument satisfies all of that.It now pins the directory literal on one line too, for all three scripts. Verified both ways: re-introducing the newline fails the check (exit 1, naming the script), repairing it passes (exit 0).
Follow-up
The published 1.2.8 and 1.2.9 installers carry the broken script. Anyone who has already installed can add
<install>\tools\npto the machine PATH by hand, or re-run the corrected updater.