mirror of
https://github.com/github/codeql-action.git
synced 2025-12-31 19:50:32 +08:00
Merge branch 'main' into update-supported-enterprise-server-versions
This commit is contained in:
@@ -42,6 +42,13 @@ export class CodeQLAnalysisError extends Error {
|
||||
}
|
||||
|
||||
export interface QueriesStatusReport {
|
||||
/**
|
||||
* Time taken in ms to run queries for actions (or undefined if this language was not analyzed).
|
||||
*
|
||||
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
|
||||
* taken to run _all_ the queries.
|
||||
*/
|
||||
analyze_builtin_queries_actions_duration_ms?: number;
|
||||
/**
|
||||
* Time taken in ms to run queries for cpp (or undefined if this language was not analyzed).
|
||||
*
|
||||
@@ -98,6 +105,8 @@ export interface QueriesStatusReport {
|
||||
*/
|
||||
analyze_builtin_queries_swift_duration_ms?: number;
|
||||
|
||||
/** Time taken in ms to interpret results for actions (or undefined if this language was not analyzed). */
|
||||
interpret_results_actions_duration_ms?: number;
|
||||
/** Time taken in ms to interpret results for cpp (or undefined if this language was not analyzed). */
|
||||
interpret_results_cpp_duration_ms?: number;
|
||||
/** Time taken in ms to interpret results for csharp (or undefined if this language was not analyzed). */
|
||||
@@ -498,7 +507,13 @@ function writeDiffRangeDataExtensionPack(
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
"pr-diff-range",
|
||||
);
|
||||
fs.mkdirSync(diffRangeDir);
|
||||
|
||||
// We expect the Actions temporary directory to already exist, so are mainly
|
||||
// using `recursive: true` to avoid errors if the directory already exists,
|
||||
// for example if the analyze Action is run multiple times in the same job.
|
||||
// This is not really something that is supported, but we make use of it in
|
||||
// tests.
|
||||
fs.mkdirSync(diffRangeDir, { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(diffRangeDir, "qlpack.yml"),
|
||||
`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"bundleVersion": "codeql-bundle-v2.21.0",
|
||||
"cliVersion": "2.21.0",
|
||||
"priorBundleVersion": "codeql-bundle-v2.20.7",
|
||||
"priorCliVersion": "2.20.7"
|
||||
"bundleVersion": "codeql-bundle-v2.21.2",
|
||||
"cliVersion": "2.21.2",
|
||||
"priorBundleVersion": "codeql-bundle-v2.21.1",
|
||||
"priorCliVersion": "2.21.1"
|
||||
}
|
||||
|
||||
@@ -41,42 +41,44 @@ export function getJavaTempDependencyDir(): string {
|
||||
/**
|
||||
* Default caching configurations per language.
|
||||
*/
|
||||
const CODEQL_DEFAULT_CACHE_CONFIG: { [language: string]: CacheConfig } = {
|
||||
java: {
|
||||
paths: [
|
||||
// Maven
|
||||
join(os.homedir(), ".m2", "repository"),
|
||||
// Gradle
|
||||
join(os.homedir(), ".gradle", "caches"),
|
||||
// CodeQL Java build-mode: none
|
||||
getJavaTempDependencyDir(),
|
||||
],
|
||||
hash: [
|
||||
// Maven
|
||||
"**/pom.xml",
|
||||
// Gradle
|
||||
"**/*.gradle*",
|
||||
"**/gradle-wrapper.properties",
|
||||
"buildSrc/**/Versions.kt",
|
||||
"buildSrc/**/Dependencies.kt",
|
||||
"gradle/*.versions.toml",
|
||||
"**/versions.properties",
|
||||
],
|
||||
},
|
||||
csharp: {
|
||||
paths: [join(os.homedir(), ".nuget", "packages")],
|
||||
hash: [
|
||||
// NuGet
|
||||
"**/packages.lock.json",
|
||||
// Paket
|
||||
"**/paket.lock",
|
||||
],
|
||||
},
|
||||
go: {
|
||||
paths: [join(os.homedir(), "go", "pkg", "mod")],
|
||||
hash: ["**/go.sum"],
|
||||
},
|
||||
};
|
||||
function getDefaultCacheConfig(): { [language: string]: CacheConfig } {
|
||||
return {
|
||||
java: {
|
||||
paths: [
|
||||
// Maven
|
||||
join(os.homedir(), ".m2", "repository"),
|
||||
// Gradle
|
||||
join(os.homedir(), ".gradle", "caches"),
|
||||
// CodeQL Java build-mode: none
|
||||
getJavaTempDependencyDir(),
|
||||
],
|
||||
hash: [
|
||||
// Maven
|
||||
"**/pom.xml",
|
||||
// Gradle
|
||||
"**/*.gradle*",
|
||||
"**/gradle-wrapper.properties",
|
||||
"buildSrc/**/Versions.kt",
|
||||
"buildSrc/**/Dependencies.kt",
|
||||
"gradle/*.versions.toml",
|
||||
"**/versions.properties",
|
||||
],
|
||||
},
|
||||
csharp: {
|
||||
paths: [join(os.homedir(), ".nuget", "packages")],
|
||||
hash: [
|
||||
// NuGet
|
||||
"**/packages.lock.json",
|
||||
// Paket
|
||||
"**/paket.lock",
|
||||
],
|
||||
},
|
||||
go: {
|
||||
paths: [join(os.homedir(), "go", "pkg", "mod")],
|
||||
hash: ["**/go.sum"],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
async function makeGlobber(patterns: string[]): Promise<glob.Globber> {
|
||||
return glob.create(patterns.join("\n"));
|
||||
@@ -96,7 +98,7 @@ export async function downloadDependencyCaches(
|
||||
const restoredCaches: Language[] = [];
|
||||
|
||||
for (const language of languages) {
|
||||
const cacheConfig = CODEQL_DEFAULT_CACHE_CONFIG[language];
|
||||
const cacheConfig = getDefaultCacheConfig()[language];
|
||||
|
||||
if (cacheConfig === undefined) {
|
||||
logger.info(
|
||||
@@ -150,7 +152,7 @@ export async function downloadDependencyCaches(
|
||||
*/
|
||||
export async function uploadDependencyCaches(config: Config, logger: Logger) {
|
||||
for (const language of config.languages) {
|
||||
const cacheConfig = CODEQL_DEFAULT_CACHE_CONFIG[language];
|
||||
const cacheConfig = getDefaultCacheConfig()[language];
|
||||
|
||||
if (cacheConfig === undefined) {
|
||||
logger.info(
|
||||
|
||||
@@ -11,9 +11,9 @@ import { Credential, getCredentials } from "./start-proxy";
|
||||
import * as util from "./util";
|
||||
|
||||
const UPDATEJOB_PROXY = "update-job-proxy";
|
||||
const UPDATEJOB_PROXY_VERSION = "v2.0.20241023203727";
|
||||
const UPDATEJOB_PROXY_VERSION = "v2.0.20250424171100";
|
||||
const UPDATEJOB_PROXY_URL_PREFIX =
|
||||
"https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.18.1/";
|
||||
"https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.21.1/";
|
||||
const KEY_SIZE = 2048;
|
||||
const KEY_EXPIRY_YEARS = 2;
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ const LANGUAGE_TO_REGISTRY_TYPE: Record<Language, string> = {
|
||||
python: "python_index",
|
||||
ruby: "rubygems_server",
|
||||
rust: "cargo_registry",
|
||||
go: "goproxy_server",
|
||||
// We do not have an established proxy type for these languages, thus leaving empty.
|
||||
actions: "",
|
||||
cpp: "",
|
||||
go: "",
|
||||
swift: "",
|
||||
} as const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user