Restore earlier log messages for checkHashPatterns

This commit is contained in:
Michael B. Gale
2025-11-09 11:11:10 +00:00
parent b0e9dfce55
commit a47d5507cf
4 changed files with 13 additions and 5 deletions
+3 -2
View File
@@ -91123,11 +91123,11 @@ var defaultCacheConfigs = {
async function makeGlobber(patterns) {
return glob.create(patterns.join("\n"));
}
async function checkHashPatterns(codeql, features, language, cacheConfig, logger) {
async function checkHashPatterns(codeql, features, language, cacheConfig, checkType, logger) {
const patterns = await cacheConfig.getHashPatterns(codeql, features);
if (patterns === void 0) {
logger.info(
`Skipping download of dependency cache for ${language} as we cannot calculate a hash for the cache key.`
`Skipping ${checkType} of dependency cache for ${language} as we cannot calculate a hash for the cache key.`
);
}
return patterns;
@@ -91147,6 +91147,7 @@ async function uploadDependencyCaches(codeql, features, config, logger) {
features,
language,
cacheConfig,
"upload",
logger
);
if (patterns === void 0) {
+3 -2
View File
@@ -87310,11 +87310,11 @@ var defaultCacheConfigs = {
async function makeGlobber(patterns) {
return glob.create(patterns.join("\n"));
}
async function checkHashPatterns(codeql, features, language, cacheConfig, logger) {
async function checkHashPatterns(codeql, features, language, cacheConfig, checkType, logger) {
const patterns = await cacheConfig.getHashPatterns(codeql, features);
if (patterns === void 0) {
logger.info(
`Skipping download of dependency cache for ${language} as we cannot calculate a hash for the cache key.`
`Skipping ${checkType} of dependency cache for ${language} as we cannot calculate a hash for the cache key.`
);
}
return patterns;
@@ -87334,6 +87334,7 @@ async function downloadDependencyCaches(codeql, features, languages, logger) {
features,
language,
cacheConfig,
"download",
logger
);
if (patterns === void 0) {
+2
View File
@@ -130,6 +130,7 @@ test("checkHashPatterns - logs when no patterns match", async (t) => {
features,
KnownLanguage.csharp,
config,
"download",
getRecordingLogger(messages),
);
@@ -158,6 +159,7 @@ test("checkHashPatterns - returns patterns when patterns match", async (t) => {
features,
KnownLanguage.csharp,
config,
"upload",
getRecordingLogger(messages),
);
+5 -1
View File
@@ -201,6 +201,7 @@ export type DependencyCacheRestoreStatusReport = DependencyCacheRestoreStatus[];
* @param features Information about which FFs are enabled.
* @param language The language the `CacheConfig` is for. For use in the log message.
* @param cacheConfig The caching configuration to call `getHashPatterns` on.
* @param checkType Whether we are checking the patterns for a download or upload.
* @param logger The logger to write the log message to if there is an error.
* @returns An array of glob patterns to use for hashing files, or `undefined` if there are no matching files.
*/
@@ -209,13 +210,14 @@ export async function checkHashPatterns(
features: FeatureEnablement,
language: Language,
cacheConfig: CacheConfig,
checkType: "download" | "upload",
logger: Logger,
): Promise<string[] | undefined> {
const patterns = await cacheConfig.getHashPatterns(codeql, features);
if (patterns === undefined) {
logger.info(
`Skipping download of dependency cache for ${language} as we cannot calculate a hash for the cache key.`,
`Skipping ${checkType} of dependency cache for ${language} as we cannot calculate a hash for the cache key.`,
);
}
@@ -257,6 +259,7 @@ export async function downloadDependencyCaches(
features,
language,
cacheConfig,
"download",
logger,
);
if (patterns === undefined) {
@@ -354,6 +357,7 @@ export async function uploadDependencyCaches(
features,
language,
cacheConfig,
"upload",
logger,
);
if (patterns === undefined) {