Skip to content

Commit 67ef556

Browse files
authored
add --debug option to socket fix (#979)
* add `--debug` option to `socket fix` bump coana version for better logging when `pnpm install` fails during `socket fix` * updated descrition for `socket fix` option `--debug`
1 parent 651f706 commit 67ef556

File tree

8 files changed

+34
-9
lines changed

8 files changed

+34
-9
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [1.1.47](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.47) - 2025-12-15
8+
9+
### Added
10+
- Added `--debug` flag to `socket fix` to enable verbose logging in the Coana CLI.
11+
12+
### Changed
13+
- Updated the Coana CLI to v `14.12.127`.
14+
715
## [1.1.46](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.46) - 2025-12-12
816

917
### Changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "socket",
3-
"version": "1.1.46",
3+
"version": "1.1.47",
44
"description": "CLI for Socket.dev",
55
"homepage": "https://github.com/SocketDev/socket-cli",
66
"license": "MIT AND OFL-1.1",
@@ -94,7 +94,7 @@
9494
"@babel/preset-typescript": "7.27.1",
9595
"@babel/runtime": "7.28.4",
9696
"@biomejs/biome": "2.2.4",
97-
"@coana-tech/cli": "14.12.126",
97+
"@coana-tech/cli": "14.12.127",
9898
"@cyclonedx/cdxgen": "11.11.0",
9999
"@dotenvx/dotenvx": "1.49.0",
100100
"@eslint/compat": "1.3.2",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commands/fix/cmd-fix.integration.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { existsSync, promises as fs } from 'node:fs'
1+
import { promises as fs } from 'node:fs'
22
import { tmpdir } from 'node:os'
33
import path from 'node:path'
44

5-
import trash from 'trash'
65
import { describe, expect } from 'vitest'
76

87
import constants, {
@@ -167,6 +166,7 @@ describe('socket fix', async () => {
167166
--all Process all discovered vulnerabilities in local mode. Cannot be used with --id.
168167
--autopilot Enable auto-merge for pull requests that Socket opens.
169168
See GitHub documentation (https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository) for managing auto-merge for pull requests in your repository.
169+
--debug Enable debug logging in the Coana-based Socket Fix CLI invocation.
170170
--ecosystems Limit fix analysis to specific ecosystems. Can be provided as comma separated values or as multiple flags. Defaults to all ecosystems.
171171
--exclude Exclude workspaces matching these glob patterns. Can be provided as comma separated values or as multiple flags
172172
--fix-version Override the version of @coana-tech/cli used for fix analysis. Default: <coana-version>.

src/commands/fix/cmd-fix.mts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ Available styles:
147147
description:
148148
'Set a minimum age requirement for suggested upgrade versions (e.g., 1h, 2d, 3w). A higher age requirement reduces the risk of upgrading to malicious versions. For example, setting the value to 1 week (1w) gives ecosystem maintainers one week to remove potentially malicious versions.',
149149
},
150+
debug: {
151+
type: 'boolean',
152+
default: false,
153+
description:
154+
'Enable debug logging in the Coana-based Socket Fix CLI invocation.',
155+
shortFlag: 'd',
156+
},
150157
ecosystems: {
151158
type: 'string',
152159
default: [],
@@ -281,6 +288,7 @@ async function run(
281288
all,
282289
applyFixes,
283290
autopilot,
291+
debug,
284292
ecosystems,
285293
exclude,
286294
fixVersion,
@@ -302,6 +310,7 @@ async function run(
302310
all: boolean
303311
applyFixes: boolean
304312
autopilot: boolean
313+
debug: boolean
305314
ecosystems: string[]
306315
exclude: string[]
307316
fixVersion: string | undefined
@@ -409,6 +418,7 @@ async function run(
409418
autopilot,
410419
coanaVersion: fixVersion,
411420
cwd,
421+
debug,
412422
disableMajorUpdates,
413423
ecosystems: validatedEcosystems,
414424
exclude: excludePatterns,

src/commands/fix/coana-fix.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export async function coanaFix(
112112
autopilot,
113113
coanaVersion,
114114
cwd,
115+
debug,
115116
disableMajorUpdates,
116117
ecosystems,
117118
exclude,
@@ -246,6 +247,7 @@ export async function coanaFix(
246247
...(!applyFixes ? [FLAG_DRY_RUN] : []),
247248
'--output-file',
248249
tmpFile,
250+
...(debug ? ['--debug'] : []),
249251
...(disableMajorUpdates ? ['--disable-major-updates'] : []),
250252
...(showAffectedDirectDependencies
251253
? ['--show-affected-direct-dependencies']
@@ -371,6 +373,7 @@ export async function coanaFix(
371373
...(include.length ? ['--include', ...include] : []),
372374
...(exclude.length ? ['--exclude', ...exclude] : []),
373375
...(ecosystems.length ? ['--purl-types', ...ecosystems] : []),
376+
...(debug ? ['--debug'] : []),
374377
...(disableMajorUpdates ? ['--disable-major-updates'] : []),
375378
...(showAffectedDirectDependencies
376379
? ['--show-affected-direct-dependencies']

src/commands/fix/handle-fix.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export async function handleFix({
102102
autopilot,
103103
coanaVersion,
104104
cwd,
105+
debug,
105106
disableMajorUpdates,
106107
ecosystems,
107108
exclude,
@@ -126,6 +127,7 @@ export async function handleFix({
126127
autopilot,
127128
coanaVersion,
128129
cwd,
130+
debug,
129131
disableMajorUpdates,
130132
ecosystems,
131133
exclude,
@@ -149,6 +151,7 @@ export async function handleFix({
149151
autopilot,
150152
coanaVersion,
151153
cwd,
154+
debug,
152155
disableMajorUpdates,
153156
ecosystems,
154157
exclude,

src/commands/fix/types.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type FixConfig = {
88
autopilot: boolean
99
coanaVersion: string | undefined
1010
cwd: string
11+
debug: boolean
1112
disableMajorUpdates: boolean
1213
ecosystems: PURL_Type[]
1314
exclude: string[]

0 commit comments

Comments
 (0)