📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -6,6 +6,7 @@ const path = require("path");
|
||||
const { spawnSync } = require("child_process");
|
||||
|
||||
const { findProjectRoot } = require("../lib/project-root");
|
||||
const { resolveBlobSizes } = require("../lib/git-blob-sizes");
|
||||
const { parseRawDiff } = require("../lib/git-raw-diff");
|
||||
const {
|
||||
classifyChangeRecords,
|
||||
@@ -13,11 +14,6 @@ const {
|
||||
} = require("../lib/workflow-contract");
|
||||
|
||||
const DEFAULT_POLL_SECONDS = 20;
|
||||
const BASE_BRANCH_MODIFIED_PATTERNS = [
|
||||
/base branch was modified/i,
|
||||
/base branch has been modified/i,
|
||||
/branch was modified/i,
|
||||
];
|
||||
const REQUIRED_CHECKS = [
|
||||
["pr-policy", { label: "pr-policy", aliases: ["pr-policy"], appId: 15368 }],
|
||||
["pr-evidence", { label: "pr-evidence", aliases: ["pr-evidence"], appId: 15368 }],
|
||||
@@ -352,6 +348,8 @@ function recomputeChangedSkillEvidence(
|
||||
mergeBaseOid,
|
||||
"--head",
|
||||
headOid,
|
||||
"--policy-ref",
|
||||
evaluatorOid,
|
||||
"--output",
|
||||
outputPath,
|
||||
],
|
||||
@@ -413,43 +411,6 @@ function readRawChangeRecords(projectRoot, baseOid, headOid, dependencies = {})
|
||||
return parseRawDiff(raw);
|
||||
}
|
||||
|
||||
function resolveBlobSizes(projectRoot, records, dependencies = {}) {
|
||||
const execute = dependencies.runCommand || runCommand;
|
||||
const objectIds = [...new Set(records.flatMap((record) => [record.old_oid, record.new_oid]))]
|
||||
.filter((oid) => FULL_SHA_PATTERN.test(String(oid || "")) && !/^0+$/u.test(oid));
|
||||
if (!objectIds.length) {
|
||||
throw new Error("Raw Git diff did not contain any materialized blob object IDs.");
|
||||
}
|
||||
|
||||
const stdout = execute(
|
||||
"git",
|
||||
["cat-file", "--batch-check=%(objectname) %(objecttype) %(objectsize)"],
|
||||
projectRoot,
|
||||
{ capture: true, input: `${objectIds.join("\n")}\n` },
|
||||
);
|
||||
const sizes = new Map();
|
||||
for (const line of String(stdout || "").split(/\r?\n/u).filter(Boolean)) {
|
||||
const match = line.match(/^(?<oid>[0-9a-f]{40}) (?<type>\S+) (?<size>\d+)$/u);
|
||||
if (!match?.groups || !objectIds.includes(match.groups.oid)) {
|
||||
throw new Error(`Unexpected git cat-file response: ${line}`);
|
||||
}
|
||||
if (match.groups.type !== "blob") {
|
||||
throw new Error(`Object ${match.groups.oid} is ${match.groups.type}, not a blob.`);
|
||||
}
|
||||
const size = Number(match.groups.size);
|
||||
if (!Number.isSafeInteger(size) || size < 0) {
|
||||
throw new Error(`Object ${match.groups.oid} has an invalid size.`);
|
||||
}
|
||||
sizes.set(match.groups.oid, size);
|
||||
}
|
||||
for (const oid of objectIds) {
|
||||
if (!sizes.has(oid)) {
|
||||
throw new Error(`git cat-file did not return metadata for ${oid}.`);
|
||||
}
|
||||
}
|
||||
return sizes;
|
||||
}
|
||||
|
||||
function runGhJson(projectRoot, args, options = {}) {
|
||||
const stdout = runCommand(
|
||||
"gh",
|
||||
@@ -1222,11 +1183,6 @@ function mergePullRequestImmediately(projectRoot, repoSlug, prDetails, dependenc
|
||||
return response;
|
||||
}
|
||||
|
||||
function isRetryableMergeError(error) {
|
||||
const message = String(error?.message || error || "");
|
||||
return BASE_BRANCH_MODIFIED_PATTERNS.some((pattern) => pattern.test(message));
|
||||
}
|
||||
|
||||
function gitCheckoutMain(projectRoot) {
|
||||
runCommand("git", ["checkout", "main"], projectRoot);
|
||||
}
|
||||
@@ -1364,7 +1320,6 @@ module.exports = {
|
||||
assertEffectiveMainProtection,
|
||||
assertFullSha,
|
||||
assertUnchangedTuple,
|
||||
baseBranchModifiedPatterns: BASE_BRANCH_MODIFIED_PATTERNS,
|
||||
buildSquashMergeBody,
|
||||
buildSquashMergeSubject,
|
||||
checkRunMatchesAliases,
|
||||
@@ -1376,7 +1331,6 @@ module.exports = {
|
||||
getRequiredCheckAliases,
|
||||
gitCheckoutMain,
|
||||
gitPullMain,
|
||||
isRetryableMergeError,
|
||||
listActionRequiredRuns,
|
||||
listCheckRuns,
|
||||
listWorkflowDefinitions,
|
||||
|
||||
Reference in New Issue
Block a user