diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 03f16d8f4..3a73102e1 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -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) { diff --git a/lib/init-action.js b/lib/init-action.js index 2bec5c64c..e0b5b9ed1 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -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) { diff --git a/src/dependency-caching.test.ts b/src/dependency-caching.test.ts index 18b660d89..58aedf5b0 100644 --- a/src/dependency-caching.test.ts +++ b/src/dependency-caching.test.ts @@ -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), ); diff --git a/src/dependency-caching.ts b/src/dependency-caching.ts index 6af3bf21d..bf616fbc5 100644 --- a/src/dependency-caching.ts +++ b/src/dependency-caching.ts @@ -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 { 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) {