Repository navigation
fix(no-ticket): keep credential-helper list running on a bad config file - #549
Open
cloudsmith-iduffy wants to merge 1 commit into
Open
cloudsmith-iduffy wants to merge 1 commit into
cloudsmith-iduffy wants to merge 1 commit into
Conversation
A Docker credHelpers value that is not an object stopped the command with an AttributeError. A Docker, pnpm, or Terraform config file that is not UTF-8, or a pnpm .npmrc that the CLI cannot read, also stopped it. The status() method of each helper now reports no hosts for these files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The localized error handling preserves valid-configuration behavior, with regression coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Keeps cloudsmith credential-helper list running when a helper’s configuration is malformed or unreadable, so other helpers remain visible.
Changes:
- Adds defensive configuration handling to Docker, pnpm, and Terraform status checks.
- Adds regression tests confirming bad configurations report no hosts without interrupting the list.
- Documents the fix in the changelog.
| File | Description |
|---|---|
cloudsmith_cli/credential_helpers/terraform/installer.py |
Handles invalid UTF-8 during status checks. |
cloudsmith_cli/credential_helpers/pnpm/installer.py |
Handles unreadable or undecodable .npmrc files. |
cloudsmith_cli/credential_helpers/docker/installer.py |
Guards malformed credHelpers values and decoding errors. |
cloudsmith_cli/cli/tests/commands/test_credential_helper_install.py |
Tests continued listing with bad helper configurations. |
CHANGELOG.md |
Describes the corrected listing behavior. |
Review effort: Balanced
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
cloudsmith credential-helper liststopped with an error when one helper's config file was odd, and the other helpers were not listed at all.Before, with
~/.docker/config.jsonset to{"credHelpers": ["x"]}:After:
I checked the
status()method of all four helpers with bad input: wrong JSON/TOML types, files that are not UTF-8, directories in place of files, and files with no read permission. These cases crashed:credHelpersvalue that is not an object (list, string,null), and aconfig.jsonthat is not UTF-8..npmrcthat is not UTF-8, that is a directory, or that the CLI cannot read..terraformrcthat is not UTF-8.Cargo already handled all of these. Each
status()now reports no hosts for a bad file, solistshows that helper as not configured and continues.Type of Change
Additional Notes
The change stays inside the
status()methods. It does not touchuninstallormerge_config_file, which other open PRs change.🤖 Generated with Claude Code