Skip to content

Commit 1ad4a7c

Browse files
Merge branch 'main' into codex/public-wolfi-image
2 parents 3dbf7ba + 3a98b55 commit 1ad4a7c

249 files changed

Lines changed: 5880 additions & 8547 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/scripts/invoice-desk-target.test.mjs‎

Lines changed: 47 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -27,55 +27,61 @@ function pullRequest(overrides = {}) {
2727
};
2828
}
2929

30-
test("selects the requested PR head rather than the trusted workflow commit", async () => {
31-
assert.deepEqual(
32-
await resolveScanTargets(context, async (number) => {
33-
assert.equal(number, "7");
34-
return pullRequest();
35-
}),
36-
[{ pr: 7, sha: sourceSha }],
37-
);
38-
});
39-
40-
test("includes fork and draft PRs without depending on a PR workflow run", async () => {
41-
assert.deepEqual(
42-
await resolveScanTargets(context, async () =>
43-
pullRequest({
44-
draft: true,
45-
head: { sha: sourceSha, repo: { full_name: "contributor/invoices" } },
46-
}),
47-
),
48-
[{ pr: 7, sha: sourceSha }],
49-
);
30+
test("initial selection and approval recheck require the selected PR and revision to remain eligible", async () => {
31+
const target = { pr: 7, sha: sourceSha };
32+
// The approval step must use its matrix target even if dispatch inputs differ.
33+
const recheck = {
34+
...context,
35+
target: { ...target },
36+
event: { inputs: { pr_number: "9", source_sha: mainSha } },
37+
};
38+
for (const request of [context, recheck]) {
39+
for (const [overrides, expected] of [
40+
[{}, [target]],
41+
[
42+
{
43+
draft: true,
44+
head: { sha: sourceSha, repo: { full_name: "contributor/invoices" } },
45+
},
46+
[target],
47+
],
48+
[{ state: "closed" }, []],
49+
[{ base: { ref: "release", repo: { full_name: repository } } }, []],
50+
[{ base: { ref: "main", repo: { full_name: "other/invoices" } } }, []],
51+
[{ head: { sha: mainSha } }, []],
52+
[{ head: { sha: "3".repeat(40) } }, []],
53+
]) {
54+
const actual = await resolveScanTargets(request, async (number) => {
55+
assert.equal(number, "7");
56+
return pullRequest(overrides);
57+
});
58+
assert.deepEqual(actual, expected);
59+
}
60+
}
5061
});
5162

52-
test("rechecking after approval excludes closed, retargeted, and superseded PRs", async () => {
53-
assert.deepEqual(
54-
await resolveScanTargets(context, async () => pullRequest()),
55-
[{ pr: 7, sha: sourceSha }],
56-
);
57-
for (const changed of [
58-
{ state: "closed" },
59-
{ base: { ref: "release", repo: { full_name: repository } } },
60-
{ base: { ref: "main", repo: { full_name: "other/invoices" } } },
61-
{ head: { sha: "3".repeat(40) } },
63+
test("manual and scheduled baselines use the trusted workflow commit before and after approval", async () => {
64+
const target = { pr: 0, sha: mainSha };
65+
const scheduled = {
66+
...context,
67+
eventName: "schedule",
68+
event: { schedule: "17 3 * * 1" },
69+
};
70+
for (const request of [
71+
{ ...context, event: { inputs: {} } },
72+
scheduled,
73+
{ ...context, target: { ...target } },
74+
{ ...scheduled, target: { ...target } },
6275
]) {
6376
assert.deepEqual(
64-
await resolveScanTargets(context, async () => pullRequest(changed)),
65-
[],
77+
await resolveScanTargets(request, () =>
78+
assert.fail("unexpected API call"),
79+
),
80+
[target],
6681
);
6782
}
6883
});
6984

70-
test("manual baseline scans use the trusted workflow commit", async () => {
71-
assert.deepEqual(
72-
await resolveScanTargets({ ...context, event: { inputs: {} } }, () =>
73-
assert.fail("unexpected API call"),
74-
),
75-
[{ pr: 0, sha: mainSha }],
76-
);
77-
});
78-
7985
test("incomplete or invalid PR inputs fail instead of falling back to a baseline", async () => {
8086
for (const inputs of [
8187
{ pr_number: "7" },
@@ -117,48 +123,6 @@ test("PR events and completed PR workflows do not queue inference or query GitHu
117123
}
118124
});
119125

120-
test("scheduled baseline scans use the trusted workflow commit", async () => {
121-
assert.deepEqual(
122-
await resolveScanTargets(
123-
{ ...context, eventName: "schedule", event: { schedule: "17 3 * * 1" } },
124-
() => assert.fail("unexpected API call"),
125-
),
126-
[{ pr: 0, sha: mainSha }],
127-
);
128-
});
129-
130-
test("approval recheck stays bound to its matrix PR and source revision", async () => {
131-
const run = { ...context, target: { pr: 7, sha: sourceSha } };
132-
for (const changed of [
133-
{ state: "closed" },
134-
{ base: { ref: "release", repo: { full_name: repository } } },
135-
{ head: { sha: mainSha } },
136-
]) {
137-
assert.deepEqual(
138-
await resolveScanTargets(run, async (number) => {
139-
assert.equal(number, "7");
140-
return pullRequest(changed);
141-
}),
142-
[],
143-
);
144-
}
145-
assert.deepEqual(await resolveScanTargets(run, async () => pullRequest()), [
146-
{ pr: 7, sha: sourceSha },
147-
]);
148-
});
149-
150-
test("baseline approval recheck retains the original trusted workflow commit", async () => {
151-
for (const eventName of ["workflow_dispatch", "schedule"]) {
152-
assert.deepEqual(
153-
await resolveScanTargets(
154-
{ ...context, eventName, target: { pr: 0, sha: mainSha } },
155-
() => assert.fail("unexpected API call"),
156-
),
157-
[{ pr: 0, sha: mainSha }],
158-
);
159-
}
160-
});
161-
162126
test("resolver CLI emits the requested target without dispatching another workflow", (t) => {
163127
const root = mkdtempSync(join(tmpdir(), "invoice-desk-target-"));
164128
t.after(() => rmSync(root, { recursive: true, force: true }));

‎.github/scripts/test_check_plugin_source_compatibility.mts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ test("checkout preserves source size with autocrlf", () => {
9292
git(root, "add", "--", ".gitattributes", name);
9393
unlinkSync(source);
9494
git(root, "checkout-index", "--", name);
95-
const result = runChecker("--plugin-root", root);
96-
assert.equal(result.status, 0, result.stderr);
9795
assert.deepEqual(readFileSync(source), content);
9896
}
97+
const result = runChecker("--plugin-root", root);
98+
assert.equal(result.status, 0, result.stderr);
9999
});
100100

101101
test("accepts Markdown structures, natural line endings, and inline markup", () => {

‎action.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: OpenAI Codex Security
2-
description: Scan code with Codex Security, enforce findings policy, and produce JSON, coverage, and SARIF reports.
2+
description: Scan code with Codex Security, enforce findings policy, and produce JSON and SARIF reports.
33
branding:
44
icon: shield
55
color: black
@@ -60,8 +60,10 @@ outputs:
6060
description: Absolute validated SARIF file path, or empty when unavailable or withheld.
6161
json-path:
6262
description: Absolute canonical findings JSON path, or empty when unavailable or withheld.
63+
manifest-path:
64+
description: Absolute scan manifest path, including scan status and scope, or empty when unavailable or withheld.
6365
coverage-path:
64-
description: Absolute coverage JSON path, or empty when unavailable or withheld.
66+
description: Legacy coverage JSON path. Empty for current CLI results.
6567
results-directory:
6668
description: Runner-local reports directory; do not upload it recursively.
6769
scan-status:

‎evals/secret-discovery/harness.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const outputSchema = object({
9494
remediation: text,
9595
}),
9696
),
97-
coverage: object({
97+
reviewState: object({
9898
surfaces: array(
9999
object({
100100
label: text,

0 commit comments

Comments
 (0)