Skip to content

Commit a47d550

Browse files
committed
Restore earlier log messages for checkHashPatterns
1 parent b0e9dfc commit a47d550

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

lib/analyze-action.js

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

lib/init-action.js

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

src/dependency-caching.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ test("checkHashPatterns - logs when no patterns match", async (t) => {
130130
features,
131131
KnownLanguage.csharp,
132132
config,
133+
"download",
133134
getRecordingLogger(messages),
134135
);
135136

@@ -158,6 +159,7 @@ test("checkHashPatterns - returns patterns when patterns match", async (t) => {
158159
features,
159160
KnownLanguage.csharp,
160161
config,
162+
"upload",
161163
getRecordingLogger(messages),
162164
);
163165

src/dependency-caching.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export type DependencyCacheRestoreStatusReport = DependencyCacheRestoreStatus[];
201201
* @param features Information about which FFs are enabled.
202202
* @param language The language the `CacheConfig` is for. For use in the log message.
203203
* @param cacheConfig The caching configuration to call `getHashPatterns` on.
204+
* @param checkType Whether we are checking the patterns for a download or upload.
204205
* @param logger The logger to write the log message to if there is an error.
205206
* @returns An array of glob patterns to use for hashing files, or `undefined` if there are no matching files.
206207
*/
@@ -209,13 +210,14 @@ export async function checkHashPatterns(
209210
features: FeatureEnablement,
210211
language: Language,
211212
cacheConfig: CacheConfig,
213+
checkType: "download" | "upload",
212214
logger: Logger,
213215
): Promise<string[] | undefined> {
214216
const patterns = await cacheConfig.getHashPatterns(codeql, features);
215217

216218
if (patterns === undefined) {
217219
logger.info(
218-
`Skipping download of dependency cache for ${language} as we cannot calculate a hash for the cache key.`,
220+
`Skipping ${checkType} of dependency cache for ${language} as we cannot calculate a hash for the cache key.`,
219221
);
220222
}
221223

@@ -257,6 +259,7 @@ export async function downloadDependencyCaches(
257259
features,
258260
language,
259261
cacheConfig,
262+
"download",
260263
logger,
261264
);
262265
if (patterns === undefined) {
@@ -354,6 +357,7 @@ export async function uploadDependencyCaches(
354357
features,
355358
language,
356359
cacheConfig,
360+
"upload",
357361
logger,
358362
);
359363
if (patterns === undefined) {

0 commit comments

Comments
 (0)