Debug workflow.

This commit is contained in:
Cornelius Riemenschneider
2022-07-12 10:13:01 +00:00
committed by GitHub
parent 688508d8cb
commit a92229a995
210 changed files with 8997 additions and 9197 deletions
+13 -10
View File
@@ -11,6 +11,7 @@ import {
CODEQL_VERSION_COUNTS_LINES,
CODEQL_VERSION_NEW_TRACING,
getCodeQL,
runTool,
} from "./codeql";
import * as configUtils from "./config-utils";
import { countLoc } from "./count-loc";
@@ -433,15 +434,6 @@ export async function runFinalize(
logger: Logger,
featureFlags: FeatureFlags
) {
const codeql = await getCodeQL(config.codeQLCmd);
if (await util.codeQlVersionAbove(codeql, CODEQL_VERSION_NEW_TRACING)) {
// Delete variables as specified by the end-tracing script
await endTracingForCluster(config);
} else {
// Delete the tracer config env var to avoid tracing ourselves
delete process.env[sharedEnv.ODASA_TRACER_CONFIGURATION];
}
try {
await del(outputDir, { force: true });
} catch (error: any) {
@@ -458,6 +450,17 @@ export async function runFinalize(
logger,
featureFlags
);
const codeql = await getCodeQL(config.codeQLCmd);
if (await util.codeQlVersionAbove(codeql, CODEQL_VERSION_NEW_TRACING)) {
// Delete variables as specified by the end-tracing script
await runTool("bash", ["-c", "export"]);
await endTracingForCluster(config);
await runTool("bash", ["-c", "export"]);
} else {
// Delete the tracer config env var to avoid tracing ourselves
delete process.env[sharedEnv.ODASA_TRACER_CONFIGURATION];
}
}
export async function runCleanup(
@@ -492,7 +495,7 @@ async function injectLinesOfCode(
if (metric.rule && metric.rule.toolComponent) {
const matchingRule =
run.tool.extensions[metric.rule.toolComponent.index].rules[
metric.rule.index
metric.rule.index
];
if (matchingRule.properties.tags?.includes("lines-of-code")) {
metric.baseline = lineCounts[language];
+7 -5
View File
@@ -737,13 +737,14 @@ async function getCodeQLForCmd(
// because that always passes in a process name.
extraArgs.push(`--trace-process-level=${processLevel || 3}`);
}
extraArgs.push("--internal-use-lua-tracing");
if (
await util.codeQlVersionAbove(this, CODEQL_VERSION_LUA_TRACER_CONFIG)
) {
if (await featureFlags.getValue(FeatureFlag.LuaTracerConfigEnabled)) {
extraArgs.push("--internal-use-lua-tracing");
//
} else {
extraArgs.push("--no-internal-use-lua-tracing");
// extraArgs.push("--no-internal-use-lua-tracing");
}
}
}
@@ -821,10 +822,11 @@ async function getCodeQLForCmd(
if (
await util.codeQlVersionAbove(this, CODEQL_VERSION_LUA_TRACER_CONFIG)
) {
extraArgs.push("--internal-use-lua-tracing");
if (await featureFlags.getValue(FeatureFlag.LuaTracerConfigEnabled)) {
extraArgs.push("--internal-use-lua-tracing");
// extraArgs.push("--internal-use-lua-tracing");
} else {
extraArgs.push("--no-internal-use-lua-tracing");
// extraArgs.push("--no-internal-use-lua-tracing");
}
}
@@ -1128,7 +1130,7 @@ export function getExtraOptions(
*/
const maxErrorSize = 20_000;
async function runTool(cmd: string, args: string[] = []) {
export async function runTool(cmd: string, args: string[] = []) {
let output = "";
let error = "";
const exitCode = await new toolrunner.ToolRunner(cmd, args, {