Skip to content

Commit

Permalink
Don't call trace-command when the indirect tracer has already been …
Browse files Browse the repository at this point in the history
…started
  • Loading branch information
Henry Mercer committed May 9, 2024
1 parent 7d9b7a1 commit 7a6352f
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 55 deletions.
2 changes: 1 addition & 1 deletion lib/autobuild.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/autobuild.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 1 addition & 12 deletions lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/codeql.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.test.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/autobuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export async function runAutobuild(
) {
await codeQL.extractUsingBuildMode(config, language);
} else {
await codeQL.runAutobuild(config, language, features);
await codeQL.runAutobuild(config, language);
}
if (language === Language.go) {
core.exportVariable(EnvVar.DID_AUTOBUILD_GOLANG, "true");
Expand Down
14 changes: 2 additions & 12 deletions src/codeql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,12 +910,7 @@ test("runTool summarizes autobuilder errors", async (t) => {
sinon.stub(safeWhich, "safeWhich").resolves("");

await t.throwsAsync(
async () =>
await codeqlObject.runAutobuild(
stubConfig,
Language.java,
createFeatures([]),
),
async () => await codeqlObject.runAutobuild(stubConfig, Language.java),
{
instanceOf: CommandInvocationError,
message:
Expand Down Expand Up @@ -943,12 +938,7 @@ test("runTool truncates long autobuilder errors", async (t) => {
sinon.stub(safeWhich, "safeWhich").resolves("");

await t.throwsAsync(
async () =>
await codeqlObject.runAutobuild(
stubConfig,
Language.java,
createFeatures([]),
),
async () => await codeqlObject.runAutobuild(stubConfig, Language.java),
{
instanceOf: CommandInvocationError,
message:
Expand Down
26 changes: 2 additions & 24 deletions src/codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ export interface CodeQL {
/**
* Runs the autobuilder for the given language.
*/
runAutobuild(
config: Config,
language: Language,
features: FeatureEnablement,
): Promise<void>;
runAutobuild(config: Config, language: Language): Promise<void>;
/**
* Extract code for a scanned language using 'codeql database trace-command'
* and running the language extractor.
Expand Down Expand Up @@ -634,27 +630,9 @@ export async function getCodeQLForCmd(
{ stdin: externalRepositoryToken },
);
},
async runAutobuild(
config: Config,
language: Language,
features: FeatureEnablement,
) {
async runAutobuild(config: Config, language: Language) {
applyAutobuildAzurePipelinesTimeoutFix();

if (
await features.getValue(Feature.AutobuildDirectTracingEnabled, this)
) {
await runTool(cmd, [
"database",
"trace-command",
...(await getTrapCachingExtractorConfigArgsForLang(config, language)),
...getExtractionVerbosityArguments(config.debugMode),
...getExtraOptionsFromEnv(["database", "trace-command"]),
util.getCodeQLDatabasePath(config, language),
]);
return;
}

const autobuildCmd = path.join(
await this.resolveExtractor(language),
"tools",
Expand Down

0 comments on commit 7a6352f

Please sign in to comment.