Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fede016

Browse files
committed
Add some debugging information
1 parent eb19ecb commit fede016

File tree

6 files changed

+58
-40
lines changed

6 files changed

+58
-40
lines changed

lib/config-utils.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js

Lines changed: 19 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/util.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ export async function getRawLanguages(
973973
} else {
974974
autodetected = true;
975975

976-
// Obtain languages as all languages in the repo that can be analysed
976+
// Obtain all languages in the repo that can be analysed
977977
rawLanguages = (await getLanguagesInRepo(repository, logger)) as string[];
978978
}
979979
return { rawLanguages, autodetected };

src/util.ts

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,18 @@ export async function shouldBypassToolcache(
851851
repository: RepositoryNwo,
852852
logger: Logger
853853
): Promise<boolean> {
854+
// Remove this before merging #1394
855+
logger.debug(
856+
`Feature Flag BypassToolcacheKotlinSwiftEnabled: ${await featuresEnablement.getValue(
857+
Feature.BypassToolcacheKotlinSwiftEnabled
858+
)}`
859+
);
860+
logger.debug(
861+
`Feature Flag BypassToolcacheEnabled: ${await featuresEnablement.getValue(
862+
Feature.BypassToolcacheEnabled
863+
)}`
864+
);
865+
854866
// An explicit codeql url is specified, that means the toolcache will not be used.
855867
if (codeqlUrl) {
856868
return true;
@@ -861,30 +873,33 @@ export async function shouldBypassToolcache(
861873
return true;
862874
}
863875

864-
let bypass = false;
865876
// Check if the toolcache is disabled for kotlin and swift.
866877
if (
867-
await featuresEnablement.getValue(Feature.BypassToolcacheKotlinSwiftEnabled)
878+
!(await featuresEnablement.getValue(
879+
Feature.BypassToolcacheKotlinSwiftEnabled
880+
))
868881
) {
869-
// Now check to see if kotlin or swift is one of the languages being analyzed.
870-
const { rawLanguages, autodetected } = await getRawLanguages(
871-
languagesInput,
872-
repository,
873-
logger
882+
return false;
883+
}
884+
885+
// Now check to see if kotlin or swift is one of the languages being analyzed.
886+
const { rawLanguages, autodetected } = await getRawLanguages(
887+
languagesInput,
888+
repository,
889+
logger
890+
);
891+
let bypass = rawLanguages.some((lang) => KOTLIN_SWIFT_BYPASS.includes(lang));
892+
if (bypass) {
893+
logger.info(
894+
`Bypassing toolcache for kotlin or swift. Languages: ${rawLanguages}`
874895
);
875-
bypass = rawLanguages.some((lang) => KOTLIN_SWIFT_BYPASS.includes(lang));
876-
if (bypass) {
877-
logger.info(
878-
`Bypassing toolcache for kotlin or swift. Languages: ${rawLanguages}`
879-
);
880-
} else if (!autodetected && rawLanguages.includes(Language.java)) {
881-
// special case: java was explicitly specified, but there might be
882-
// some kotlin in the repository, so we need to make a request for that.
883-
const langsInRepo = await getLanguagesInRepo(repository, logger);
884-
if (langsInRepo.includes("kotlin")) {
885-
logger.info(`Bypassing toolcache for kotlin.`);
886-
bypass = true;
887-
}
896+
} else if (!autodetected && rawLanguages.includes(Language.java)) {
897+
// special case: java was explicitly specified, but there might be
898+
// some kotlin in the repository, so we need to make a request for that.
899+
const langsInRepo = await getLanguagesInRepo(repository, logger);
900+
if (langsInRepo.includes("kotlin")) {
901+
logger.info(`Bypassing toolcache for kotlin.`);
902+
bypass = true;
888903
}
889904
}
890905
return bypass;

0 commit comments

Comments
 (0)