Rename secondary run to uploadFailureInfo

This commit is contained in:
Michael B. Gale
2026-02-24 16:31:39 +00:00
parent b0ed4dedcb
commit 0f3e632580
4 changed files with 66 additions and 52 deletions
+43 -43
View File
@@ -46427,7 +46427,7 @@ var require_light = __commonJS({
}
return this.Events.trigger("scheduled", { args: this.args, options: this.options });
}
async doExecute(chained, clearGlobalState, run3, free) {
async doExecute(chained, clearGlobalState, run2, free) {
var error3, eventInfo, passed;
if (this.retryCount === 0) {
this._assertStatus("RUNNING");
@@ -46447,10 +46447,10 @@ var require_light = __commonJS({
}
} catch (error1) {
error3 = error1;
return this._onFailure(error3, eventInfo, clearGlobalState, run3, free);
return this._onFailure(error3, eventInfo, clearGlobalState, run2, free);
}
}
doExpire(clearGlobalState, run3, free) {
doExpire(clearGlobalState, run2, free) {
var error3, eventInfo;
if (this._states.jobStatus(this.options.id === "RUNNING")) {
this._states.next(this.options.id);
@@ -46458,9 +46458,9 @@ var require_light = __commonJS({
this._assertStatus("EXECUTING");
eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount };
error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`);
return this._onFailure(error3, eventInfo, clearGlobalState, run3, free);
return this._onFailure(error3, eventInfo, clearGlobalState, run2, free);
}
async _onFailure(error3, eventInfo, clearGlobalState, run3, free) {
async _onFailure(error3, eventInfo, clearGlobalState, run2, free) {
var retry2, retryAfter;
if (clearGlobalState()) {
retry2 = await this.Events.trigger("failed", error3, eventInfo);
@@ -46468,7 +46468,7 @@ var require_light = __commonJS({
retryAfter = ~~retry2;
this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo);
this.retryCount++;
return run3(retryAfter);
return run2(retryAfter);
} else {
this.doDone(eventInfo);
await free(this.options, eventInfo);
@@ -47106,17 +47106,17 @@ var require_light = __commonJS({
}
}
_run(index, job, wait) {
var clearGlobalState, free, run3;
var clearGlobalState, free, run2;
job.doRun();
clearGlobalState = this._clearGlobalState.bind(this, index);
run3 = this._run.bind(this, index, job);
run2 = this._run.bind(this, index, job);
free = this._free.bind(this, index, job);
return this._scheduled[index] = {
timeout: setTimeout(() => {
return job.doExecute(this._limiter, clearGlobalState, run3, free);
return job.doExecute(this._limiter, clearGlobalState, run2, free);
}, wait),
expiration: job.options.expiration != null ? setTimeout(function() {
return job.doExpire(clearGlobalState, run3, free);
return job.doExpire(clearGlobalState, run2, free);
}, wait + job.options.expiration) : void 0,
job
};
@@ -104471,8 +104471,8 @@ var require_async = __commonJS({
return callback(null, results);
}
while (readyTasks.length && runningTasks < concurrency) {
var run3 = readyTasks.shift();
run3();
var run2 = readyTasks.shift();
run2();
}
}
function addListener(taskName, fn) {
@@ -163563,8 +163563,8 @@ function getExtraOptionsEnvParam() {
}
function getToolNames(sarif) {
const toolNames = {};
for (const run3 of sarif.runs || []) {
const tool = run3.tool || {};
for (const run2 of sarif.runs || []) {
const tool = run2.tool || {};
const driver = tool.driver || {};
if (typeof driver.name === "string" && driver.name.length > 0) {
toolNames[driver.name] = true;
@@ -168940,9 +168940,9 @@ async function addFingerprints(sarif, sourceRoot, logger) {
`Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.`
);
const callbacksByFile = {};
for (const run3 of sarif.runs || []) {
const artifacts = run3.artifacts || [];
for (const result of run3.results || []) {
for (const run2 of sarif.runs || []) {
const artifacts = run2.artifacts || [];
for (const result of run2.results || []) {
const primaryLocation = (result.locations || [])[0];
if (!primaryLocation?.physicalLocation?.artifactLocation) {
logger.debug(
@@ -169043,25 +169043,25 @@ function combineSarifFiles(sarifFiles, logger) {
function areAllRunsProducedByCodeQL(sarifObjects) {
return sarifObjects.every((sarifObject) => {
return sarifObject.runs?.every(
(run3) => run3.tool?.driver?.name === "CodeQL"
(run2) => run2.tool?.driver?.name === "CodeQL"
);
});
}
function createRunKey(run3) {
function createRunKey(run2) {
return {
name: run3.tool?.driver?.name,
fullName: run3.tool?.driver?.fullName,
version: run3.tool?.driver?.version,
semanticVersion: run3.tool?.driver?.semanticVersion,
guid: run3.tool?.driver?.guid,
automationId: run3.automationDetails?.id
name: run2.tool?.driver?.name,
fullName: run2.tool?.driver?.fullName,
version: run2.tool?.driver?.version,
semanticVersion: run2.tool?.driver?.semanticVersion,
guid: run2.tool?.driver?.guid,
automationId: run2.automationDetails?.id
};
}
function areAllRunsUnique(sarifObjects) {
const keys = /* @__PURE__ */ new Set();
for (const sarifObject of sarifObjects) {
for (const run3 of sarifObject.runs) {
const key = JSON.stringify(createRunKey(run3));
for (const run2 of sarifObject.runs) {
const key = JSON.stringify(createRunKey(run2));
if (keys.has(key)) {
return false;
}
@@ -169164,9 +169164,9 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
function populateRunAutomationDetails(sarif, category, analysis_key, environment) {
const automationID = getAutomationID2(category, analysis_key, environment);
if (automationID !== void 0) {
for (const run3 of sarif.runs || []) {
if (run3.automationDetails === void 0) {
run3.automationDetails = {
for (const run2 of sarif.runs || []) {
if (run2.automationDetails === void 0) {
run2.automationDetails = {
id: automationID
};
}
@@ -169265,13 +169265,13 @@ function countResultsInSarif(sarif) {
if (!Array.isArray(parsedSarif.runs)) {
throw new InvalidSarifUploadError("Invalid SARIF. Missing 'runs' array.");
}
for (const run3 of parsedSarif.runs) {
if (!Array.isArray(run3.results)) {
for (const run2 of parsedSarif.runs) {
if (!Array.isArray(run2.results)) {
throw new InvalidSarifUploadError(
"Invalid SARIF. Missing 'results' array in run."
);
}
numResults += run3.results.length;
numResults += run2.results.length;
}
return numResults;
}
@@ -169564,9 +169564,9 @@ function handleProcessingResultForUnsuccessfulExecution(response, status, logger
}
function validateUniqueCategory(sarif, sentinelPrefix) {
const categories = {};
for (const run3 of sarif.runs) {
const id = run3?.automationDetails?.id;
const tool = run3.tool?.driver?.name;
for (const run2 of sarif.runs) {
const id = run2?.automationDetails?.id;
const tool = run2.tool?.driver?.name;
const category = `${sanitize(id)}_${sanitize(tool)}`;
categories[category] = { id, tool };
}
@@ -169591,9 +169591,9 @@ function filterAlertsByDiffRange(logger, sarif) {
return sarif;
}
const checkoutPath = getRequiredInput("checkout_path");
for (const run3 of sarif.runs) {
if (run3.results) {
run3.results = run3.results.filter((result) => {
for (const run2 of sarif.runs) {
if (run2.results) {
run2.results = run2.results.filter((result) => {
const locations = [
...(result.locations || []).map((loc) => loc.physicalLocation),
...(result.relatedLocations || []).map((loc) => loc.physicalLocation)
@@ -169820,7 +169820,7 @@ async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger
return createFailedUploadFailedSarifResult(e);
}
}
async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, config, repositoryNwo, features, logger) {
async function uploadFailureInfo(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, config, repositoryNwo, features, logger) {
await recordOverlayStatus(codeql, config, features, logger);
const uploadFailedSarifResult = await tryUploadSarifIfRunFailed(
config,
@@ -170205,7 +170205,7 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error
}
// src/init-action-post.ts
async function run2(startedAt) {
async function run(startedAt) {
const logger = getActionsLogger();
let config;
let uploadFailedSarifResult;
@@ -170228,7 +170228,7 @@ async function run2(startedAt) {
);
} else {
const codeql = await getCodeQL(config.codeQLCmd);
uploadFailedSarifResult = await run(
uploadFailedSarifResult = await uploadFailureInfo(
tryUploadAllAvailableDebugArtifacts,
printDebugLogs,
codeql,
@@ -170312,7 +170312,7 @@ async function runWrapper() {
const startedAt = /* @__PURE__ */ new Date();
const logger = getActionsLogger();
try {
await run2(startedAt);
await run(startedAt);
} catch (error3) {
core16.setFailed(`init post action failed: ${wrapError(error3).message}`);
await sendUnhandledErrorStatusReport(