Include base database OIDs when bundling database

This commit is contained in:
Henry Mercer
2026-01-09 18:58:32 +00:00
parent d6efb85cdf
commit d32cd4ddde
12 changed files with 156 additions and 43 deletions
+13 -1
View File
@@ -16,6 +16,12 @@ import { EnvVar } from "./environment";
import { Language } from "./languages";
import { Logger } from "./logging";
/**
* The name of the file containing the base database OIDs, as stored in the
* root of the database location.
*/
const BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json";
/**
* Specifies bundle versions that are known to be broken
* and will not be used if found in the toolcache.
@@ -728,6 +734,10 @@ export async function codeQlVersionAtLeast(
return semver.gte((await codeql.getVersion()).version, requiredVersion);
}
export function getBaseDatabaseOidsFilePath(config: Config): string {
return path.join(config.dbLocation, BASE_DATABASE_OIDS_FILE_NAME);
}
// Create a bundle for the given DB, if it doesn't already exist
export async function bundleDb(
config: Config,
@@ -745,7 +755,9 @@ export async function bundleDb(
if (fs.existsSync(databaseBundlePath)) {
await fs.promises.rm(databaseBundlePath, { force: true });
}
await codeql.databaseBundle(databasePath, databaseBundlePath, dbName);
await codeql.databaseBundle(databasePath, databaseBundlePath, dbName, [
BASE_DATABASE_OIDS_FILE_NAME,
]);
return databaseBundlePath;
}