Add documentation for CacheConfig

This commit is contained in:
Michael B. Gale 2024-07-26 13:22:46 +01:00
parent 5afaeede1c
commit f0bcca1598
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
3 changed files with 16 additions and 1 deletions

View file

@ -10,14 +10,26 @@ import { Language } from "./languages";
import { Logger } from "./logging";
import { getRequiredEnvParam } from "./util";
/**
* Caching configuration for a particular language.
*/
interface CacheConfig {
/** The paths of directories on the runner that should be included in the cache. */
paths: string[];
/**
* Patterns for the paths of files whose contents affect which dependencies are used
* by a project. We find all files which match these patterns, calculate a hash for
* their contents, and use that hash as part of the cache key.
*/
hash: string[];
}
const CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies";
const CODEQL_DEPENDENCY_CACHE_VERSION = 1;
/**
* Default caching configurations per language.
*/
const CODEQL_DEFAULT_CACHE_CONFIG: { [language: string]: CacheConfig } = {
java: {
paths: [