Repository navigation
fix(no-ticket): show pnpm hosts when the pnpm launcher is missing - #554
Open
cloudsmith-iduffy wants to merge 2 commits into
Open
cloudsmith-iduffy wants to merge 2 commits into
cloudsmith-iduffy wants to merge 2 commits into
Conversation
PNPMInstaller.status() set the launcher path to None when the launcher file did not exist. It then matched .npmrc tokenHelper entries against the string "None", so `credential-helper list` showed no hosts. Match the entries against the expected launcher path. Also correct the docstring, which described the Docker config.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix preserves the status return contract, includes regression coverage, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes pnpm status reporting so cloudsmith credential-helper list shows configured hosts even when their expected launcher is missing.
Changes:
- Matches
.npmrcentries against the expected launcher path while still reporting the launcher as missing. - Adds a regression test for a deleted launcher.
- Corrects the status docstring and documents the fix in the changelog.
| File | Description |
|---|---|
cloudsmith_cli/credential_helpers/pnpm/installer.py |
Preserves host detection when the launcher is missing and corrects the docstring. |
cloudsmith_cli/cli/tests/commands/test_credential_helper_install.py |
Tests host reporting after launcher deletion. |
CHANGELOG.md |
Documents the corrected pnpm status output. |
Review effort: Balanced
NPMRC.helped_hosts() matched only the tokenHelper value that is the launcher path in the default bin directory. `credential-helper list` did not show hosts that you installed with --bin-dir. Match the launcher file name in any directory, as Docker and Cargo do. Uninstall uses the same match, so it now removes these entries too. Also correct the type of "launcher" in the status() docstring. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudsmith-iduffy
marked this pull request as ready for review
October 24, 2026 17:59
This branch has not been deployed
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.
Description
If the pnpm launcher is gone but
.npmrcstill points pnpm at it,cloudsmith credential-helper listshowed pnpm with no hosts. That hid the broken state: pnpm still tries to run the missing launcher for those hosts and fails.PNPMInstaller.status()set the launcher path toNonewhen the file did not exist. Then it looked fortokenHelperentries with the value"None", and found none. Nowstatus()matches the.npmrcentries against the expected launcher path, and it still reports the launcher as missing. Docker and Cargo already report hosts whatever the launcher state is.I also corrected the
status()docstring. It described Docker'sconfig.jsoncredHelpersblock, not.npmrc.Before (launcher deleted):
After (launcher deleted):
To reproduce, use a temporary
HOMEand setNPM_CONFIG_USERCONFIG=$HOME/.npmrc. Runcloudsmith credential-helper install pnpm --no-discover, then delete$HOME/.cloudsmith/bin/pnpm-credential-cloudsmith, then runcloudsmith credential-helper list.Type of Change
Additional Notes
This touches the same
status()method as #549, but not the same lines, so the code merges cleanly. The only conflict is the### Fixedheading inCHANGELOG.md, because both PRs add it.Hosts installed with
--bin-dirdidn't show either, because theirtokenHelpervalue is not the default launcher path.NPMRC.helped_hosts()now matches the launcher file name in any directory, the same way Docker and Cargo match on their helper name.uninstall pnpmuses the same lookup, so it now removes those.npmrcentries too, as Docker and Cargo already do. The"launcher"docstring now says it is astr, not aPath.🤖 Generated with Claude Code