Skip to content

Commit

Permalink
Run autobuild script via direct tracing when feature enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Mercer committed Apr 12, 2024
1 parent 8f057a3 commit cbe29f5
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/analyze-action.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/analyze-action.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/autobuild-action.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-action.js.map

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

4 changes: 2 additions & 2 deletions 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.

17 changes: 14 additions & 3 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/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async function runAutobuildIfLegacyGoWorkflow(
logger.debug(
"Running Go autobuild because extraction output (TRAP files) for Go code has not been found.",
);
await runAutobuild(Language.go, config, features, logger);
await runAutobuild(config, Language.go, features, logger);
}

async function run() {
Expand Down
2 changes: 1 addition & 1 deletion src/autobuild-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async function run() {
}
for (const language of languages) {
currentLanguage = language;
await runAutobuild(language, config, features, logger);
await runAutobuild(config, language, features, logger);
}
}
} catch (unwrappedError) {
Expand Down
4 changes: 2 additions & 2 deletions src/autobuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export async function setupCppAutobuild(codeql: CodeQL, logger: Logger) {
}

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

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

await t.throwsAsync(
async () => await codeqlObject.runAutobuild(Language.java, false),
async () =>
await codeqlObject.runAutobuild(
stubConfig,
Language.java,
createFeatures([]),
),
{
instanceOf: CommandInvocationError,
message:
Expand Down
Loading

0 comments on commit cbe29f5

Please sign in to comment.