Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Call shouldPerformDiffInformedAnalysis() outside setupDiffInformedQue…
…ryRun()
  • Loading branch information
cklin committed Mar 27, 2025
commit 3c4533916b963c63f940e5ba42a99b16fd49bffb
8 changes: 6 additions & 2 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getCodeQL } from "./codeql";
import { Config, getConfig } from "./config-utils";
import { uploadDatabases } from "./database-upload";
import { uploadDependencyCaches } from "./dependency-caching";
import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-utils";
import { EnvVar } from "./environment";
import { Features } from "./feature-flags";
import { Language } from "./languages";
Expand Down Expand Up @@ -269,11 +270,14 @@ async function run() {
logger,
);

const diffRangePackDir = await setupDiffInformedQueryRun(
const branches = await shouldPerformDiffInformedAnalysis(
codeql,
logger,
features,
logger,
);
const diffRangePackDir = branches
? await setupDiffInformedQueryRun(branches, logger)
: undefined;

await warnIfGoInstalledAfterInit(config, logger);
await runAutobuildIfLegacyGoWorkflow(config, logger);
Expand Down
13 changes: 1 addition & 12 deletions src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { addDiagnostic, makeDiagnostic } from "./diagnostics";
import {
DiffThunkRange,
PullRequestBranches,
shouldPerformDiffInformedAnalysis,
writeDiffRangesJsonFile,
} from "./diff-informed-analysis-utils";
import { EnvVar } from "./environment";
Expand Down Expand Up @@ -263,19 +262,9 @@ async function finalizeDatabaseCreation(
* the diff range information, or `undefined` if the feature is disabled.
*/
export async function setupDiffInformedQueryRun(
codeql: CodeQL,
branches: PullRequestBranches,
logger: Logger,
features: FeatureEnablement,
): Promise<string | undefined> {
const branches = await shouldPerformDiffInformedAnalysis(
codeql,
features,
logger,
);
if (!branches) {
return undefined;
}

return await withGroupAsync(
"Generating diff range extension pack",
async () => {
Expand Down