mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
chore(lint): resolve the 40 reserved baseline findings to a zero-noise lint:all (#118256)
* fix(lint): resolve reserved runtime findings * chore(lint): scope intentional contract findings * fix(android): preserve WebMessageListener bridge contract
This commit is contained in:
committed by
GitHub
parent
0e94d23034
commit
3ebb0ca3b6
@@ -67,6 +67,7 @@ const genericDirectCommitTerms = new Set([
|
||||
"restore",
|
||||
"update",
|
||||
]);
|
||||
const ansiEscapePattern = new RegExp(String.raw`\u001B\[[0-?]*[ -/]*[@-~]`, "g");
|
||||
let githubSnapshotState;
|
||||
|
||||
function fail(message) {
|
||||
@@ -260,14 +261,11 @@ function gitCommit(ref, required = false) {
|
||||
function fetchGithubApi(args) {
|
||||
try {
|
||||
return JSON.parse(
|
||||
run("ghx", ["api", ...args], { env: { GHX_NO_CACHE: "1" } }).replace(
|
||||
/\u001B\[[0-?]*[ -/]*[@-~]/g,
|
||||
"",
|
||||
),
|
||||
run("ghx", ["api", ...args], { env: { GHX_NO_CACHE: "1" } }).replace(ansiEscapePattern, ""),
|
||||
);
|
||||
} catch (error) {
|
||||
if (typeof error.stdout === "string" && error.stdout.trim() !== "") {
|
||||
return JSON.parse(error.stdout.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, ""));
|
||||
return JSON.parse(error.stdout.replace(ansiEscapePattern, ""));
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
@@ -1272,10 +1270,11 @@ function sourceCommits(base, target, mainRef) {
|
||||
for (const { candidates, commit, pullRequestOrigins } of pendingCanonicalMatches) {
|
||||
const matches = canonicalMainCommitMatches(
|
||||
commit,
|
||||
[...candidates.values()].map((candidate) => ({
|
||||
...withChangedPaths(candidate),
|
||||
pullRequests: candidateMainPullRequests.get(candidate.hash) ?? [],
|
||||
})),
|
||||
[...candidates.values()].map((candidate) =>
|
||||
Object.assign({}, withChangedPaths(candidate), {
|
||||
pullRequests: candidateMainPullRequests.get(candidate.hash) ?? [],
|
||||
}),
|
||||
),
|
||||
);
|
||||
canonicalMainCommitsByReleaseCommit.set(commit.hash, matches);
|
||||
if (pullRequestOrigins.length > 0 && matches.length === 1) {
|
||||
@@ -2091,14 +2090,12 @@ export function ledgerFor(
|
||||
for (const issue of linkedIssues) {
|
||||
addHandles(thanks, issue.thanks);
|
||||
}
|
||||
return {
|
||||
...entry,
|
||||
...editorialClassification(entry.title),
|
||||
return Object.assign({}, entry, editorialClassification(entry.title), {
|
||||
externalReferences: priorEntry?.externalReferences ?? [],
|
||||
linkedIssues,
|
||||
priorReferences,
|
||||
thanks,
|
||||
};
|
||||
});
|
||||
});
|
||||
const shippedBaselineLine = formatShippedBaselineExclusions(shippedBaselines);
|
||||
const ledger = [
|
||||
|
||||
@@ -74,6 +74,10 @@ function throwPreservingValue(value) {
|
||||
throw /** @type {Error} */ (value);
|
||||
}
|
||||
|
||||
function aggregateErrorWithCause(errors, message, cause) {
|
||||
return new AggregateError(errors, message, { cause });
|
||||
}
|
||||
|
||||
function git(checkout, args, options = {}) {
|
||||
return execFileSync("git", ["-C", checkout, ...args], {
|
||||
encoding: options.encoding ?? "utf8",
|
||||
@@ -1087,9 +1091,10 @@ function prepareLaunchAgentEntrypointReplacement(deployment, entrypoint, options
|
||||
try {
|
||||
restore();
|
||||
} catch (restoreError) {
|
||||
throw new AggregateError(
|
||||
throw aggregateErrorWithCause(
|
||||
[ownershipError, restoreError],
|
||||
"System LaunchDaemon ownership changed during plist publication and the previous LaunchAgent could not be restored",
|
||||
restoreError,
|
||||
);
|
||||
}
|
||||
throw ownershipError;
|
||||
@@ -1424,9 +1429,10 @@ function stopManagedGatewayAndProve(
|
||||
if (!stopError) {
|
||||
throw proofError;
|
||||
}
|
||||
throw new AggregateError(
|
||||
throw aggregateErrorWithCause(
|
||||
[stopError, proofError],
|
||||
"Gateway stop command failed and native stopped proof did not converge",
|
||||
proofError,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1751,9 +1757,10 @@ function bootstrapManagedGateway(runCommand, checkout, deployment, options = {})
|
||||
);
|
||||
} catch (cleanupError) {
|
||||
if (restartError) {
|
||||
throw new AggregateError(
|
||||
throw aggregateErrorWithCause(
|
||||
[restartError, cleanupError],
|
||||
"Gateway restart failed and the one-shot startup trace environment could not be cleared",
|
||||
cleanupError,
|
||||
);
|
||||
}
|
||||
throw cleanupError;
|
||||
@@ -2572,7 +2579,7 @@ export function maintainMain(options, dependencies = {}) {
|
||||
}
|
||||
gatewaySuspension = prepareSuspension(update.checkout, gatewayControlDeployment);
|
||||
} catch (controlError) {
|
||||
throw new AggregateError(
|
||||
throw aggregateErrorWithCause(
|
||||
[
|
||||
new UpdateInvariantError(
|
||||
"gateway_snapshot_control_unavailable",
|
||||
@@ -2582,6 +2589,7 @@ export function maintainMain(options, dependencies = {}) {
|
||||
controlError,
|
||||
],
|
||||
"Gateway control is unavailable and the managed Gateway could not be proven stopped",
|
||||
controlError,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2595,9 +2603,10 @@ export function maintainMain(options, dependencies = {}) {
|
||||
proof: proveGatewayStopped(update.checkout),
|
||||
};
|
||||
} catch (proofError) {
|
||||
throw new AggregateError(
|
||||
throw aggregateErrorWithCause(
|
||||
[prepareError, proofError],
|
||||
"Gateway suspension failed and the managed Gateway could not be proven stopped",
|
||||
proofError,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2651,9 +2660,10 @@ export function maintainMain(options, dependencies = {}) {
|
||||
gatewayControlDeployment,
|
||||
);
|
||||
} catch (resumeError) {
|
||||
throw new AggregateError(
|
||||
throw aggregateErrorWithCause(
|
||||
[error, resumeError],
|
||||
"Gateway stop failed and the prepared maintenance suspension could not be resumed",
|
||||
resumeError,
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
@@ -2757,9 +2767,10 @@ export function maintainMain(options, dependencies = {}) {
|
||||
});
|
||||
waitForManagedGatewayReadiness(gatewayDeploymentBefore, probeMilestones, sleep);
|
||||
} catch (recoveryError) {
|
||||
throw new AggregateError(
|
||||
throw aggregateErrorWithCause(
|
||||
[error, recoveryError],
|
||||
"Gateway replacement failed and the previous managed service could not be restored",
|
||||
recoveryError,
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user