Skip to content

Commit 3c45339

Browse files
committed
Call shouldPerformDiffInformedAnalysis() outside setupDiffInformedQueryRun()
1 parent 1994ea7 commit 3c45339

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/analyze-action.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { getCodeQL } from "./codeql";
2222
import { Config, getConfig } from "./config-utils";
2323
import { uploadDatabases } from "./database-upload";
2424
import { uploadDependencyCaches } from "./dependency-caching";
25+
import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-utils";
2526
import { EnvVar } from "./environment";
2627
import { Features } from "./feature-flags";
2728
import { Language } from "./languages";
@@ -269,11 +270,14 @@ async function run() {
269270
logger,
270271
);
271272

272-
const diffRangePackDir = await setupDiffInformedQueryRun(
273+
const branches = await shouldPerformDiffInformedAnalysis(
273274
codeql,
274-
logger,
275275
features,
276+
logger,
276277
);
278+
const diffRangePackDir = branches
279+
? await setupDiffInformedQueryRun(branches, logger)
280+
: undefined;
277281

278282
await warnIfGoInstalledAfterInit(config, logger);
279283
await runAutobuildIfLegacyGoWorkflow(config, logger);

src/analyze.ts

+1-12
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { addDiagnostic, makeDiagnostic } from "./diagnostics";
1616
import {
1717
DiffThunkRange,
1818
PullRequestBranches,
19-
shouldPerformDiffInformedAnalysis,
2019
writeDiffRangesJsonFile,
2120
} from "./diff-informed-analysis-utils";
2221
import { EnvVar } from "./environment";
@@ -263,19 +262,9 @@ async function finalizeDatabaseCreation(
263262
* the diff range information, or `undefined` if the feature is disabled.
264263
*/
265264
export async function setupDiffInformedQueryRun(
266-
codeql: CodeQL,
265+
branches: PullRequestBranches,
267266
logger: Logger,
268-
features: FeatureEnablement,
269267
): Promise<string | undefined> {
270-
const branches = await shouldPerformDiffInformedAnalysis(
271-
codeql,
272-
features,
273-
logger,
274-
);
275-
if (!branches) {
276-
return undefined;
277-
}
278-
279268
return await withGroupAsync(
280269
"Generating diff range extension pack",
281270
async () => {

0 commit comments

Comments
 (0)