Merge branch 'main' into henrymercer/controlled-switchover

This commit is contained in:
Henry Mercer 2023-01-18 15:37:28 +00:00
commit 5f1362dd53
12 changed files with 54 additions and 31 deletions

10
lib/codeql.js generated
View file

@ -290,7 +290,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
...getExtraOptionsFromEnv(["database", "init"]),
]);
},
async databaseInitCluster(config, sourceRoot, processName, featureEnablement) {
async databaseInitCluster(config, sourceRoot, processName, featureEnablement, logger) {
const extraArgs = config.languages.map((language) => `--language=${language}`);
if (config.languages.filter((l) => (0, languages_1.isTracedLanguage)(l)).length > 0) {
extraArgs.push("--begin-tracing");
@ -309,7 +309,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
}
}
// A config file is only generated if the CliConfigFileEnabled feature flag is enabled.
const configLocation = await generateCodeScanningConfig(codeql, config, featureEnablement);
const configLocation = await generateCodeScanningConfig(codeql, config, featureEnablement, logger);
// Only pass external repository token if a config file is going to be parsed by the CLI.
let externalRepositoryToken;
if (configLocation) {
@ -696,7 +696,7 @@ async function runTool(cmd, args = [], opts = {}) {
* @param config The configuration to use.
* @returns the path to the generated user configuration file.
*/
async function generateCodeScanningConfig(codeql, config, featureEnablement) {
async function generateCodeScanningConfig(codeql, config, featureEnablement, logger) {
var _a;
if (!(await util.useCodeScanningConfigInCli(codeql, featureEnablement))) {
return;
@ -755,6 +755,10 @@ async function generateCodeScanningConfig(codeql, config, featureEnablement) {
augmentedConfig.packs["javascript"].push(packString);
}
}
logger.info(`Writing augmented user configuration file to ${configLocation}`);
logger.startGroup("Augmented user configuration file contents");
logger.info(yaml.dump(augmentedConfig));
logger.endGroup();
fs.writeFileSync(configLocation, yaml.dump(augmentedConfig));
return configLocation;
}