mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Include diagnostics in bundle
This commit is contained in:
@@ -160,6 +160,7 @@ export interface CodeQL {
|
||||
databasePath: string,
|
||||
outputFilePath: string,
|
||||
dbName: string,
|
||||
includeDiagnostics: boolean,
|
||||
alsoIncludeRelativePaths: string[],
|
||||
): Promise<void>;
|
||||
/**
|
||||
@@ -912,15 +913,22 @@ async function getCodeQLForCmd(
|
||||
databasePath: string,
|
||||
outputFilePath: string,
|
||||
databaseName: string,
|
||||
includeDiagnostics: boolean,
|
||||
alsoIncludeRelativePaths: string[],
|
||||
): Promise<void> {
|
||||
const includeDiagnosticsArgs = includeDiagnostics
|
||||
? ["--include-diagnostics"]
|
||||
: [];
|
||||
const args = [
|
||||
"database",
|
||||
"bundle",
|
||||
databasePath,
|
||||
`--output=${outputFilePath}`,
|
||||
`--name=${databaseName}`,
|
||||
...getExtraOptionsFromEnv(["database", "bundle"]),
|
||||
...includeDiagnosticsArgs,
|
||||
...getExtraOptionsFromEnv(["database", "bundle"], {
|
||||
ignoringOptions: includeDiagnosticsArgs,
|
||||
}),
|
||||
];
|
||||
if (
|
||||
await this.supportsFeature(ToolsFeature.BundleSupportsIncludeOption)
|
||||
|
||||
@@ -101,7 +101,9 @@ export async function cleanupAndUploadDatabases(
|
||||
// Although we are uploading arbitrary file contents to the API, it's worth
|
||||
// noting that it's the API's job to validate that the contents is acceptable.
|
||||
// This API method is available to anyone with write access to the repo.
|
||||
const bundledDb = await bundleDb(config, language, codeql, language);
|
||||
const bundledDb = await bundleDb(config, language, codeql, language, {
|
||||
includeDiagnostics: false,
|
||||
});
|
||||
bundledDbSize = fs.statSync(bundledDb).size;
|
||||
const bundledDbReadStream = fs.createReadStream(bundledDb);
|
||||
const commitOid = await gitUtils.getCommitOid(
|
||||
|
||||
@@ -429,6 +429,7 @@ async function createDatabaseBundleCli(
|
||||
language,
|
||||
codeql,
|
||||
`${config.debugDatabaseName}-${language}`,
|
||||
{ includeDiagnostics: true },
|
||||
);
|
||||
return databaseBundlePath;
|
||||
}
|
||||
|
||||
@@ -744,6 +744,7 @@ export async function bundleDb(
|
||||
language: Language,
|
||||
codeql: CodeQL,
|
||||
dbName: string,
|
||||
{ includeDiagnostics }: { includeDiagnostics: boolean },
|
||||
) {
|
||||
const databasePath = getCodeQLDatabasePath(config, language);
|
||||
const databaseBundlePath = path.resolve(config.dbLocation, `${dbName}.zip`);
|
||||
@@ -774,6 +775,7 @@ export async function bundleDb(
|
||||
databasePath,
|
||||
databaseBundlePath,
|
||||
dbName,
|
||||
includeDiagnostics,
|
||||
additionalFiles,
|
||||
);
|
||||
return databaseBundlePath;
|
||||
|
||||
Reference in New Issue
Block a user