Fix broken log grouping due to nested log group

This commit is contained in:
Henry Mercer
2026-06-05 12:53:01 +01:00
parent 9fc351a8ac
commit 99576d59b9
2 changed files with 19 additions and 21 deletions

19
lib/entry-points.js generated
View File

@@ -150962,16 +150962,14 @@ async function prepareDiffInformedAnalysis(codeql, features, logger) {
if (!branches) {
return false;
}
return await withGroupAsync("Computing PR diff ranges", async () => {
try {
return await computeAndPersistDiffRanges(branches, logger);
} catch (e) {
logger.warning(
`Failed to compute diff-informed analysis ranges: ${getErrorMessage(e)}`
);
return false;
}
});
try {
return await computeAndPersistDiffRanges(branches, logger);
} catch (e) {
logger.warning(
`Failed to compute diff-informed analysis ranges: ${getErrorMessage(e)}`
);
return false;
}
}
function writeDiffRangesJsonFile(logger, ranges) {
const jsonContents = JSON.stringify(ranges, null, 2);
@@ -151024,6 +151022,7 @@ async function getPullRequestEditedDiffRanges(branches, logger) {
return results;
}
async function computeAndPersistDiffRanges(branches, logger) {
logger.info("Computing PR diff ranges...");
const ranges = await getPullRequestEditedDiffRanges(branches, logger);
if (ranges === void 0) {
return false;

View File

@@ -5,7 +5,7 @@ import type { PullRequestBranches } from "./actions-util";
import { getApiClient, getGitHubVersion } from "./api-client";
import type { CodeQL } from "./codeql";
import { Feature, FeatureEnablement } from "./feature-flags";
import { Logger, withGroupAsync } from "./logging";
import { Logger } from "./logging";
import { getRepositoryNwoFromEnv } from "./repository";
import { getErrorMessage, GitHubVariant, satisfiesGHESVersion } from "./util";
@@ -83,16 +83,14 @@ export async function prepareDiffInformedAnalysis(
return false;
}
return await withGroupAsync("Computing PR diff ranges", async () => {
try {
return await computeAndPersistDiffRanges(branches, logger);
} catch (e) {
logger.warning(
`Failed to compute diff-informed analysis ranges: ${getErrorMessage(e)}`,
);
return false;
}
});
try {
return await computeAndPersistDiffRanges(branches, logger);
} catch (e) {
logger.warning(
`Failed to compute diff-informed analysis ranges: ${getErrorMessage(e)}`,
);
return false;
}
}
export interface DiffThunkRange {
@@ -192,6 +190,7 @@ export async function computeAndPersistDiffRanges(
branches: PullRequestBranches,
logger: Logger,
): Promise<boolean> {
logger.info("Computing PR diff ranges...");
const ranges = await getPullRequestEditedDiffRanges(branches, logger);
if (ranges === undefined) {
return false;