Apply suggestions from code review

Co-authored-by: Henry Mercer <henrymercer@github.com>
This commit is contained in:
Nick Fyson 2024-04-03 17:07:14 +01:00 committed by nickfyson
parent 6514cbb626
commit 2cc8bbd0e0
6 changed files with 14 additions and 14 deletions

View file

@ -259,7 +259,7 @@ export async function addFingerprints(
sourceRoot: string,
logger: Logger,
): Promise<SarifFile> {
logger.info(`Adding fingerprints to SARIF file`);
logger.info("Adding fingerprints to SARIF file. For more information, see https://docs.github.com/en/enterprise-cloud@latest/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#providing-data-to-track-code-scanning-alerts-across-runs");
// Gather together results for the same file and construct
// callbacks to accept hashes for that file and update the location
const callbacksByFile: { [filename: string]: hashCallback[] } = {};

View file

@ -88,7 +88,7 @@ async function combineSarifFilesUsingCLI(
features: Features,
logger: Logger,
): Promise<SarifFile> {
logger.info(`Combining sarif files using CLI`);
logger.info("Combining SARIF files using the CodeQL CLI");
if (sarifFiles.length === 1) {
return JSON.parse(fs.readFileSync(sarifFiles[0], "utf8")) as SarifFile;
}
@ -420,7 +420,7 @@ export function buildPayload(
mergeBaseCommitOid: string | undefined,
logger: Logger,
) {
logger.info(`Combining sarif files using CLI`);
logger.info(`Combining SARIF files using CLI`);
const payloadObj = {
commit_oid: commitOid,
ref,
@ -514,11 +514,11 @@ async function uploadFiles(
const toolNames = util.getToolNames(sarif);
logger.debug(`Validating unique category in sarif`);
logger.debug(`Validating that each SARIF run has a unique category`);
validateUniqueCategory(sarif);
logger.debug(`Stringifying sarif for upload`);
logger.debug(`Serializing SARIF for upload`);
const sarifPayload = JSON.stringify(sarif);
logger.debug(`Compressing sarif payload`);
logger.debug(`Compressing serialized SARIF`);
const zippedSarif = zlib.gzipSync(sarifPayload).toString("base64");
const checkoutURI = fileUrl(sourceRoot);