Merge branch 'main' into henrymercer/on-demand-ffs

This commit is contained in:
Henry Mercer 2024-05-10 11:32:35 +01:00
commit 67f8a36bdb
21 changed files with 78 additions and 73 deletions

12
lib/tracer-config.js generated
View file

@ -37,9 +37,19 @@ async function shouldEnableIndirectTracing(codeql, config, features) {
config.languages.some((l) => (0, languages_1.isTracedLanguage)(l)));
}
exports.shouldEnableIndirectTracing = shouldEnableIndirectTracing;
async function endTracingForCluster(codeql, config, features) {
/**
* Delete variables as specified by the end-tracing script
*
* WARNING: This does not _really_ end tracing, as the tracer will restore its
* critical environment variables and it'll still be active for all processes
* launched from this build step.
*
* However, it will stop tracing for all steps past the current build step.
*/
async function endTracingForCluster(codeql, config, logger, features) {
if (!(await shouldEnableIndirectTracing(codeql, config, features)))
return;
logger.info("Unsetting build tracing environment variables. Subsequent steps of this job will not be traced.");
const envVariablesFile = path.resolve(config.dbLocation, "temp/tracingEnvironment/end-tracing.json");
if (!fs.existsSync(envVariablesFile)) {
throw new Error(`Environment file for ending tracing not found: ${envVariablesFile}`);