Skip to content

Commit 4885eb2

Browse files
committed
Insert new featurePrefix after general cache key prefix
1 parent a47d550 commit 4885eb2

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

lib/analyze-action.js

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

lib/init-action.js

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

src/dependency-caching.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,14 @@ async function cachePrefix(
524524
// experimental features that affect the cache contents.
525525
const featurePrefix = await getFeaturePrefix(codeql, features, language);
526526

527-
// Assemble the cache key.
528-
return `${featurePrefix}${prefix}-${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`;
527+
// Assemble the cache key. For backwards compatibility with the JAR minification experiment's existing
528+
// feature prefix usage, we add that feature prefix at the start. Other feature prefixes are inserted
529+
// after the general CodeQL dependency cache prefix.
530+
if (featurePrefix === "minify-") {
531+
return `${featurePrefix}${prefix}-${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`;
532+
} else {
533+
return `${prefix}-${featurePrefix}${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`;
534+
}
529535
}
530536

531537
/** Represents information about our overall cache usage for CodeQL dependency caches. */

0 commit comments

Comments
 (0)