Skip to content

Commit 3234d64

Browse files
committed
Cleanup logging in fix
1 parent 3b1363f commit 3234d64

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/commands/fix/agent-fix.mts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export async function agentFix(
227227
continue infoEntriesLoop
228228
}
229229

230-
logger.log(`Processing vulns for ${name}`)
230+
logger.log(`Processing '${name}'`)
231231
logger.indent()
232232
spinner?.indent()
233233

@@ -245,6 +245,7 @@ export async function agentFix(
245245

246246
const availableVersions = Object.keys(packument.versions)
247247
const prs = getPrsForPurl(fixEnv, infoEntry[0])
248+
const vulnVersions = new Set<string>()
248249
const warningsForAfter = new Set<string>()
249250

250251
// eslint-disable-next-line no-unused-labels
@@ -335,6 +336,7 @@ export async function agentFix(
335336
: undefined
336337

337338
if (!(newVersion && newVersionPackument)) {
339+
vulnVersions.add(oldVersion)
338340
warningsForAfter.add(
339341
`${oldId} not updated: requires >=${firstPatchedVersionIdentifier}`,
340342
)
@@ -436,6 +438,8 @@ export async function agentFix(
436438
workspaceLogCallCount = logger.logCallCount
437439
}
438440

441+
vulnVersions.add(oldVersion)
442+
439443
const newId = `${name}@${applyRange(refRange, newVersion, rangeStyle)}`
440444

441445
spinner?.start()
@@ -652,6 +656,9 @@ export async function agentFix(
652656
for (const warningText of warningsForAfter) {
653657
logger.warn(warningText)
654658
}
659+
if (!warningsForAfter.size && !vulnVersions.size) {
660+
logger.info('No vulnerable versions found.')
661+
}
655662
if (!isLastInfoEntry) {
656663
logger.logNewline()
657664
}

0 commit comments

Comments
 (0)