📦 deps(thirdparty): update snapshots
This commit is contained in:
@@ -24,14 +24,7 @@ function makeCheckRun(name, status, conclusion, startedAt, id, suiteId = 1) {
|
||||
|
||||
function evidenceSnapshot(overrides = {}) {
|
||||
return {
|
||||
score: {
|
||||
scores: {
|
||||
metadata: 90,
|
||||
documentation: 80,
|
||||
security: 100,
|
||||
total: 90,
|
||||
},
|
||||
},
|
||||
audit: { counts: { error: 0, warning: 0, info: 0 } },
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
@@ -64,19 +57,6 @@ function evidenceSnapshot(overrides = {}) {
|
||||
assert.strictEqual(summary, "Summary line 1\nSummary line 2");
|
||||
}
|
||||
|
||||
{
|
||||
const template = `# Pull Request Description\n\nIntro\n\n## Change Classification\n- [ ] Skill PR\n\n## Quality Bar Checklist ✅\n- [ ] Standards`;
|
||||
const body = mergeBatch.normalizePrBody(
|
||||
`Short summary\n\n## Change Classification\n- [ ] Old item`,
|
||||
template,
|
||||
);
|
||||
|
||||
assert.ok(body.startsWith("Short summary"));
|
||||
assert.ok(body.includes("## Change Classification"));
|
||||
assert.ok(body.includes("## Quality Bar Checklist ✅"));
|
||||
assert.ok(!body.includes("Old item"));
|
||||
}
|
||||
|
||||
{
|
||||
const aliases = mergeBatch.getRequiredCheckAliases({ hasSkillChanges: true });
|
||||
assert.ok(aliases.some((entry) => !Array.isArray(entry) && entry.aliases.includes("review")));
|
||||
@@ -176,21 +156,6 @@ function evidenceSnapshot(overrides = {}) {
|
||||
["missing"],
|
||||
"a skipped manual-review job must not pass",
|
||||
);
|
||||
const missingCredentials = makeCheckRun(
|
||||
"Skill Review / missing-review-credentials",
|
||||
"completed",
|
||||
"failure",
|
||||
"2026-04-01T10:04:00Z",
|
||||
14,
|
||||
);
|
||||
assert.deepStrictEqual(
|
||||
mergeBatch.summarizeRequiredCheckRuns(
|
||||
[skippedReview, skippedManual, missingCredentials],
|
||||
[withAttestation],
|
||||
).map((entry) => entry.state),
|
||||
["failed"],
|
||||
"missing internal review credentials must fail promptly",
|
||||
);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -625,10 +590,10 @@ function approvalDependencies(overrides = {}) {
|
||||
);
|
||||
assert.throws(
|
||||
() => mergeBatch.validateChangedSkillEvidence(
|
||||
{ ...report, changes: [{ ...report.changes[0], after: evidenceSnapshot({ score: { scores: { metadata: NaN } } }) }] },
|
||||
{ ...report, changes: [{ ...report.changes[0], after: evidenceSnapshot({ audit: { counts: { error: -1, warning: 0, info: 0 } } }) }] },
|
||||
{ mergeBaseOid: BASE_SHA, headOid: HEAD_SHA, rawRecords: [record] },
|
||||
),
|
||||
/missing or non-finite/,
|
||||
/missing or invalid/,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -850,80 +815,4 @@ function approvalDependencies(overrides = {}) {
|
||||
);
|
||||
}
|
||||
|
||||
(async () => {
|
||||
const baselineRun = runFixture({ id: 190, check_suite_id: 890 });
|
||||
const freshCiRun = runFixture({ id: 200, check_suite_id: 900 });
|
||||
const freshReviewRun = runFixture({
|
||||
id: 201,
|
||||
workflow_id: 101,
|
||||
path: ".github/workflows/skill-review.yml",
|
||||
check_suite_id: 901,
|
||||
});
|
||||
const workflows = [
|
||||
workflowFixture(),
|
||||
workflowFixture({ id: 101, path: ".github/workflows/skill-review.yml" }),
|
||||
];
|
||||
let poll = 0;
|
||||
const approvals = [];
|
||||
const oldFailure = makeCheckRun("pr-policy", "completed", "failure", "2026-04-01T09:00:00Z", 1, 890);
|
||||
const ciChecks = ["pr-policy", "pr-evidence", "source-validation", "artifact-preview"]
|
||||
.map((name, index) => makeCheckRun(name, "completed", "success", `2026-04-01T10:0${index}:00Z`, 10 + index, 900));
|
||||
const reviewChecks = [
|
||||
makeCheckRun("Skill Review / review", "completed", "skipped", "2026-04-01T10:04:00Z", 20, 901),
|
||||
makeCheckRun("Skill Review / manual-review-required", "completed", "success", "2026-04-01T10:05:00Z", 21, 901),
|
||||
];
|
||||
const prDetails = {
|
||||
number: 450,
|
||||
baseRefName: "main",
|
||||
baseRefOid: BASE_SHA,
|
||||
headRefOid: HEAD_SHA,
|
||||
headRefName: "feature/example",
|
||||
headRepository: { nameWithOwner: "contributor/repo" },
|
||||
};
|
||||
|
||||
const summaries = await mergeBatch.waitForFreshRequiredChecks(
|
||||
"/repo",
|
||||
"owner/repo",
|
||||
prDetails,
|
||||
mergeBatch.getRequiredCheckAliases(
|
||||
{ hasSkillChanges: true },
|
||||
{ allowManualReview: true },
|
||||
),
|
||||
0.001,
|
||||
{
|
||||
baselineRunIds: [190],
|
||||
tuple: { baseOid: BASE_SHA, headOid: HEAD_SHA },
|
||||
hasSkillChanges: true,
|
||||
maxAttempts: 5,
|
||||
dependencies: {
|
||||
listPullRequestWorkflowRuns() {
|
||||
poll += 1;
|
||||
if (poll === 1) return [baselineRun];
|
||||
if (poll === 2) return [baselineRun, freshCiRun];
|
||||
return [baselineRun, freshCiRun, freshReviewRun];
|
||||
},
|
||||
listActionRequiredRuns() {
|
||||
if (poll === 2) return [freshCiRun];
|
||||
if (poll === 3) return [freshReviewRun];
|
||||
return [];
|
||||
},
|
||||
listWorkflowDefinitions() { return workflows; },
|
||||
listCheckRuns() {
|
||||
if (poll < 3) return [oldFailure];
|
||||
if (poll === 3) return [oldFailure, ...ciChecks];
|
||||
return [oldFailure, ...ciChecks, ...reviewChecks];
|
||||
},
|
||||
loadPullRequestDetails() { return prDetails; },
|
||||
approveWorkflowRun(_root, _slug, run) { approvals.push(run.id); },
|
||||
sleep() { return Promise.resolve(); },
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepStrictEqual(approvals, [200, 201], "only fresh workflow runs are approved once");
|
||||
assert.ok(summaries.every((summary) => summary.state === "success"));
|
||||
console.log("ok");
|
||||
})().catch((error) => {
|
||||
console.error(error);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
console.log("ok");
|
||||
|
||||
Reference in New Issue
Block a user