Add API call for languages if java in input
If a user explicitly includes java in their language inputs, always make an api call to check for kotlin in the repo. Also, add some suggestions from code reviews.
This commit is contained in:
parent
ad7ca9bf21
commit
eb19ecbad1
12 changed files with 112 additions and 92 deletions
17
lib/util.js
generated
17
lib/util.js
generated
|
|
@ -728,17 +728,26 @@ async function shouldBypassToolcache(featuresEnablement, codeqlUrl, languagesInp
|
|||
if (await featuresEnablement.getValue(feature_flags_1.Feature.BypassToolcacheEnabled)) {
|
||||
return true;
|
||||
}
|
||||
let bypass = false;
|
||||
// Check if the toolcache is disabled for kotlin and swift.
|
||||
if (await featuresEnablement.getValue(feature_flags_1.Feature.BypassToolcacheKotlinSwiftEnabled)) {
|
||||
// Now check to see if kotlin or swift is one of the languages being analyzed.
|
||||
const { rawLanguages } = await (0, config_utils_1.getRawLanguages)(languagesInput, repository, logger);
|
||||
const bypass = rawLanguages.some((lang) => languages_1.KOTLIN_SWIFT_BYPASS.includes(lang));
|
||||
const { rawLanguages, autodetected } = await (0, config_utils_1.getRawLanguages)(languagesInput, repository, logger);
|
||||
bypass = rawLanguages.some((lang) => languages_1.KOTLIN_SWIFT_BYPASS.includes(lang));
|
||||
if (bypass) {
|
||||
logger.info(`Bypassing toolcache for kotlin or swift. Languages: ${rawLanguages}`);
|
||||
}
|
||||
return bypass;
|
||||
else if (!autodetected && rawLanguages.includes(languages_1.Language.java)) {
|
||||
// special case: java was explicitly specified, but there might be
|
||||
// some kotlin in the repository, so we need to make a request for that.
|
||||
const langsInRepo = await (0, config_utils_1.getLanguagesInRepo)(repository, logger);
|
||||
if (langsInRepo.includes("kotlin")) {
|
||||
logger.info(`Bypassing toolcache for kotlin.`);
|
||||
bypass = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return bypass;
|
||||
}
|
||||
exports.shouldBypassToolcache = shouldBypassToolcache;
|
||||
//# sourceMappingURL=util.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue