Repository navigation
Launch the Coana CLI from Socket's servers instead of npm - #411
Merged
Oskar Haarklou Veileborg (BarrensZeppelin) merged 2 commits intoOct 19, 2026
Conversation
Coana releases are moving from npm to a private GCS bucket, which the Socket API hands out signed download URLs for. The reachability launcher now runs Coana the way coana-package-manager's "Launching Coana" docs specify: - It looks the version up in the cache that Coana and the Socket CLIs share, through coana-cache.mjs, which is vendored from coana-package-manager and generated there. - On a miss it asks POST /orgs/<org>/coana-cli/artifacts for the cli component, downloads the signed URL while checking its size and sha256, extracts it with tarfile and installs it into the cache. A refused URL is renewed once. - It runs cli-wrapper.mjs with node, passing SOCKET_CLI_API_BASE_URL derived from BASE_API_URL. A version spec that only matches releases from before the move fails with the API's explanation, which CliClient now includes in APIFailure. There is no npm fallback, so the npx and npm install launch paths are gone, along with SOCKET_CLI_COANA_LAUNCHER, and npm and npx are no longer required. The Docker image no longer installs @coana-tech/cli globally. ReachabilityAnalyzer now takes the CliClient instead of the SDK and the token. The tests run the real cache script against a fake cli-wrapper.mjs instead of mocking subprocess.
Oskar Haarklou Veileborg (BarrensZeppelin)
requested a review
from a team
as a code owner
October 19, 2026 12:00
Oskar Haarklou Veileborg (BarrensZeppelin)
requested a review
from Martin Torp (mtorp)
October 19, 2026 12:00
Oskar Haarklou Veileborg (BarrensZeppelin)
deployed
to
socket-firewall
October 19, 2026 12:01 — with
GitHub Actions
Active
Oskar Haarklou Veileborg (BarrensZeppelin)
deployed
to
socket-firewall
October 19, 2026 12:10 — with
GitHub Actions
Active
Martin Torp (mtorp)
approved these changes
Oct 19, 2026
Oskar Haarklou Veileborg (BarrensZeppelin)
merged commit Oct 19, 2026
6bd9e6c
into
main
32 checks passed
This branch was successfully 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.
Fixes REA-876. This is the Python counterpart of REA-875, which made the same change in socket-cli.
Coana releases are moving from npm to a private GCS bucket, which the Socket API hands out signed download URLs for. The reachability launcher now follows the "Launching Coana" steps in coana-package-manager's
packages/cli/docs/gcs-releases.md:node coana-cache.mjs lookup <version> cli. The script is vendored from coana-package-manager, where it is generated, and is the only code that reads or writes the cache Coana shares with the Socket CLIs.clicomponent fromPOST /orgs/<org>/coana-cli/artifacts, downloads the signed URL while checking its size and sha256, and renews a refused URL once.tarfile(with thedatafilter, keeping only regular files and directories, where the interpreter has it) and runscoana-cache.mjs install.node <dir>/cli-wrapper.mjs, now withSOCKET_CLI_API_BASE_URLderived fromBASE_API_URL.Other changes:
--reach-versionthat only matches releases from before the move fails with the API's explanation.CliClientnow includes the API'serror.messageinAPIFailure, so failed API requests elsewhere show it too.SOCKET_CLI_COANA_LAUNCHER(and its legacy variables) are gone. The reachability requirements check no longer asks fornpmandnpx.ReachabilityAnalyzertakes theCliClientinstead of the SDK and the token. TLS verification for both the download and Coana follows the client's config.@coana-tech/cliglobally; it still installs thesocketCLI.Testing: the unit tests now run the real
coana-cache.mjsagainst a fakecli-wrapper.mjsin a temporary cache, as socket-cli's tests do, instead of mockingsubprocess. Like socket-cli, they don't cover the download. I smoke-tested the download against the production API: 15.12.8 downloads, installs and reports its version, a second run hits the cache,^15.12.8andlatestresolve, and15.0.0fails with the API's "need an older Socket CLI" message.Follow-up: the bump-PR job in Coana's
publish-cli.ymlneeds to updateDEFAULT_COANA_CLI_VERSIONand the vendoredcoana-cache.mjsfor this repository.Expected reviewer effort: Full code review
Note
Medium Risk
Reachability now depends on the artifacts API, signed downloads, and on-disk cache behavior; misconfiguration or API changes could break
--reach, though behavior mirrors the Node CLI and is covered by updated tests.Overview
Release 2.11.0 replaces the reachability engine bootstrap: the Coana CLI is no longer run via
npx/npm installof@coana-tech/cli. It is resolved through the Socket API (POST …/coana-cli/artifacts), downloaded with size/sha256 checks, installed into a shared cache via vendoredcoana-cache.mjsunder$XDG_CACHE_HOME/socket/coana/v1, and executed asnode …/cli-wrapper.mjs.SOCKET_CLI_COANA_LAUNCHERand related npm fallbacks are removed;--reachpreflight now requires onlynodeanduv(notnpm/npx).ReachabilityAnalyzeris wired throughCliClient(API token, base URL, TLS settings) and setsSOCKET_CLI_API_BASE_URLfor Coana. Failed API calls surface the server’serror.messageinAPIFailure. Docs, changelog, Docker (drops global@coana-tech/cli), and CI path filters for.mjsare updated; reachability unit tests exercise the real cache helper with a fake wrapper instead of mocking subprocess.Reviewed by Cursor Bugbot for commit 181821d. Configure here.