Skip to content

Commit 1839ac5

Browse files
committed
fix: lint
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
1 parent d24e6ff commit 1839ac5

3 files changed

Lines changed: 21 additions & 15 deletions

File tree

backend/src/api/public/v1/akrites-external/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { getAkritesExternalContactDetailBatch } from '../packages/getAkritesExte
1212
import { getAkritesExternalPackageDetail } from '../packages/getAkritesExternalPackageDetail'
1313
import { getAkritesExternalPackageDetailBatch } from '../packages/getAkritesExternalPackageDetailBatch'
1414
import { getBlastRadiusJob } from '../packages/getBlastRadiusJob'
15-
import { ingestAkritesExternalContactDetail } from '../packages/ingestAkritesExternalContactDetail'
1615
import { getBlastRadiusJobBatch } from '../packages/getBlastRadiusJobBatch'
16+
import { ingestAkritesExternalContactDetail } from '../packages/ingestAkritesExternalContactDetail'
1717
import { submitBlastRadiusJob } from '../packages/submitBlastRadiusJob'
1818
import { submitBlastRadiusJobBatch } from '../packages/submitBlastRadiusJobBatch'
1919

backend/src/bin/scripts/blastRadiusLoadTest.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
// --advisories=FILE path to a JSON array of {advisoryId, package, ecosystem} —
2626
// jobs round-robin across these instead of all hitting the
2727
// same package (default: a single lodash advisory, repeated)
28-
2928
import { execSync } from 'child_process'
3029
import * as fs from 'fs'
3130

@@ -84,9 +83,7 @@ function applyRunConfig() {
8483
// cgroup cap above, which docker update can patch live) — they're baked in at
8584
// container start. Verify the worker already has the value this run wants
8685
// instead of silently testing against whatever it happened to start with.
87-
const actual = sh(
88-
`docker exec ${CONTAINER} sh -c 'echo $BLAST_RADIUS_SCAN_CONCURRENCY'`,
89-
)
86+
const actual = sh(`docker exec ${CONTAINER} sh -c 'echo $BLAST_RADIUS_SCAN_CONCURRENCY'`)
9087
if (actual !== SCAN_CONCURRENCY) {
9188
throw new Error(
9289
`--scanConcurrency=${SCAN_CONCURRENCY} requested but ${CONTAINER} was started with ` +
@@ -114,9 +111,7 @@ function resetRunConfig() {
114111

115112
function sampleContainerStats(): { memUsage: string; cpuPerc: string } | null {
116113
try {
117-
const raw = sh(
118-
`docker stats ${CONTAINER} --no-stream --format "{{.MemUsage}}|{{.CPUPerc}}"`,
119-
)
114+
const raw = sh(`docker stats ${CONTAINER} --no-stream --format "{{.MemUsage}}|{{.CPUPerc}}"`)
120115
const [memUsage, cpuPerc] = raw.split('|')
121116
return { memUsage, cpuPerc }
122117
} catch {
@@ -190,7 +185,9 @@ async function main() {
190185
}),
191186
)
192187

193-
console.log(`[loadtest] submitted ${analysisIds.length} analyses in ${Date.now() - submittedAt}ms`)
188+
console.log(
189+
`[loadtest] submitted ${analysisIds.length} analyses in ${Date.now() - submittedAt}ms`,
190+
)
194191
console.log(`[loadtest] analysisIds: ${analysisIds.join(', ')}`)
195192

196193
const deadline = Date.now() + TIMEOUT_MS
@@ -229,7 +226,9 @@ async function main() {
229226
allDone = true
230227
break
231228
}
232-
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS))
229+
await new Promise((resolve) => {
230+
setTimeout(resolve, POLL_INTERVAL_MS)
231+
})
233232
}
234233

235234
if (!allDone) {
@@ -246,15 +245,20 @@ async function main() {
246245
for (const id of analysisIds) {
247246
const runs = stageRuns.filter((r: { analysis_id: string }) => r.analysis_id === id)
248247
const summary = runs
249-
.map((r: { stage: string; status: string; error: string | null }) => `${r.stage}=${r.status}${r.error ? ` (${r.error})` : ''}`)
248+
.map(
249+
(r: { stage: string; status: string; error: string | null }) =>
250+
`${r.stage}=${r.status}${r.error ? ` (${r.error})` : ''}`,
251+
)
250252
.join(', ')
251253
console.log(`${id}: ${summary || 'no stage runs recorded'}`)
252254
}
253255

254256
console.log('\n=== Stage duration stats (ms) ===')
255257
for (const stage of ['intel', 'dependents', 'reachability', 'report']) {
256258
const durations = stageRuns
257-
.filter((r: { stage: string; status: string }) => r.stage === stage && r.status === 'succeeded')
259+
.filter(
260+
(r: { stage: string; status: string }) => r.stage === stage && r.status === 'succeeded',
261+
)
258262
.map((r: { duration_ms: number | string }) => Number(r.duration_ms))
259263
console.log(`${stage}:`, stats(durations))
260264
}

services/apps/packages_worker/src/blast-radius/agent/runner.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// @anthropic-ai/claude-agent-sdk ships ESM-only; packages_worker compiles to
22
// CommonJS, so it must be loaded via dynamic import rather than a static one.
3-
43
// Agent runner wrapping Claude Agent SDK with read-only tool restrictions,
54
// API key fallback, structured output, and timeout support.
6-
75
import { getServiceChildLogger } from '@crowd/logging'
86

97
const log = getServiceChildLogger('blast-radius-agent-runner')
@@ -57,7 +55,11 @@ export async function runAnalysisAgent(input: RunAnalysisAgentInput): Promise<Ag
5755

5856
log.info(
5957
{
60-
authMode: apiKey ? (baseUrl ? 'api-key via base-url override (e.g. LiteLLM)' : 'api-key') : 'fallback on local claude code token',
58+
authMode: apiKey
59+
? baseUrl
60+
? 'api-key via base-url override (e.g. LiteLLM)'
61+
: 'api-key'
62+
: 'fallback on local claude code token',
6163
},
6264
'blast-radius agent: auth mode for this run',
6365
)

0 commit comments

Comments
 (0)