mirror of
https://github.com/github/codeql-action.git
synced 2026-04-29 10:28:52 +00:00
Return keys of restored caches from downloadDependencyCaches
This commit is contained in:
Generated
+17
-7
@@ -87317,6 +87317,7 @@ async function checkHashPatterns(codeql, features, language, cacheConfig, checkT
|
||||
}
|
||||
async function downloadDependencyCaches(codeql, features, languages, logger) {
|
||||
const status = [];
|
||||
const restoredKeys = [];
|
||||
for (const language of languages) {
|
||||
const cacheConfig = defaultCacheConfigs[language];
|
||||
if (cacheConfig === void 0) {
|
||||
@@ -87355,14 +87356,22 @@ async function downloadDependencyCaches(codeql, features, languages, logger) {
|
||||
const download_duration_ms = Math.round(performance.now() - start);
|
||||
if (hitKey !== void 0) {
|
||||
logger.info(`Cache hit on key ${hitKey} for ${language}.`);
|
||||
const hit_kind = hitKey === primaryKey ? "exact" /* Exact */ : "partial" /* Partial */;
|
||||
status.push({ language, hit_kind, download_duration_ms });
|
||||
let hit_kind = "partial" /* Partial */;
|
||||
if (hitKey === primaryKey) {
|
||||
hit_kind = "exact" /* Exact */;
|
||||
}
|
||||
status.push({
|
||||
language,
|
||||
hit_kind,
|
||||
download_duration_ms
|
||||
});
|
||||
restoredKeys.push(hitKey);
|
||||
} else {
|
||||
status.push({ language, hit_kind: "miss" /* Miss */ });
|
||||
logger.info(`No suitable cache found for ${language}.`);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
return { statusReport: status, restoredKeys };
|
||||
}
|
||||
async function cacheKey2(codeql, features, language, patterns) {
|
||||
const hash = await glob.hashFiles(patterns.join("\n"));
|
||||
@@ -89994,7 +90003,7 @@ async function run() {
|
||||
return;
|
||||
}
|
||||
let overlayBaseDatabaseStats;
|
||||
let dependencyCachingResults;
|
||||
let dependencyCachingStatus;
|
||||
try {
|
||||
if (config.overlayDatabaseMode === "overlay" /* Overlay */ && config.useOverlayDatabaseCaching) {
|
||||
overlayBaseDatabaseStats = await downloadOverlayBaseDatabaseFromCache(
|
||||
@@ -90135,12 +90144,13 @@ exec ${goBinaryPath} "$@"`
|
||||
}
|
||||
}
|
||||
if (shouldRestoreCache(config.dependencyCachingEnabled)) {
|
||||
dependencyCachingResults = await downloadDependencyCaches(
|
||||
const dependencyCachingResult = await downloadDependencyCaches(
|
||||
codeql,
|
||||
features,
|
||||
config.languages,
|
||||
logger
|
||||
);
|
||||
dependencyCachingStatus = dependencyCachingResult.statusReport;
|
||||
}
|
||||
if (await codeQlVersionAtLeast(codeql, "2.17.1")) {
|
||||
} else {
|
||||
@@ -90241,7 +90251,7 @@ exec ${goBinaryPath} "$@"`
|
||||
toolsSource,
|
||||
toolsVersion,
|
||||
overlayBaseDatabaseStats,
|
||||
dependencyCachingResults,
|
||||
dependencyCachingStatus,
|
||||
logger,
|
||||
error4
|
||||
);
|
||||
@@ -90259,7 +90269,7 @@ exec ${goBinaryPath} "$@"`
|
||||
toolsSource,
|
||||
toolsVersion,
|
||||
overlayBaseDatabaseStats,
|
||||
dependencyCachingResults,
|
||||
dependencyCachingStatus,
|
||||
logger
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user