Skip to content

fix(ENG-15090): find default-installed launchers in credential-helper list - #491

Open
cloudsmith-iduffy wants to merge 2 commits into
masterfrom
iduffy/credential-helper-list-bin-dir
Open

cloudsmith-iduffy wants to merge 2 commits into
masterfrom
iduffy/credential-helper-list-bin-dir

Conversation

@cloudsmith-iduffy

Copy link
Copy Markdown
Collaborator

Description

After a default cloudsmith credential-helper install docker (or pnpm, cargo), cloudsmith credential-helper list reports the helper as not installed.

#482 made install and uninstall default to ~/.cloudsmith/bin, through a _resolve_bin_dir() helper in manage.py. Each installer's status(), which list calls, still used launchers.resolve_bin_dir(). That function looked beside the cloudsmith executable first, then in ~/.local/bin (or %LOCALAPPDATA%\Cloudsmith\bin). So list looked in one directory and install wrote to another.

This PR moves the ~/.cloudsmith/bin default into resolve_bin_dir() itself, and manage.py passes --bin-dir through again. Every caller now resolves the same directory. Terraform is unchanged, because its installer keeps its own plugin-directory resolution when --bin-dir is not given. The old executable-directory and ~/.local/bin fallbacks were no longer reachable from install, so I removed them with _user_bin_dir.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Other (please describe)

Additional Notes

A new regression test runs a default install docker and then list -F json, and checks that list reports the launcher in ~/.cloudsmith/bin. It failed before the change.

🤖 Generated with Claude Code

… list

`install` and `uninstall` default to `~/.cloudsmith/bin`, but each
installer's `status()` called `resolve_bin_dir()`, which still looked
beside the `cloudsmith` executable. `list` therefore reported a
default install as not installed. `resolve_bin_dir()` now owns the
`~/.cloudsmith/bin` default, so every caller uses the same directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Default-path canonicalization must be preserved to prevent broken pnpm configuration after uninstalling existing symlinked installations.

1 open finding
What changed in this PR

Aligns credential-helper directory resolution so list finds default installations.

Changes:

  • Centralizes the ~/.cloudsmith/bin default in the shared resolver.
  • Removes redundant CLI resolution while preserving Terraform’s plugin-directory behavior.
  • Adds regression coverage and a changelog entry.
File Description
cloudsmith_cli/​credential_helpers/​launchers.py Centralizes the default launcher directory.
cloudsmith_cli/​cli/​tests/​commands/​test_credential_helper_install.py Tests default resolution and install-to-list discovery.
cloudsmith_cli/​cli/​commands/​credential_helper/​manage.py Passes directory overrides directly to installers.
CHANGELOG.md Documents the discovery fix.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cloudsmith_cli/credential_helpers/launchers.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@cloudsmith-iduffy
cloudsmith-iduffy marked this pull request as ready for review October 16, 2026 20:32
@cloudsmith-iduffy
cloudsmith-iduffy requested a review from a team as a code owner October 16, 2026 20:32

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants