Audit core.warning/core.error usage (#269)

* Stop using command-based logs for warnings and errors

Co-authored-by: Cursor <cursoragent@cursor.com>

* revert

* tweak

* de-noise

* Remove redundant ts() timestamp prefix from log calls

* Restore timestamped logging and refine debug output routing.

Bring back timestamp prefixes for standard logs and make log.debug emit via core.debug when runner debug is enabled, while still surfacing debug lines for --debug runs.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
Co-authored-by: Colin McDonnell <colinmcd94@gmail.com>
This commit is contained in:
pullfrog[bot]
2026-02-19 23:11:47 +00:00
committed by pullfrog[bot]
parent 4ee1ae89a5
commit 70f1c47a28
20 changed files with 296 additions and 286 deletions
+69 -63
View File
@@ -399,7 +399,7 @@ var require_tunnel = __commonJS({
connectOptions.headers = connectOptions.headers || {};
connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64");
}
debug("making CONNECT request");
debug2("making CONNECT request");
var connectReq = self2.request(connectOptions);
connectReq.useChunkedEncodingByDefault = false;
connectReq.once("response", onResponse);
@@ -419,7 +419,7 @@ var require_tunnel = __commonJS({
connectReq.removeAllListeners();
socket.removeAllListeners();
if (res.statusCode !== 200) {
debug(
debug2(
"tunneling socket could not be established, statusCode=%d",
res.statusCode
);
@@ -431,7 +431,7 @@ var require_tunnel = __commonJS({
return;
}
if (head.length > 0) {
debug("got illegal response body from proxy");
debug2("got illegal response body from proxy");
socket.destroy();
var error2 = new Error("got illegal response body from proxy");
error2.code = "ECONNRESET";
@@ -439,13 +439,13 @@ var require_tunnel = __commonJS({
self2.removeSocket(placeholder);
return;
}
debug("tunneling connection has established");
debug2("tunneling connection has established");
self2.sockets[self2.sockets.indexOf(placeholder)] = socket;
return cb(socket);
}
function onError(cause) {
connectReq.removeAllListeners();
debug(
debug2(
"tunneling socket could not be established, cause=%s\n",
cause.message,
cause.stack
@@ -507,9 +507,9 @@ var require_tunnel = __commonJS({
}
return target;
}
var debug;
var debug2;
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
debug = function() {
debug2 = function() {
var args2 = Array.prototype.slice.call(arguments);
if (typeof args2[0] === "string") {
args2[0] = "TUNNEL: " + args2[0];
@@ -519,10 +519,10 @@ var require_tunnel = __commonJS({
console.error.apply(console, args2);
};
} else {
debug = function() {
debug2 = function() {
};
}
exports.debug = debug;
exports.debug = debug2;
}
});
@@ -19733,10 +19733,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
return process.env["RUNNER_DEBUG"] === "1";
}
exports.isDebug = isDebug2;
function debug(message) {
function debug2(message) {
(0, command_1.issueCommand)("debug", {}, message);
}
exports.debug = debug;
exports.debug = debug2;
function error2(message, properties = {}) {
(0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
}
@@ -26949,9 +26949,9 @@ var require_constants6 = __commonJS({
var require_debug = __commonJS({
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js"(exports, module) {
"use strict";
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args2) => console.error("SEMVER", ...args2) : () => {
var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args2) => console.error("SEMVER", ...args2) : () => {
};
module.exports = debug;
module.exports = debug2;
}
});
@@ -26964,7 +26964,7 @@ var require_re = __commonJS({
MAX_SAFE_BUILD_LENGTH,
MAX_LENGTH
} = require_constants6();
var debug = require_debug();
var debug2 = require_debug();
exports = module.exports = {};
var re = exports.re = [];
var safeRe = exports.safeRe = [];
@@ -26987,7 +26987,7 @@ var require_re = __commonJS({
var createToken = (name, value2, isGlobal) => {
const safe = makeSafeRegex(value2);
const index = R++;
debug(name, index, value2);
debug2(name, index, value2);
t[name] = index;
src[index] = value2;
safeSrc[index] = safe;
@@ -27091,7 +27091,7 @@ var require_identifiers = __commonJS({
var require_semver = __commonJS({
"node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js"(exports, module) {
"use strict";
var debug = require_debug();
var debug2 = require_debug();
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6();
var { safeRe: re, t } = require_re();
var parseOptions = require_parse_options();
@@ -27113,7 +27113,7 @@ var require_semver = __commonJS({
`version is longer than ${MAX_LENGTH} characters`
);
}
debug("SemVer", version, options);
debug2("SemVer", version, options);
this.options = options;
this.loose = !!options.loose;
this.includePrerelease = !!options.includePrerelease;
@@ -27161,7 +27161,7 @@ var require_semver = __commonJS({
return this.version;
}
compare(other) {
debug("SemVer.compare", this.version, this.options, other);
debug2("SemVer.compare", this.version, this.options, other);
if (!(other instanceof _SemVer)) {
if (typeof other === "string" && other === this.version) {
return 0;
@@ -27212,7 +27212,7 @@ var require_semver = __commonJS({
do {
const a = this.prerelease[i];
const b = other.prerelease[i];
debug("prerelease compare", i, a, b);
debug2("prerelease compare", i, a, b);
if (a === void 0 && b === void 0) {
return 0;
} else if (b === void 0) {
@@ -27234,7 +27234,7 @@ var require_semver = __commonJS({
do {
const a = this.build[i];
const b = other.build[i];
debug("build compare", i, a, b);
debug2("build compare", i, a, b);
if (a === void 0 && b === void 0) {
return 0;
} else if (b === void 0) {
@@ -27862,21 +27862,21 @@ var require_range = __commonJS({
const loose = this.options.loose;
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
range2 = range2.replace(hr, hyphenReplace(this.options.includePrerelease));
debug("hyphen replace", range2);
debug2("hyphen replace", range2);
range2 = range2.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
debug("comparator trim", range2);
debug2("comparator trim", range2);
range2 = range2.replace(re[t.TILDETRIM], tildeTrimReplace);
debug("tilde trim", range2);
debug2("tilde trim", range2);
range2 = range2.replace(re[t.CARETTRIM], caretTrimReplace);
debug("caret trim", range2);
debug2("caret trim", range2);
let rangeList = range2.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
if (loose) {
rangeList = rangeList.filter((comp) => {
debug("loose invalid filter", comp, this.options);
debug2("loose invalid filter", comp, this.options);
return !!comp.match(re[t.COMPARATORLOOSE]);
});
}
debug("range list", rangeList);
debug2("range list", rangeList);
const rangeMap = /* @__PURE__ */ new Map();
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
for (const comp of comparators) {
@@ -27931,7 +27931,7 @@ var require_range = __commonJS({
var cache = new LRU();
var parseOptions = require_parse_options();
var Comparator = require_comparator();
var debug = require_debug();
var debug2 = require_debug();
var SemVer = require_semver();
var {
safeRe: re,
@@ -27957,15 +27957,15 @@ var require_range = __commonJS({
};
var parseComparator = (comp, options) => {
comp = comp.replace(re[t.BUILD], "");
debug("comp", comp, options);
debug2("comp", comp, options);
comp = replaceCarets(comp, options);
debug("caret", comp);
debug2("caret", comp);
comp = replaceTildes(comp, options);
debug("tildes", comp);
debug2("tildes", comp);
comp = replaceXRanges(comp, options);
debug("xrange", comp);
debug2("xrange", comp);
comp = replaceStars(comp, options);
debug("stars", comp);
debug2("stars", comp);
return comp;
};
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
@@ -27975,7 +27975,7 @@ var require_range = __commonJS({
var replaceTilde = (comp, options) => {
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
return comp.replace(r, (_, M, m, p, pr) => {
debug("tilde", comp, _, M, m, p, pr);
debug2("tilde", comp, _, M, m, p, pr);
let ret;
if (isX(M)) {
ret = "";
@@ -27984,12 +27984,12 @@ var require_range = __commonJS({
} else if (isX(p)) {
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
} else if (pr) {
debug("replaceTilde pr", pr);
debug2("replaceTilde pr", pr);
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
} else {
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
}
debug("tilde return", ret);
debug2("tilde return", ret);
return ret;
});
};
@@ -27997,11 +27997,11 @@ var require_range = __commonJS({
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
};
var replaceCaret = (comp, options) => {
debug("caret", comp, options);
debug2("caret", comp, options);
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
const z = options.includePrerelease ? "-0" : "";
return comp.replace(r, (_, M, m, p, pr) => {
debug("caret", comp, _, M, m, p, pr);
debug2("caret", comp, _, M, m, p, pr);
let ret;
if (isX(M)) {
ret = "";
@@ -28014,7 +28014,7 @@ var require_range = __commonJS({
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
}
} else if (pr) {
debug("replaceCaret pr", pr);
debug2("replaceCaret pr", pr);
if (M === "0") {
if (m === "0") {
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
@@ -28025,7 +28025,7 @@ var require_range = __commonJS({
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
}
} else {
debug("no pr");
debug2("no pr");
if (M === "0") {
if (m === "0") {
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
@@ -28036,19 +28036,19 @@ var require_range = __commonJS({
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
}
}
debug("caret return", ret);
debug2("caret return", ret);
return ret;
});
};
var replaceXRanges = (comp, options) => {
debug("replaceXRanges", comp, options);
debug2("replaceXRanges", comp, options);
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
};
var replaceXRange = (comp, options) => {
comp = comp.trim();
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
debug("xRange", comp, ret, gtlt, M, m, p, pr);
debug2("xRange", comp, ret, gtlt, M, m, p, pr);
const xM = isX(M);
const xm = xM || isX(m);
const xp = xm || isX(p);
@@ -28095,16 +28095,16 @@ var require_range = __commonJS({
} else if (xp) {
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
}
debug("xRange return", ret);
debug2("xRange return", ret);
return ret;
});
};
var replaceStars = (comp, options) => {
debug("replaceStars", comp, options);
debug2("replaceStars", comp, options);
return comp.trim().replace(re[t.STAR], "");
};
var replaceGTE0 = (comp, options) => {
debug("replaceGTE0", comp, options);
debug2("replaceGTE0", comp, options);
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
};
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
@@ -28142,7 +28142,7 @@ var require_range = __commonJS({
}
if (version.prerelease.length && !options.includePrerelease) {
for (let i = 0; i < set.length; i++) {
debug(set[i].semver);
debug2(set[i].semver);
if (set[i].semver === Comparator.ANY) {
continue;
}
@@ -28179,7 +28179,7 @@ var require_comparator = __commonJS({
}
}
comp = comp.trim().split(/\s+/).join(" ");
debug("comparator", comp, options);
debug2("comparator", comp, options);
this.options = options;
this.loose = !!options.loose;
this.parse(comp);
@@ -28188,7 +28188,7 @@ var require_comparator = __commonJS({
} else {
this.value = this.operator + this.semver.version;
}
debug("comp", this);
debug2("comp", this);
}
parse(comp) {
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
@@ -28210,7 +28210,7 @@ var require_comparator = __commonJS({
return this.value;
}
test(version) {
debug("Comparator.test", version, this.options.loose);
debug2("Comparator.test", version, this.options.loose);
if (this.semver === ANY || version === ANY) {
return true;
}
@@ -28267,7 +28267,7 @@ var require_comparator = __commonJS({
var parseOptions = require_parse_options();
var { safeRe: re, t } = require_re();
var cmp = require_cmp();
var debug = require_debug();
var debug2 = require_debug();
var SemVer = require_semver();
var Range = require_range();
}
@@ -28854,7 +28854,12 @@ var isGitHubActions = !!process.env.GITHUB_ACTIONS;
var isInsideDocker = existsSync("/.dockerenv");
// utils/log.ts
var isDebugEnabled = () => process.env.LOG_LEVEL === "debug" || process.env.ACTIONS_STEP_DEBUG === "true" || core.isDebug();
var isRunnerDebugEnabled = () => core.isDebug();
var isLocalDebugEnabled = () => process.env.LOG_LEVEL === "debug" || process.env.ACTIONS_STEP_DEBUG === "true";
var isDebugEnabled = () => isLocalDebugEnabled() || isRunnerDebugEnabled();
function ts() {
return isDebugEnabled() ? `[${(/* @__PURE__ */ new Date()).toISOString()}] ` : "";
}
function formatArgs(args2) {
return args2.map((arg) => {
if (typeof arg === "string") return arg;
@@ -28965,19 +28970,16 @@ function separator(length = 50) {
const separatorText = "\u2500".repeat(length);
core.info(separatorText);
}
function ts() {
return isDebugEnabled() ? `[${(/* @__PURE__ */ new Date()).toISOString()}] ` : "";
}
var log = {
/** Print info message */
info: (...args2) => {
core.info(`${ts()}${formatArgs(args2)}`);
},
/** Print warning message */
/** Print a warning message. Use only for warnings that should be displayed in the job summary. */
warning: (...args2) => {
core.warning(`${ts()}${formatArgs(args2)}`);
},
/** Print error message */
/** Print an error message. Use only for errors that should be displayed in the job summary. */
error: (...args2) => {
core.error(`${ts()}${formatArgs(args2)}`);
},
@@ -28985,10 +28987,14 @@ var log = {
success: (...args2) => {
core.info(`${ts()}\xBB ${formatArgs(args2)}`);
},
/** Print debug message (only if LOG_LEVEL=debug) */
/** Print debug message (only when debug mode is enabled) */
debug: (...args2) => {
if (isDebugEnabled()) {
core.info(`[${(/* @__PURE__ */ new Date()).toISOString()}] [DEBUG] ${formatArgs(args2)}`);
if (isRunnerDebugEnabled()) {
core.debug(formatArgs(args2));
return;
}
if (isLocalDebugEnabled()) {
core.info(`${ts()}[DEBUG] ${formatArgs(args2)}`);
}
},
/** Print a formatted box with text */
@@ -41431,7 +41437,7 @@ async function validateStuckProgressComment(promptInput, octokit, owner, repo) {
return null;
} catch (error2) {
const errorMessage = error2 instanceof Error ? error2.message : String(error2);
log.error(`[post] failed to get comment ${commentId}: ${errorMessage}`);
log.info(`[post] failed to get comment ${commentId}: ${errorMessage}`);
return null;
}
}
@@ -41458,7 +41464,7 @@ async function getIsCancelled(params) {
}
log.info("[post] no cancellation found, assuming failure");
} catch (error2) {
log.warning(
log.info(
`[post] failed to get job status: ${error2 instanceof Error ? error2.message : String(error2)}`
);
}
@@ -41472,7 +41478,7 @@ async function runPostCleanup() {
const resolved = resolvePromptInput();
if (typeof resolved !== "string") promptInput = resolved;
} catch (error2) {
log.warning(
log.info(
`[post] failed to resolve prompt input: ${error2 instanceof Error ? error2.message : String(error2)}`
);
}
@@ -41503,7 +41509,7 @@ async function runPostCleanup() {
log.info("\xBB [post] successfully updated progress comment");
} catch (error2) {
const errorMessage = error2 instanceof Error ? error2.message : String(error2);
log.error(`[post] failed to update comment: ${errorMessage}`);
log.info(`[post] failed to update comment: ${errorMessage}`);
}
}