Skip to content

Commit 09c5a29

Browse files
committed
fix(review-enrichment): include changed paths in dead-export caller checks
1 parent e451ceb commit 09c5a29

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

review-enrichment/src/analyzers/caller-impact.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ async function resolveCallers(
310310
headSha: string,
311311
token: string,
312312
skipPaths: Set<string> | null,
313+
additionalPaths: Iterable<string> = [],
313314
fetchImpl: typeof fetch,
314315
options: ScanOptions = {},
315316
): Promise<string[]> {
@@ -321,8 +322,10 @@ async function resolveCallers(
321322
fetchImpl,
322323
options,
323324
);
325+
const candidatePaths = new Set(hitPaths);
326+
for (const path of additionalPaths) candidatePaths.add(path);
324327
const callers: string[] = [];
325-
for (const path of hitPaths) {
328+
for (const path of candidatePaths) {
326329
if (skipPaths?.has(path)) continue;
327330
if (callers.length >= MAX_CALLERS_PER_SYMBOL) break;
328331
if (
@@ -478,6 +481,7 @@ export async function scanCallerImpact(
478481
req.headSha,
479482
req.githubToken,
480483
candidate.kind === "dead" ? null : changedPaths,
484+
candidate.kind === "dead" ? changedPaths : [],
481485
fetchImpl,
482486
options,
483487
);

0 commit comments

Comments
 (0)