Repository navigation
feat(ENG-15016): let credential-helper launchers keep install-time settings - #511
Draft
cloudsmith-iduffy wants to merge 1 commit into
Draft
cloudsmith-iduffy wants to merge 1 commit into
cloudsmith-iduffy wants to merge 1 commit into
Conversation
cloudsmith-iduffy
added this pull request to stack #513
October 21, 2026 13:10
This was referenced Oct 21, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
No registered installer enables or forwards the captured settings, leaving the feature inactive.
1 open issue
What changed in this PR
Adds infrastructure for credential-helper launchers to retain install-time settings across different runtime environments.
Changes:
- Captures selected CLI and environment settings.
- Adds launcher environment exports and Windows value validation.
- Tests settings capture, path resolution, and Windows encoding safeguards.
| File | Description |
|---|---|
| cloudsmith_cli/credential_helpers/launchers.py | Adds settings normalization and platform-specific environment rendering. |
| cloudsmith_cli/cli/tests/commands/test_credential_helper_install.py | Tests settings capture and launcher value handling. |
| cloudsmith_cli/cli/commands/credential_helper/manage.py | Collects settings for opted-in installers. |
Review effort: Balanced
Comment on lines
+382
to
+385
| if getattr(installer, "KEEPS_INSTALL_TIME_SETTINGS", False): | ||
| install_kwargs["launcher_env"] = _launcher_settings_from_cli( | ||
| ctx, opts, env_only_settings | ||
| ) |
cloudsmith-iduffy
force-pushed
the
iduffy/launcher-install-time-settings
branch
4 times, most recently
from
October 21, 2026 15:34
c2ee2fb to
e1a1c2e
Compare
1 of 6 tasks
cloudsmith-iduffy
removed this pull request from stack #513
October 21, 2026 16:30
cloudsmith-iduffy
force-pushed
the
iduffy/launcher-install-time-settings
branch
from
October 21, 2026 16:30
e1a1c2e to
23abdbd
Compare
cloudsmith-iduffy
changed the base branch from
master
to
iduffy/keyring-settings-via-click
October 21, 2026 16:30
cloudsmith-iduffy
added this pull request to stack #516
October 21, 2026 16:30
…ttings A package manager can run its credential helper from an IDE, Docker Desktop or a build agent that does not have the environment of the install. This change adds the shared code that writes the install-time CLOUDSMITH_* settings into a launcher. - `write_launcher(env=...)` in `launchers.py` writes the settings as `export` lines, or as `set` lines in a Windows batch file. The settings replace the values of the caller. - `batch_value()` refuses a value that a batch file cannot hold. A non-ASCII path under the user profile becomes `%USERPROFILE%`. - `install` passes `launcher_env` to an installer that sets `KEEPS_INSTALL_TIME_SETTINGS`. It holds each option with a CLOUDSMITH_* environment variable whose value came from a flag or the environment, also on a parent command, so the keyring settings of `main` are kept too. The API key, the custom headers, the keyring key and the proxy never go into it. No installer sets `KEEPS_INSTALL_TIME_SETTINGS` yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudsmith-iduffy
force-pushed
the
iduffy/launcher-install-time-settings
branch
from
October 21, 2026 17:11
23abdbd to
6db2380
Compare
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
A package manager often runs its credential helper from a process that does not have the environment of the shell that ran
cloudsmith credential-helper install, for example Docker Desktop, an IDE or a build agent. The flags andCLOUDSMITH_*variables that you gave at install time are then lost. This PR adds the shared code that writes those settings into the launcher. The Docker helper (#512) and the NuGet provider (#494) use it.installkeeps every option that has aCLOUDSMITH_*environment variable and got its value from a flag or the environment, also from a flag on a parent command such ascloudsmith -P work credential-helper install …. The list comes from the Click options themselves, so a new option is kept with no extra code. Values fromconfig.iniare not written, because the helper reads that file itself. The keyring settings come from the hidden options that refactor(no-ticket): read the keyring settings through Click #515 adds tomain.write_launcher(env=...)writes the settings asexportlines, or assetlines in a Windows batch file. They replace the values of the caller, so the helper gives the same result as the install.batch_value()refuses a value that a batch file cannot hold:",%, a line break, or non-ASCII text outside the user profile. A non-ASCII path under the profile becomes%USERPROFILE%. The path of the standalone binary goes through the same check.KEEPS_INSTALL_TIME_SETTINGS = True. No installer opts in in this PR.Type of Change
Additional Notes
This code was in #494. I moved it here and replaced its fixed list of settings with the loop over the Click options.
The install tests now remove
CLOUDSMITH_*variables from the environment, so a direnv shell does not change their result.There is no CHANGELOG entry, because nothing changes for users until an installer opts in.
🤖 Generated with Claude Code