Consolidate coana launcher env vars into SOCKET_CLI_COANA_LAUNCHER#233
Open
Martin Torp (mtorp) wants to merge 1 commit into
Open
Consolidate coana launcher env vars into SOCKET_CLI_COANA_LAUNCHER#233Martin Torp (mtorp) wants to merge 1 commit into
Martin Torp (mtorp) wants to merge 1 commit into
Conversation
|
🚀 Preview package published! Install with: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==2.4.9.dev1Docker image: |
Replace the SOCKET_CLI_COANA_FORCE_NPM_INSTALL and SOCKET_CLI_COANA_DISABLE_NPM_FALLBACK toggles with a single SOCKET_CLI_COANA_LAUNCHER variable (auto | npx | npm-install), mirroring the Socket Node CLI. The legacy variables remain supported when the new variable is unset, but are deprecated and no longer documented. Follow-up from the review thread on PR #230.
bc7e85f to
01afb8b
Compare
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.
Motivation
Follow-up from the review thread on #230 (#230 (comment)): the two coana launcher toggles introduced there (
SOCKET_CLI_COANA_FORCE_NPM_INSTALLandSOCKET_CLI_COANA_DISABLE_NPM_FALLBACK) are consolidated into a single variable, mirroring the same change landing in the Node CLI (socket-cli, branchmartin/env-variable-cleanup).Changes
New
SOCKET_CLI_COANA_LAUNCHERvariable with three values:auto(default / unset) — trynpxfirst, fall back tonpm install+nodeon launcher-level failures (unchanged default behavior).npx— npx only; never fall back (replacesSOCKET_CLI_COANA_DISABLE_NPM_FALLBACK).npm-install— skip npx entirely; alwaysnpm install+node(replacesSOCKET_CLI_COANA_FORCE_NPM_INSTALL).Resolution rules (identical to the Node CLI):
SOCKET_CLI_COANA_LAUNCHERis stripped/lowercased; a recognized value wins and the legacy vars are ignored entirely.auto(legacy vars ignored here too).SOCKET_CLI_COANA_FORCE_NPM_INSTALL→npm-install, elseSOCKET_CLI_COANA_DISABLE_NPM_FALLBACK→npx, elseauto.The legacy variables remain supported for back-compat but are deprecated and no longer documented.
SOCKET_CLI_COANA_LOCAL_PATHis untouched.socketsecurity/core/tools/reachability.py: new_resolve_coana_launcher_mode()helper; the npm-install and no-fallback gates now key off the resolved mode.docs/cli-reference.md: the two legacy bullets replaced with the new variable and its three values.tests/unit/test_reachability.py: legacy-var tests kept as back-compat coverage; new tests fornpm-install,npx, precedence over legacy vars, and unrecognized-value-as-auto.CHANGELOG.md: 2.4.8 entry.Testing
uv run --extra test pytest tests/unit— 291 passed, 2 skipped (pre-existing).